1 .\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.5 2016/12/11 12:21:48 schwarze Exp $
2 .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
4 .\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5 .\" Copyright (c) 2002, 2014, 2016 The OpenSSL Project. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in
16 .\" the documentation and/or other materials provided with the
19 .\" 3. All advertising materials mentioning features or use of this
20 .\" software must display the following acknowledgment:
21 .\" "This product includes software developed by the OpenSSL Project
22 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\" endorse or promote products derived from this software without
26 .\" prior written permission. For written permission, please contact
27 .\" openssl-core@openssl.org.
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\" nor may "OpenSSL" appear in their names without prior written
31 .\" permission of the OpenSSL Project.
33 .\" 6. Redistributions of any form whatsoever must retain the following
35 .\" "This product includes software developed by the OpenSSL Project
36 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
51 .Dd $Mdocdate: December 11 2016 $
52 .Dt EVP_PKEY_SET1_RSA 3
55 .Nm EVP_PKEY_set1_RSA ,
56 .Nm EVP_PKEY_set1_DSA ,
57 .Nm EVP_PKEY_set1_DH ,
58 .Nm EVP_PKEY_set1_EC_KEY ,
59 .Nm EVP_PKEY_get1_RSA ,
60 .Nm EVP_PKEY_get1_DSA ,
61 .Nm EVP_PKEY_get1_DH ,
62 .Nm EVP_PKEY_get1_EC_KEY ,
63 .Nm EVP_PKEY_assign_RSA ,
64 .Nm EVP_PKEY_assign_DSA ,
65 .Nm EVP_PKEY_assign_DH ,
66 .Nm EVP_PKEY_assign_EC_KEY ,
68 .Nm EVP_PKEY_base_id ,
70 .Nd EVP_PKEY assignment functions
89 .Fo EVP_PKEY_set1_EC_KEY
106 .Fo EVP_PKEY_get1_EC_KEY
110 .Fo EVP_PKEY_assign_RSA
115 .Fo EVP_PKEY_assign_DSA
120 .Fo EVP_PKEY_assign_DH
125 .Fo EVP_PKEY_assign_EC_KEY
142 .Fn EVP_PKEY_set1_RSA ,
143 .Fn EVP_PKEY_set1_DSA ,
144 .Fn EVP_PKEY_set1_DH ,
146 .Fn EVP_PKEY_set1_EC_KEY
147 set the key referenced by
152 .Fn EVP_PKEY_get1_RSA ,
153 .Fn EVP_PKEY_get1_DSA ,
154 .Fn EVP_PKEY_get1_DH ,
156 .Fn EVP_PKEY_get1_EC_KEY
157 return the key referenced in
161 if the key is not of the correct type.
163 .Fn EVP_PKEY_assign_RSA ,
164 .Fn EVP_PKEY_assign_DSA ,
165 .Fn EVP_PKEY_assign_DH ,
167 .Fn EVP_PKEY_assign_EC_KEY
168 also set the referenced key to
170 however these use the supplied
174 will be freed when the parent
181 For example, an RSA key will return
185 returns the actual OID associated with
187 Historically keys using the same algorithm could use different OIDs.
188 For example, an RSA key could use the OIDs corresponding to the NIDs
189 .Dv NID_rsaEncryption
195 .Dv EVP_PKEY_RSA2 ) .
196 The use of alternative non-standard OIDs is now rare, so
198 et al. are not often seen in practice.
201 returns the underlying type of the NID
204 .Fn EVP_PKEY_type EVP_PKEY_RSA2
208 Most applications wishing to know a key type will simply call
210 and will not care about the actual type,
211 which will be identical in almost all cases.
213 In accordance with the OpenSSL naming convention, the key obtained from
218 functions must be freed as well as
221 .Fn EVP_PKEY_assign_RSA ,
222 .Fn EVP_PKEY_assign_DSA ,
223 .Fn EVP_PKEY_assign_DH ,
225 .Fn EVP_PKEY_assign_EC_KEY
226 are implemented as macros.
228 .Fn EVP_PKEY_set1_RSA ,
229 .Fn EVP_PKEY_set1_DSA ,
230 .Fn EVP_PKEY_set1_DH ,
232 .Fn EVP_PKEY_set1_EC_KEY
233 return 1 for success or 0 for failure.
235 .Fn EVP_PKEY_get1_RSA ,
236 .Fn EVP_PKEY_get1_DSA ,
237 .Fn EVP_PKEY_get1_DH ,
239 .Fn EVP_PKEY_get1_EC_KEY
240 return the referenced key or
242 if an error occurred.
244 .Fn EVP_PKEY_assign_RSA ,
245 .Fn EVP_PKEY_assign_DSA ,
246 .Fn EVP_PKEY_assign_DH ,
248 .Fn EVP_PKEY_assign_EC_KEY
249 return 1 for success and 0 for failure.
251 .Fn EVP_PKEY_base_id ,