Debian Codegraph @

upstream/debian-unstable/man3/EVP_PKEY_copy_parameters.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_COPY_PARAMETERS 3SSL"
58 .TH EVP_PKEY_COPY_PARAMETERS 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_missing_parameters, EVP_PKEY_copy_parameters, EVP_PKEY_parameters_eq,
65 EVP_PKEY_cmp_parameters, EVP_PKEY_eq,
66 EVP_PKEY_cmp \- public key parameter and comparison functions
67 .SH SYNOPSIS
68 .IX Header "SYNOPSIS"
69 .Vb 1
70 \& #include <openssl/evp.h>
71 \&
72 \& int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
73 \& int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
74 \&
75 \& int EVP_PKEY_parameters_eq(const EVP_PKEY *a, const EVP_PKEY *b);
76 \& int EVP_PKEY_eq(const EVP_PKEY *a, const EVP_PKEY *b);
77 .Ve
78 .PP
79 The following functions have been deprecated since OpenSSL 3.0, and can be
80 hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value,
81 see \fBopenssl_user_macros\fR\|(7):
82 .PP
83 .Vb 2
84 \& int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
85 \& int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
86 .Ve
87 .SH DESCRIPTION
88 .IX Header "DESCRIPTION"
89 The function \fBEVP_PKEY_missing_parameters()\fR returns 1 if the public key
90 parameters of \fBpkey\fR are missing and 0 if they are present or the algorithm
91 doesn't use parameters.
92 .PP
93 The function \fBEVP_PKEY_copy_parameters()\fR copies the parameters from key
94 \&\fBfrom\fR to key \fBto\fR. An error is returned if the parameters are missing in
95 \&\fBfrom\fR or present in both \fBfrom\fR and \fBto\fR and mismatch. If the parameters
96 in \fBfrom\fR and \fBto\fR are both present and match this function has no effect.
97 .PP
98 The function \fBEVP_PKEY_parameters_eq()\fR checks the parameters of keys
99 \&\fBa\fR and \fBb\fR for equality.
100 .PP
101 The function \fBEVP_PKEY_eq()\fR checks the keys \fBa\fR and \fBb\fR for equality,
102 including their parameters if they are available.
103 .SH NOTES
104 .IX Header "NOTES"
105 The main purpose of the functions \fBEVP_PKEY_missing_parameters()\fR and
106 \&\fBEVP_PKEY_copy_parameters()\fR is to handle public keys in certificates where the
107 parameters are sometimes omitted from a public key if they are inherited from
108 the CA that signed it.
109 .PP
110 The deprecated functions \fBEVP_PKEY_cmp()\fR and \fBEVP_PKEY_cmp_parameters()\fR differ in
111 their return values compared to other \fB_cmp()\fR functions. They are aliases for
112 \&\fBEVP_PKEY_eq()\fR and \fBEVP_PKEY_parameters_eq()\fR.
113 .PP
114 The function \fBEVP_PKEY_cmp()\fR previously only checked the key parameters
115 (if there are any) and the public key, assuming that there always was
116 a public key and that private key equality could be derived from that.
117 Because it's no longer assumed that the private key in an \fBEVP_PKEY\fR\|(3) is
118 always accompanied by a public key, the comparison can not rely on public
119 key comparison alone.
120 .PP
121 Instead, \fBEVP_PKEY_eq()\fR (and therefore also \fBEVP_PKEY_cmp()\fR) now compares:
122 .IP 1. 4
123 the key parameters (if there are any)
124 .IP 2. 4
125 the public keys or the private keys of the two \fBEVP_PKEY\fRs, depending on
126 what they both contain.
127 .SH "RETURN VALUES"
128 .IX Header "RETURN VALUES"
129 The function \fBEVP_PKEY_missing_parameters()\fR returns 1 if the public key
130 parameters of \fBpkey\fR are missing and 0 if they are present or the algorithm
131 doesn't use parameters.
132 .PP
133 These functions \fBEVP_PKEY_copy_parameters()\fR returns 1 for success and 0 for
134 failure.
135 .PP
136 The functions \fBEVP_PKEY_cmp_parameters()\fR, \fBEVP_PKEY_parameters_eq()\fR,
137 \&\fBEVP_PKEY_cmp()\fR and \fBEVP_PKEY_eq()\fR return 1 if their
138 inputs match, 0 if they don't match, \-1 if the key types are different and
139 \&\-2 if the operation is not supported.
140 .SH "SEE ALSO"
141 .IX Header "SEE ALSO"
142 \&\fBEVP_PKEY_CTX_new\fR\|(3),
143 \&\fBEVP_PKEY_keygen\fR\|(3)
144 .SH HISTORY
145 .IX Header "HISTORY"
146 The \fBEVP_PKEY_cmp()\fR and \fBEVP_PKEY_cmp_parameters()\fR functions were deprecated in
147 OpenSSL 3.0.
148 .PP
149 The \fBEVP_PKEY_eq()\fR and \fBEVP_PKEY_parameters_eq()\fR were added in OpenSSL 3.0 to
150 replace \fBEVP_PKEY_cmp()\fR and \fBEVP_PKEY_cmp_parameters()\fR.
151 .SH COPYRIGHT
152 .IX Header "COPYRIGHT"
153 Copyright 2006\-2021 The OpenSSL Project Authors. All Rights Reserved.
154 .PP
155 Licensed under the Apache License 2.0 (the "License"). You may not use
156 this file except in compliance with the License. You can obtain a copy
157 in the file LICENSE in the source distribution or at
158 <https://www.openssl.org/source/license.html>.