private function validateKey($key)
    {
        $details = openssl_pkey_get_details($key);

        if (!isset($details['key']) || $details['type'] !== OPENSSL_KEYTYPE_RSA) {
            throw new \InvalidArgumentException('This key is not compatible with RSA signatures');
        }
    }
private function validateKey($key)
    {
        $details = openssl_pkey_get_details($key);

        if (!isset($details['key']) || $details['type'] !== OPENSSL_KEYTYPE_RSA) {
            throw new \InvalidArgumentException('This key is not compatible with RSA signatures');
        }
    }
private function validateKey ( $ key ) { $ details = openssl_pkey_get_details ( $ key ) ; if ( ! isset ( $ details [ 'key' ] ) || $ details [ 'type' ] !== OPENSSL_KEYTYPE_RSA ) { throw new \ InvalidArgumentException ( 'This key is not compatible with RSA signatures' ) ; } }
Returns if the key type is equals with expected type

@param resource $key

@return boolean
Returns if the key type is equals with expected type