summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
diff options
context:
space:
mode:
authorschwarze <>2020-06-24 19:55:55 +0000
committerschwarze <>2020-06-24 19:55:55 +0000
commita82b35baacf21615569fe12a1f8b2ea24d7b7b89 (patch)
tree18528ad5c6f0effef90a88941bb48bdb83932984 /src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
parent9692df90019980e79c0c553229fcde4d9f44e355 (diff)
downloadopenbsd-a82b35baacf21615569fe12a1f8b2ea24d7b7b89.tar.gz
openbsd-a82b35baacf21615569fe12a1f8b2ea24d7b7b89.tar.bz2
openbsd-a82b35baacf21615569fe12a1f8b2ea24d7b7b89.zip
Properly document the return values of EVP_PKEY_base_id(3)
and EVP_PKEY_id(3), then describe the "type" parameters of various functions more precisely referencing that information. In particular, document X509_get_signature_type(3) which was so far missing. OK tb@
Diffstat (limited to 'src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3')
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3102
1 files changed, 64 insertions, 38 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 b/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
index 9851538c41..99faf8dabb 100644
--- a/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
+++ b/src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
@@ -1,10 +1,10 @@
1.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.16 2019/09/01 09:10:09 schwarze Exp $ 1.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.17 2020/06/24 19:55:54 schwarze Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license: 5.\" The changes are covered by the following Copyright and license:
6.\" 6.\"
7.\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org> 7.\" Copyright (c) 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
8.\" 8.\"
9.\" Permission to use, copy, modify, and distribute this software for any 9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above 10.\" purpose with or without fee is hereby granted, provided that the above
@@ -65,7 +65,7 @@
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE. 66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\" 67.\"
68.Dd $Mdocdate: September 1 2019 $ 68.Dd $Mdocdate: June 24 2020 $
69.Dt EVP_PKEY_SET1_RSA 3 69.Dt EVP_PKEY_SET1_RSA 3
70.Os 70.Os
71.Sh NAME 71.Sh NAME
@@ -89,10 +89,10 @@
89.Nm EVP_PKEY_assign_EC_KEY , 89.Nm EVP_PKEY_assign_EC_KEY ,
90.Nm EVP_PKEY_assign_GOST , 90.Nm EVP_PKEY_assign_GOST ,
91.Nm EVP_PKEY_assign , 91.Nm EVP_PKEY_assign ,
92.Nm EVP_PKEY_set_type ,
93.Nm EVP_PKEY_base_id , 92.Nm EVP_PKEY_base_id ,
94.Nm EVP_PKEY_id , 93.Nm EVP_PKEY_id ,
95.Nm EVP_PKEY_type 94.Nm EVP_PKEY_type ,
95.Nm EVP_PKEY_set_type
96.Nd EVP_PKEY assignment functions 96.Nd EVP_PKEY assignment functions
97.Sh SYNOPSIS 97.Sh SYNOPSIS
98.In openssl/evp.h 98.In openssl/evp.h
@@ -189,11 +189,6 @@
189.Fa "void *key" 189.Fa "void *key"
190.Fc 190.Fc
191.Ft int 191.Ft int
192.Fo EVP_PKEY_set_type
193.Fa "EVP_PKEY *pkey"
194.Fa "int type"
195.Fc
196.Ft int
197.Fo EVP_PKEY_base_id 192.Fo EVP_PKEY_base_id
198.Fa "EVP_PKEY *pkey" 193.Fa "EVP_PKEY *pkey"
199.Fc 194.Fc
@@ -205,6 +200,11 @@
205.Fo EVP_PKEY_type 200.Fo EVP_PKEY_type
206.Fa "int type" 201.Fa "int type"
207.Fc 202.Fc
203.Ft int
204.Fo EVP_PKEY_set_type
205.Fa "EVP_PKEY *pkey"
206.Fa "int type"
207.Fc
208.Sh DESCRIPTION 208.Sh DESCRIPTION
209.Fn EVP_PKEY_set1_RSA , 209.Fn EVP_PKEY_set1_RSA ,
210.Fn EVP_PKEY_set1_DSA , 210.Fn EVP_PKEY_set1_DSA ,
@@ -286,38 +286,51 @@ The following types are supported:
286and 286and
287.Dv EVP_PKEY_GOSTR01 . 287.Dv EVP_PKEY_GOSTR01 .
288.Pp 288.Pp
289.Fn EVP_PKEY_set_type
290frees the key referenced in
291.Fa pkey ,
292if any, and sets the key type of
293.Fa pkey
294to
295.Fa type
296without referencing a new key from
297.Fa pkey
298yet.
299.Pp
300.Fn EVP_PKEY_base_id 289.Fn EVP_PKEY_base_id
301returns the type of 290returns the type of
302.Fa pkey . 291.Fa pkey
303For example, an RSA key will return 292according to the following table:
304.Dv EVP_PKEY_RSA . 293.Pp
294.Bl -column -compact -offset 2n EVP_PKEY_GOSTR NID_X9_62_id_ecPublicKey
295.It Sy return value Ta Ta Sy PEM type string
296.It Dv EVP_PKEY_CMAC Ta = Dv NID_cmac Ta CMAC
297.It Dv EVP_PKEY_DH Ta = Dv NID_dhKeyAgreement Ta DH
298.It Dv EVP_PKEY_DSA Ta = Dv NID_dsa Ta DSA
299.It Dv EVP_PKEY_EC Ta = Dv NID_X9_62_id_ecPublicKey Ta EC
300.It Dv EVP_PKEY_GOSTIMIT Ta = Dv NID_id_Gost28147_89_MAC Ta GOST-MAC
301.It Dv EVP_PKEY_GOSTR01 Ta = Dv NID_id_GostR3410_2001 Ta GOST2001
302.It Dv EVP_PKEY_HMAC Ta = Dv NID_hmac Ta HMAC
303.It Dv EVP_PKEY_RSA Ta = Dv NID_rsaEncryption Ta RSA
304.It Dv EVP_PKEY_RSA_PSS Ta = Dv NID_rsassaPss Ta RSA-PSS
305.El
306.Pp
307Application programs can support additional key types by calling
308.Xr EVP_PKEY_asn1_add0 3 .
305.Pp 309.Pp
306.Fn EVP_PKEY_id 310.Fn EVP_PKEY_id
307returns the actual OID associated with 311returns the actual OID associated with
308.Fa pkey . 312.Fa pkey .
309Historically keys using the same algorithm could use different OIDs. 313Historically keys using the same algorithm could use different OIDs.
310For example, an RSA key could use the OIDs corresponding to the NIDs 314The following deprecated aliases are still supported:
311.Dv NID_rsaEncryption 315.Pp
312(equivalent to 316.Bl -column -compact -offset 2n EVP_PKEY_GOSTR12_ NID_id_tc26_gost3410_2012_512
313.Dv EVP_PKEY_RSA ) 317.It Sy return value Ta Ta Sy alias for
314or 318.It Dv EVP_PKEY_DSA1 Ta = Dv NID_dsa_2 Ta DSA
315.Dv NID_rsa 319.It Dv EVP_PKEY_DSA2 Ta = Dv NID_dsaWithSHA Ta DSA
316(equivalent to 320.It Dv EVP_PKEY_DSA3 Ta = Dv NID_dsaWithSHA1 Ta DSA
317.Dv EVP_PKEY_RSA2 ) . 321.It Dv EVP_PKEY_DSA4 Ta = Dv NID_dsaWithSHA1_2 Ta DSA
318The use of alternative non-standard OIDs is now rare, so 322.It Dv EVP_PKEY_GOSTR12_256 Ta = Dv NID_id_tc26_gost3410_2012_256 Ta GOST2001
319.Dv EVP_PKEY_RSA2 323.It Dv EVP_PKEY_GOSTR12_512 Ta = Dv NID_id_tc26_gost3410_2012_512 Ta GOST2001
320et al. are not often seen in practice. 324.It Dv EVP_PKEY_RSA2 Ta = Dv NID_rsa Ta RSA
325.El
326.Pp
327Application programs can support additional alternative OIDs by calling
328.Xr EVP_PKEY_asn1_add_alias 3 .
329.Pp
330Most applications wishing to know a key type will simply call
331.Fn EVP_PKEY_base_id
332and will not care about the actual type,
333which will be identical in almost all cases.
321.Pp 334.Pp
322.Fn EVP_PKEY_type 335.Fn EVP_PKEY_type
323returns the underlying type of the NID 336returns the underlying type of the NID
@@ -327,10 +340,23 @@ For example,
327will return 340will return
328.Dv EVP_PKEY_RSA . 341.Dv EVP_PKEY_RSA .
329.Pp 342.Pp
330Most applications wishing to know a key type will simply call 343.Fn EVP_PKEY_set_type
344frees the key referenced in
345.Fa pkey ,
346if any, and sets the key type of
347.Fa pkey
348to
349.Fa type
350without referencing a new key from
351.Fa pkey
352yet.
353For
354.Fa type ,
355any of the possible return values of
331.Fn EVP_PKEY_base_id 356.Fn EVP_PKEY_base_id
332and will not care about the actual type, 357and
333which will be identical in almost all cases. 358.Fn EVP_PKEY_id
359can be passed.
334.Pp 360.Pp
335In accordance with the OpenSSL naming convention, the key obtained from 361In accordance with the OpenSSL naming convention, the key obtained from
336or assigned to 362or assigned to