diff options
| author | schwarze <> | 2020-06-24 19:55:55 +0000 |
|---|---|---|
| committer | schwarze <> | 2020-06-24 19:55:55 +0000 |
| commit | a82b35baacf21615569fe12a1f8b2ea24d7b7b89 (patch) | |
| tree | 18528ad5c6f0effef90a88941bb48bdb83932984 /src/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 | |
| parent | 9692df90019980e79c0c553229fcde4d9f44e355 (diff) | |
| download | openbsd-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.3 | 102 |
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: | |||
| 286 | and | 286 | and |
| 287 | .Dv EVP_PKEY_GOSTR01 . | 287 | .Dv EVP_PKEY_GOSTR01 . |
| 288 | .Pp | 288 | .Pp |
| 289 | .Fn EVP_PKEY_set_type | ||
| 290 | frees the key referenced in | ||
| 291 | .Fa pkey , | ||
| 292 | if any, and sets the key type of | ||
| 293 | .Fa pkey | ||
| 294 | to | ||
| 295 | .Fa type | ||
| 296 | without referencing a new key from | ||
| 297 | .Fa pkey | ||
| 298 | yet. | ||
| 299 | .Pp | ||
| 300 | .Fn EVP_PKEY_base_id | 289 | .Fn EVP_PKEY_base_id |
| 301 | returns the type of | 290 | returns the type of |
| 302 | .Fa pkey . | 291 | .Fa pkey |
| 303 | For example, an RSA key will return | 292 | according 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 | ||
| 307 | Application 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 |
| 307 | returns the actual OID associated with | 311 | returns the actual OID associated with |
| 308 | .Fa pkey . | 312 | .Fa pkey . |
| 309 | Historically keys using the same algorithm could use different OIDs. | 313 | Historically keys using the same algorithm could use different OIDs. |
| 310 | For example, an RSA key could use the OIDs corresponding to the NIDs | 314 | The 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 |
| 314 | or | 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 |
| 318 | The 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 |
| 320 | et al. are not often seen in practice. | 324 | .It Dv EVP_PKEY_RSA2 Ta = Dv NID_rsa Ta RSA |
| 325 | .El | ||
| 326 | .Pp | ||
| 327 | Application programs can support additional alternative OIDs by calling | ||
| 328 | .Xr EVP_PKEY_asn1_add_alias 3 . | ||
| 329 | .Pp | ||
| 330 | Most applications wishing to know a key type will simply call | ||
| 331 | .Fn EVP_PKEY_base_id | ||
| 332 | and will not care about the actual type, | ||
| 333 | which will be identical in almost all cases. | ||
| 321 | .Pp | 334 | .Pp |
| 322 | .Fn EVP_PKEY_type | 335 | .Fn EVP_PKEY_type |
| 323 | returns the underlying type of the NID | 336 | returns the underlying type of the NID |
| @@ -327,10 +340,23 @@ For example, | |||
| 327 | will return | 340 | will return |
| 328 | .Dv EVP_PKEY_RSA . | 341 | .Dv EVP_PKEY_RSA . |
| 329 | .Pp | 342 | .Pp |
| 330 | Most applications wishing to know a key type will simply call | 343 | .Fn EVP_PKEY_set_type |
| 344 | frees the key referenced in | ||
| 345 | .Fa pkey , | ||
| 346 | if any, and sets the key type of | ||
| 347 | .Fa pkey | ||
| 348 | to | ||
| 349 | .Fa type | ||
| 350 | without referencing a new key from | ||
| 351 | .Fa pkey | ||
| 352 | yet. | ||
| 353 | For | ||
| 354 | .Fa type , | ||
| 355 | any of the possible return values of | ||
| 331 | .Fn EVP_PKEY_base_id | 356 | .Fn EVP_PKEY_base_id |
| 332 | and will not care about the actual type, | 357 | and |
| 333 | which will be identical in almost all cases. | 358 | .Fn EVP_PKEY_id |
| 359 | can be passed. | ||
| 334 | .Pp | 360 | .Pp |
| 335 | In accordance with the OpenSSL naming convention, the key obtained from | 361 | In accordance with the OpenSSL naming convention, the key obtained from |
| 336 | or assigned to | 362 | or assigned to |
