EVP_PKEY_cmp.pod 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_copy_parameters, EVP_PKEY_missing_parameters, EVP_PKEY_cmp_parameters, EVP_PKEY_cmp - public key parameter and comparison functions
  4. =head1 SYNOPSIS
  5. #include <openssl/evp.h>
  6. int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
  7. int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
  8. int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
  9. int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
  10. =head1 DESCRIPTION
  11. The function EVP_PKEY_missing_parameters() returns 1 if the public key
  12. parameters of B<pkey> are missing and 0 if they are present or the algorithm
  13. doesn't use parameters.
  14. The function EVP_PKEY_copy_parameters() copies the parameters from key
  15. B<from> to key B<to>. An error is returned if the parameters are missing in
  16. B<from> or present in both B<from> and B<to> and mismatch. If the parameters
  17. in B<from> and B<to> are both present and match this function has no effect.
  18. The function EVP_PKEY_cmp_parameters() compares the parameters of keys
  19. B<a> and B<b>.
  20. The function EVP_PKEY_cmp() compares the public key components and paramters
  21. (if present) of keys B<a> and B<b>.
  22. =head1 NOTES
  23. The main purpose of the functions EVP_PKEY_missing_parameters() and
  24. EVP_PKEY_copy_parameters() is to handle public keys in certificates where the
  25. parameters are sometimes omitted from a public key if they are inherited from
  26. the CA that signed it.
  27. Since OpenSSL private keys contain public key components too the function
  28. EVP_PKEY_cmp() can also be used to determine if a private key matches
  29. a public key.
  30. =head1 RETURN VALUES
  31. The function EVP_PKEY_missing_parameters() returns 1 if the public key
  32. parameters of B<pkey> are missing and 0 if they are present or the algorithm
  33. doesn't use parameters.
  34. These functions EVP_PKEY_copy_parameters() returns 1 for success and 0 for
  35. failure.
  36. The function EVP_PKEY_cmp_parameters() and EVP_PKEY_cmp() return 1 if the
  37. keys match, 0 if they don't match, -1 if the key types are different and
  38. -2 if the operation is not supported.
  39. =head1 SEE ALSO
  40. L<EVP_PKEY_CTX_new(3)|EVP_PKEY_CTX_new(3)>,
  41. L<EVP_PKEY_keygen(3)|EVP_PKEY_keygen(3)>
  42. =cut