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