summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man
diff options
context:
space:
mode:
authorschwarze <>2016-11-27 15:25:23 +0000
committerschwarze <>2016-11-27 15:25:23 +0000
commitbb65b66fccd385fb01e25e0e615e9ca618723a9d (patch)
tree85b8d5e8a09c79a639065a7852b97d620a36eb74 /src/lib/libcrypto/man
parentd4a334368fcaf79f821bf9fd741bf33b99c0f5b6 (diff)
downloadopenbsd-bb65b66fccd385fb01e25e0e615e9ca618723a9d.tar.gz
openbsd-bb65b66fccd385fb01e25e0e615e9ca618723a9d.tar.bz2
openbsd-bb65b66fccd385fb01e25e0e615e9ca618723a9d.zip
Add Copyright and license.
Merge documentation of EVP_PKEY_id(3) and EVP_PKEY_base_id(3) from OpenSSL.
Diffstat (limited to 'src/lib/libcrypto/man')
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3116
1 files changed, 102 insertions, 14 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 b/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
index 4caadfb2a4..54eb0a55b8 100644
--- a/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
+++ b/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
@@ -1,6 +1,54 @@
1.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.3 2016/11/27 15:25:23 schwarze Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
2.\" 3.\"
3.Dd $Mdocdate: November 6 2016 $ 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2002, 2014, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
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
17.\" distribution.
18.\"
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/)"
23.\"
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.
28.\"
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.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
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.
50.\"
51.Dd $Mdocdate: November 27 2016 $
4.Dt EVP_PKEY_SET1_RSA 3 52.Dt EVP_PKEY_SET1_RSA 3
5.Os 53.Os
6.Sh NAME 54.Sh NAME
@@ -16,6 +64,8 @@
16.Nm EVP_PKEY_assign_DSA , 64.Nm EVP_PKEY_assign_DSA ,
17.Nm EVP_PKEY_assign_DH , 65.Nm EVP_PKEY_assign_DH ,
18.Nm EVP_PKEY_assign_EC_KEY , 66.Nm EVP_PKEY_assign_EC_KEY ,
67.Nm EVP_PKEY_id ,
68.Nm EVP_PKEY_base_id ,
19.Nm EVP_PKEY_type 69.Nm EVP_PKEY_type
20.Nd EVP_PKEY assignment functions 70.Nd EVP_PKEY assignment functions
21.Sh SYNOPSIS 71.Sh SYNOPSIS
@@ -77,6 +127,14 @@
77.Fa "EC_KEY *key" 127.Fa "EC_KEY *key"
78.Fc 128.Fc
79.Ft int 129.Ft int
130.Fo EVP_PKEY_id
131.Fa "EVP_PKEY *pkey"
132.Fc
133.Ft int
134.Fo EVP_PKEY_base_id
135.Fa "EVP_PKEY *pkey"
136.Fc
137.Ft int
80.Fo EVP_PKEY_type 138.Fo EVP_PKEY_type
81.Fa "int type" 139.Fa "int type"
82.Fc 140.Fc
@@ -117,20 +175,40 @@ will be freed when the parent
117.Fa pkey 175.Fa pkey
118is freed. 176is freed.
119.Pp 177.Pp
178.Fn EVP_PKEY_base_id
179returns the type of
180.Fa pkey .
181For example, an RSA key will return
182.Dv EVP_PKEY_RSA .
183.Pp
184.Fn EVP_PKEY_id
185returns the actual OID associated with
186.Fa pkey .
187Historically keys using the same algorithm could use different OIDs.
188For example, an RSA key could use the OIDs corresponding to the NIDs
189.Dv NID_rsaEncryption
190(equivalent to
191.Dv EVP_PKEY_RSA )
192or
193.Dv NID_rsa
194(equivalent to
195.Dv EVP_PKEY_RSA2 ) .
196The use of alternative non-standard OIDs is now rare, so
197.Dv EVP_PKEY_RSA2
198et al. are not often seen in practice.
199.Pp
120.Fn EVP_PKEY_type 200.Fn EVP_PKEY_type
121returns the type of key corresponding to the value 201returns the underlying type of the NID
122.Fa type . 202.Fa type .
123The type of a key can be obtained with 203For example,
124.Fn EVP_PKEY_type pkey->type . 204.Fn EVP_PKEY_type EVP_PKEY_RSA2
125The return value will be 205will return
126.Dv EVP_PKEY_RSA , 206.Dv EVP_PKEY_RSA .
127.Dv EVP_PKEY_DSA , 207.Pp
128.Dv EVP_PKEY_DH , 208Most applications wishing to know a key type will simply call
129or 209.Fn EVP_PKEY_base_id
130.Dv EVP_PKEY_EC 210and will not care about the actual type:
131for the corresponding key types or 211which will be identical in almost all cases.
132.Dv NID_undef
133if the key type is unassigned.
134.Pp 212.Pp
135In accordance with the OpenSSL naming convention, the key obtained from 213In accordance with the OpenSSL naming convention, the key obtained from
136or assigned to 214or assigned to
@@ -169,5 +247,15 @@ if an error occurred.
169and 247and
170.Fn EVP_PKEY_assign_EC_KEY 248.Fn EVP_PKEY_assign_EC_KEY
171return 1 for success and 0 for failure. 249return 1 for success and 0 for failure.
250.Pp
251.Fn EVP_PKEY_base_id ,
252.Fn EVP_PKEY_id ,
253and
254.Fn EVP_PKEY_type
255return a key type or
256.Dv NID_undef
257(equivalently
258.Dv EVP_PKEY_NONE )
259on error.
172.Sh SEE ALSO 260.Sh SEE ALSO
173.Xr EVP_PKEY_new 3 261.Xr EVP_PKEY_new 3