The function EVP_PKEY_cmp_parameters() and EVP_PKEY_cmp() return 1 if
the keys match, 0 if they don't match, -1 if the key types are different
and -2 if the operation is not supported.
At this point I'm explicitly checking the type on each and not able to check -2 against a 'not supported' or in ruby 'not implemented' exception given EVP_PKEY_ASN1_METHOD(3) states ANY negative number can be an error.
The current work in progress can be found here if interested.