Debian Codegraph @

upstream/debian-unstable/man3/EVP_PKEY_check.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "EVP_PKEY_CHECK 3SSL"
58 .TH EVP_PKEY_CHECK 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 EVP_PKEY_check, EVP_PKEY_param_check, EVP_PKEY_param_check_quick,
65 EVP_PKEY_public_check, EVP_PKEY_public_check_quick, EVP_PKEY_private_check,
66 EVP_PKEY_pairwise_check
67 \&\- key and parameter validation functions
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& #include <openssl/evp.h>
72 \&
73 \& int EVP_PKEY_check(EVP_PKEY_CTX *ctx);
74 \& int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx);
75 \& int EVP_PKEY_param_check_quick(EVP_PKEY_CTX *ctx);
76 \& int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx);
77 \& int EVP_PKEY_public_check_quick(EVP_PKEY_CTX *ctx);
78 \& int EVP_PKEY_private_check(EVP_PKEY_CTX *ctx);
79 \& int EVP_PKEY_pairwise_check(EVP_PKEY_CTX *ctx);
80 .Ve
81 .SH DESCRIPTION
82 .IX Header "DESCRIPTION"
83 \&\fBEVP_PKEY_param_check()\fR validates the parameters component of the key
84 given by \fBctx\fR. This check will always succeed for key types that do not have
85 parameters.
86 .PP
87 \&\fBEVP_PKEY_param_check_quick()\fR validates the parameters component of the key
88 given by \fBctx\fR like \fBEVP_PKEY_param_check()\fR does. However some algorithm
89 implementations may offer a quicker form of validation that omits some checks in
90 order to perform a lightweight sanity check of the key. If a quicker form is not
91 provided then this function call does the same thing as \fBEVP_PKEY_param_check()\fR.
92 .PP
93 \&\fBEVP_PKEY_public_check()\fR validates the public component of the key given by \fBctx\fR.
94 .PP
95 \&\fBEVP_PKEY_public_check_quick()\fR validates the public component of the key
96 given by \fBctx\fR like \fBEVP_PKEY_public_check()\fR does. However some algorithm
97 implementations may offer a quicker form of validation that omits some checks in
98 order to perform a lightweight sanity check of the key. If a quicker form is not
99 provided then this function call does the same thing as \fBEVP_PKEY_public_check()\fR.
100 .PP
101 \&\fBEVP_PKEY_private_check()\fR validates the private component of the key given by \fBctx\fR.
102 .PP
103 \&\fBEVP_PKEY_pairwise_check()\fR validates that the public and private components have
104 the correct mathematical relationship to each other for the key given by \fBctx\fR.
105 .PP
106 \&\fBEVP_PKEY_check()\fR is an alias for the \fBEVP_PKEY_pairwise_check()\fR function.
107 .SH NOTES
108 .IX Header "NOTES"
109 Key validation used by the OpenSSL FIPS provider complies with the rules
110 within SP800\-56A and SP800\-56B. For backwards compatibility reasons the OpenSSL
111 default provider may use checks that are not as restrictive for certain key types.
112 For further information see "DSA key validation" in \fBEVP_PKEY\-DSA\fR\|(7),
113 "DH key validation" in \fBEVP_PKEY\-DH\fR\|(7), "EC key validation" in \fBEVP_PKEY\-EC\fR\|(7) and
114 "RSA key validation" in \fBEVP_PKEY\-RSA\fR\|(7).
115 .PP
116 Refer to SP800\-56A and SP800\-56B for rules relating to when these functions
117 should be called during key establishment.
118 It is not necessary to call these functions after locally calling an approved key
119 generation method, but may be required for assurance purposes when receiving
120 keys from a third party.
121 .PP
122 The \fBEVP_PKEY_pairwise_check()\fR and \fBEVP_PKEY_private_check()\fR might not be bounded
123 by any key size limits as private keys are not expected to be supplied by
124 attackers. For that reason they might take an unbounded time if run on
125 arbitrarily large keys.
126 .SH "RETURN VALUES"
127 .IX Header "RETURN VALUES"
128 All functions return 1 for success or others for failure.
129 They return \-2 if the operation is not supported for the specific algorithm.
130 .SH "SEE ALSO"
131 .IX Header "SEE ALSO"
132 \&\fBEVP_PKEY_CTX_new\fR\|(3),
133 \&\fBEVP_PKEY_fromdata\fR\|(3),
134 \&\fBEVP_PKEY\-DH\fR\|(7),
135 \&\fBEVP_PKEY\-FFC\fR\|(7),
136 \&\fBEVP_PKEY\-DSA\fR\|(7),
137 \&\fBEVP_PKEY\-EC\fR\|(7),
138 \&\fBEVP_PKEY\-RSA\fR\|(7),
139 .SH HISTORY
140 .IX Header "HISTORY"
141 \&\fBEVP_PKEY_check()\fR, \fBEVP_PKEY_public_check()\fR and \fBEVP_PKEY_param_check()\fR were added
142 in OpenSSL 1.1.1.
143 .PP
144 \&\fBEVP_PKEY_param_check_quick()\fR, \fBEVP_PKEY_public_check_quick()\fR,
145 \&\fBEVP_PKEY_private_check()\fR and \fBEVP_PKEY_pairwise_check()\fR were added in OpenSSL 3.0.
146 .SH COPYRIGHT
147 .IX Header "COPYRIGHT"
148 Copyright 2006\-2024 The OpenSSL Project Authors. All Rights Reserved.
149 .PP
150 Licensed under the Apache License 2.0 (the "License"). You may not use
151 this file except in compliance with the License. You can obtain a copy
152 in the file LICENSE in the source distribution or at
153 <https://www.openssl.org/source/license.html>.