2
0

EVP_PKEY_check.pod 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. The EVP_PKEY_pairwise_check() and EVP_PKEY_private_check() might not be bounded
  48. by any key size limits as private keys are not expected to be supplied by
  49. attackers. For that reason they might take an unbounded time if run on
  50. arbitrarily large keys.
  51. =head1 RETURN VALUES
  52. All functions return 1 for success or others for failure.
  53. They return -2 if the operation is not supported for the specific algorithm.
  54. =head1 SEE ALSO
  55. L<EVP_PKEY_CTX_new(3)>,
  56. L<EVP_PKEY_fromdata(3)>,
  57. L<EVP_PKEY-DH(7)>,
  58. L<EVP_PKEY-FFC(7)>,
  59. L<EVP_PKEY-DSA(7)>,
  60. L<EVP_PKEY-EC(7)>,
  61. L<EVP_PKEY-RSA(7)>,
  62. =head1 HISTORY
  63. EVP_PKEY_check(), EVP_PKEY_public_check() and EVP_PKEY_param_check() were added
  64. in OpenSSL 1.1.1.
  65. EVP_PKEY_param_check_quick(), EVP_PKEY_public_check_quick(),
  66. EVP_PKEY_private_check() and EVP_PKEY_pairwise_check() were added in OpenSSL 3.0.
  67. =head1 COPYRIGHT
  68. Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
  69. Licensed under the Apache License 2.0 (the "License"). You may not use
  70. this file except in compliance with the License. You can obtain a copy
  71. in the file LICENSE in the source distribution or at
  72. L<https://www.openssl.org/source/license.html>.
  73. =cut