EVP_PKEY_check.pod 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_check, EVP_PKEY_param_check, EVP_PKEY_public_check,
  4. EVP_PKEY_private_check, EVP_PKEY_pairwise_check
  5. - key and parameter validation functions
  6. =head1 SYNOPSIS
  7. #include <openssl/evp.h>
  8. int EVP_PKEY_check(EVP_PKEY_CTX *ctx);
  9. int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx);
  10. int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx);
  11. int EVP_PKEY_private_check(EVP_PKEY_CTX *ctx);
  12. int EVP_PKEY_pairwise_check(EVP_PKEY_CTX *ctx);
  13. =head1 DESCRIPTION
  14. EVP_PKEY_param_check() validates the parameters component of the key
  15. given by B<ctx>.
  16. EVP_PKEY_public_check() validates the public component of the key given by B<ctx>.
  17. EVP_PKEY_private_check() validates the private component of the key given by B<ctx>.
  18. EVP_PKEY_pairwise_check() validates that the public and private components have
  19. the correct mathematical relationship to each other for the key given by B<ctx>.
  20. EVP_PKEY_check() validates all components of a key given by B<ctx>.
  21. =head1 NOTES
  22. Refer to SP800-56A and SP800-56B for rules relating to when these functions
  23. should be called during key establishment.
  24. It is not necessary to call these functions after locally calling an approved key
  25. generation method, but may be required for assurance purposes when receiving
  26. keys from a third party.
  27. In OpenSSL an EVP_PKEY structure containing a private key also contains the
  28. public key components and parameters (if any). An OpenSSL private key is
  29. equivalent to what some libraries call a "key pair". A private key can be used
  30. in functions which require the use of a public key or parameters.
  31. =head1 RETURN VALUES
  32. All functions return 1 for success or others for failure.
  33. They return -2 if the operation is not supported for the specific algorithm.
  34. =head1 SEE ALSO
  35. L<EVP_PKEY_CTX_new(3)>,
  36. L<EVP_PKEY_fromdata(3)>,
  37. =head1 HISTORY
  38. EVP_PKEY_check(), EVP_PKEY_public_check() and EVP_PKEY_param_check() were added
  39. in OpenSSL 1.1.1.
  40. EVP_PKEY_private_check() and EVP_PKEY_pairwise_check() were added
  41. in OpenSSL 3.0.
  42. =head1 COPYRIGHT
  43. Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
  44. Licensed under the Apache License 2.0 (the "License"). You may not use
  45. this file except in compliance with the License. You can obtain a copy
  46. in the file LICENSE in the source distribution or at
  47. L<https://www.openssl.org/source/license.html>.
  48. =cut