EVP_PKEY_copy_parameters.pod 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_missing_parameters, EVP_PKEY_copy_parameters, EVP_PKEY_parameters_eq,
  4. EVP_PKEY_cmp_parameters, EVP_PKEY_eq,
  5. EVP_PKEY_cmp - public key parameter and comparison functions
  6. =head1 SYNOPSIS
  7. #include <openssl/evp.h>
  8. int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
  9. int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
  10. int EVP_PKEY_parameters_eq(const EVP_PKEY *a, const EVP_PKEY *b);
  11. int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
  12. int EVP_PKEY_eq(const EVP_PKEY *a, const EVP_PKEY *b);
  13. int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
  14. =head1 DESCRIPTION
  15. The function EVP_PKEY_missing_parameters() returns 1 if the public key
  16. parameters of B<pkey> are missing and 0 if they are present or the algorithm
  17. doesn't use parameters.
  18. The function EVP_PKEY_copy_parameters() copies the parameters from key
  19. B<from> to key B<to>. An error is returned if the parameters are missing in
  20. B<from> or present in both B<from> and B<to> and mismatch. If the parameters
  21. in B<from> and B<to> are both present and match this function has no effect.
  22. The function EVP_PKEY_parameters_eq() checks the parameters of keys
  23. B<a> and B<b> for equality.
  24. The function EVP_PKEY_eq() checks the public key components and parameters
  25. (if present) of keys B<a> and B<b> for equality.
  26. =head1 NOTES
  27. The main purpose of the functions EVP_PKEY_missing_parameters() and
  28. EVP_PKEY_copy_parameters() is to handle public keys in certificates where the
  29. parameters are sometimes omitted from a public key if they are inherited from
  30. the CA that signed it.
  31. Since OpenSSL private keys contain public key components too the function
  32. EVP_PKEY_eq() can also be used to determine if a private key matches
  33. a public key.
  34. EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters() differ in their return values
  35. compared to other _cmp() functions. They are aliases for EVP_PKEY_eq() and
  36. EVP_PKEY_parameters_eq() functions provided for backwards compatibility
  37. with existing applications.
  38. =head1 RETURN VALUES
  39. The function EVP_PKEY_missing_parameters() returns 1 if the public key
  40. parameters of B<pkey> are missing and 0 if they are present or the algorithm
  41. doesn't use parameters.
  42. These functions EVP_PKEY_copy_parameters() returns 1 for success and 0 for
  43. failure.
  44. The functions EVP_PKEY_cmp_parameters(), EVP_PKEY_parameters_eq(),
  45. EVP_PKEY_cmp() and EVP_PKEY_eq() return 1 if their
  46. inputs match, 0 if they don't match, -1 if the key types are different and
  47. -2 if the operation is not supported.
  48. =head1 SEE ALSO
  49. L<EVP_PKEY_CTX_new(3)>,
  50. L<EVP_PKEY_keygen(3)>
  51. =head1 HISTORY
  52. EVP_PKEY_eq() and EVP_PKEY_parameters_eq() were added in OpenSSL 3.0 to
  53. avoid confusion on the return values of EVP_PKEY_cmp() and
  54. EVP_PKEY_cmp_parameters() which unlike other _cmp()
  55. functions do not return 0 in case their arguments are equal.
  56. =head1 COPYRIGHT
  57. Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
  58. Licensed under the Apache License 2.0 (the "License"). You may not use
  59. this file except in compliance with the License. You can obtain a copy
  60. in the file LICENSE in the source distribution or at
  61. L<https://www.openssl.org/source/license.html>.
  62. =cut