#include <openssl/evp.h> int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
The function EVP_PKEY_copy_parameters() copies the parameters from key from to key to.
The funcion EVP_PKEY_cmp_parameters() compares the parameters of keys a and b.
The funcion EVP_PKEY_cmp() compares the public key components and paramters (if present) of keys a and b.
Since OpenSSL private keys contain public key components too the function EVP_PKEY_cmp() can also be used to determine if a private key matches a public key.
These functions EVP_PKEY_copy_parameters() returns 1 for success and 0 for failure.
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.