EVP_PKEY_check.pod 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_check, EVP_PKEY_param_check, EVP_PKEY_param_check_quick,
  4. EVP_PKEY_public_check, EVP_PKEY_public_check_quick, EVP_PKEY_private_check,
  5. EVP_PKEY_pairwise_check
  6. - key and parameter validation functions
  7. =head1 SYNOPSIS
  8. #include <openssl/evp.h>
  9. int EVP_PKEY_check(EVP_PKEY_CTX *ctx);
  10. int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx);
  11. int EVP_PKEY_param_check_quick(EVP_PKEY_CTX *ctx);
  12. int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx);
  13. int EVP_PKEY_public_check_quick(EVP_PKEY_CTX *ctx);
  14. int EVP_PKEY_private_check(EVP_PKEY_CTX *ctx);
  15. int EVP_PKEY_pairwise_check(EVP_PKEY_CTX *ctx);
  16. =head1 DESCRIPTION
  17. EVP_PKEY_param_check() validates the parameters component of the key
  18. given by B<ctx>. This check will always succeed for key types that do not have
  19. parameters.
  20. EVP_PKEY_param_check_quick() validates the parameters component of the key
  21. given by B<ctx> like EVP_PKEY_param_check() does. However some algorithm
  22. implementations may offer a quicker form of validation that omits some checks in
  23. order to perform a lightweight sanity check of the key. If a quicker form is not
  24. provided then this function call does the same thing as EVP_PKEY_param_check().
  25. EVP_PKEY_public_check() validates the public component of the key given by B<ctx>.
  26. EVP_PKEY_public_check_quick() validates the public component of the key
  27. given by B<ctx> like EVP_PKEY_public_check() does. However some algorithm
  28. implementations may offer a quicker form of validation that omits some checks in
  29. order to perform a lightweight sanity check of the key. If a quicker form is not
  30. provided then this function call does the same thing as EVP_PKEY_public_check().
  31. EVP_PKEY_private_check() validates the private component of the key given by B<ctx>.
  32. EVP_PKEY_pairwise_check() validates that the public and private components have
  33. the correct mathematical relationship to each other for the key given by B<ctx>.
  34. EVP_PKEY_check() is an alias for the EVP_PKEY_pairwise_check() function.
  35. =head1 NOTES
  36. Key validation used by the OpenSSL FIPS provider complies with the rules
  37. within SP800-56A and SP800-56B. For backwards compatibility reasons the OpenSSL
  38. default provider may use checks that are not as restrictive for certain key types.
  39. For further information see L<EVP_PKEY-DSA(7)/DSA key validation>,
  40. L<EVP_PKEY-DH(7)/DH key validation>, L<EVP_PKEY-EC(7)/EC key validation> and
  41. L<EVP_PKEY-RSA(7)/RSA key validation>.
  42. Refer to SP800-56A and SP800-56B for rules relating to when these functions
  43. should be called during key establishment.
  44. It is not necessary to call these functions after locally calling an approved key
  45. generation method, but may be required for assurance purposes when receiving
  46. keys from a third party.
  47. =head1 RETURN VALUES
  48. All functions return 1 for success or others for failure.
  49. They return -2 if the operation is not supported for the specific algorithm.
  50. =head1 SEE ALSO
  51. L<EVP_PKEY_CTX_new(3)>,
  52. L<EVP_PKEY_fromdata(3)>,
  53. L<EVP_PKEY-DH(7)>,
  54. L<EVP_PKEY-FFC(7)>,
  55. L<EVP_PKEY-DSA(7)>,
  56. L<EVP_PKEY-EC(7)>,
  57. L<EVP_PKEY-RSA(7)>,
  58. =head1 HISTORY
  59. EVP_PKEY_check(), EVP_PKEY_public_check() and EVP_PKEY_param_check() were added
  60. in OpenSSL 1.1.1.
  61. EVP_PKEY_param_check_quick(), EVP_PKEY_public_check_quick(),
  62. EVP_PKEY_private_check() and EVP_PKEY_pairwise_check() were added in OpenSSL 3.0.
  63. =head1 COPYRIGHT
  64. Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
  65. Licensed under the Apache License 2.0 (the "License"). You may not use
  66. this file except in compliance with the License. You can obtain a copy
  67. in the file LICENSE in the source distribution or at
  68. L<https://www.openssl.org/source/license.html>.
  69. =cut