diff options
Diffstat (limited to 'src/lib/libcrypto/man/PKCS8_pkey_set0.3')
| -rw-r--r-- | src/lib/libcrypto/man/PKCS8_pkey_set0.3 | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/src/lib/libcrypto/man/PKCS8_pkey_set0.3 b/src/lib/libcrypto/man/PKCS8_pkey_set0.3 deleted file mode 100644 index f3d5a294c3..0000000000 --- a/src/lib/libcrypto/man/PKCS8_pkey_set0.3 +++ /dev/null | |||
| @@ -1,159 +0,0 @@ | |||
| 1 | .\" $OpenBSD: PKCS8_pkey_set0.3,v 1.3 2024/09/02 07:45:09 tb Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | ||
| 17 | .Dd $Mdocdate: September 2 2024 $ | ||
| 18 | .Dt PKCS8_PKEY_SET0 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm PKCS8_pkey_set0 , | ||
| 22 | .Nm PKCS8_pkey_get0 , | ||
| 23 | .Nm PKCS8_pkey_add1_attr_by_NID , | ||
| 24 | .Nm PKCS8_pkey_get0_attrs | ||
| 25 | .Nd change and inspect PKCS#8 PrivateKeyInfo objects | ||
| 26 | .Sh SYNOPSIS | ||
| 27 | .In openssl/x509.h | ||
| 28 | .Ft int | ||
| 29 | .Fo PKCS8_pkey_set0 | ||
| 30 | .Fa "PKCS8_PRIV_KEY_INFO *keyinfo" | ||
| 31 | .Fa "ASN1_OBJECT *aobj" | ||
| 32 | .Fa "int version" | ||
| 33 | .Fa "int ptype" | ||
| 34 | .Fa "void *pval" | ||
| 35 | .Fa "unsigned char *data" | ||
| 36 | .Fa "int len" | ||
| 37 | .Fc | ||
| 38 | .Ft int | ||
| 39 | .Fo PKCS8_pkey_get0 | ||
| 40 | .Fa "const ASN1_OBJECT **paobj" | ||
| 41 | .Fa "const unsigned char **pdata" | ||
| 42 | .Fa "int *plen" | ||
| 43 | .Fa "const X509_ALGOR **palgor" | ||
| 44 | .Fa "const PKCS8_PRIV_KEY_INFO *keyinfo" | ||
| 45 | .Fc | ||
| 46 | .Ft int | ||
| 47 | .Fo PKCS8_pkey_add1_attr_by_NID | ||
| 48 | .Fa "PKCS8_PRIV_KEY_INFO *keyinfo" | ||
| 49 | .Fa "int nid" | ||
| 50 | .Fa "int type" | ||
| 51 | .Fa "const unsigned char *data" | ||
| 52 | .Fa "int len" | ||
| 53 | .Fc | ||
| 54 | .Ft const STACK_OF(X509_ATTRIBUTE) * | ||
| 55 | .Fo PKCS8_pkey_get0_attrs | ||
| 56 | .Fa "const PKCS8_PRIV_KEY_INFO *keyinfo" | ||
| 57 | .Fc | ||
| 58 | .Sh DESCRIPTION | ||
| 59 | .Fn PKCS8_pkey_set0 | ||
| 60 | initializes the | ||
| 61 | .Fa keyinfo | ||
| 62 | object. | ||
| 63 | The algorithm is set to | ||
| 64 | .Fa aobj | ||
| 65 | with the associated parameter type | ||
| 66 | .Fa ptype | ||
| 67 | and parameter value | ||
| 68 | .Fa pval | ||
| 69 | using | ||
| 70 | .Xr X509_ALGOR_set0 3 , | ||
| 71 | replacing any previous information about the algorithm. | ||
| 72 | Unless | ||
| 73 | .Fa data | ||
| 74 | is | ||
| 75 | .Dv NULL , | ||
| 76 | the encoded private key is set to the | ||
| 77 | .Fa len | ||
| 78 | bytes starting at | ||
| 79 | .Fa data | ||
| 80 | using | ||
| 81 | .Xr ASN1_STRING_set0 3 , | ||
| 82 | not performing any validation. | ||
| 83 | If | ||
| 84 | .Fa data | ||
| 85 | is | ||
| 86 | .Dv NULL , | ||
| 87 | the key data remains unchanged. | ||
| 88 | If the | ||
| 89 | .Fa version | ||
| 90 | argument is greater than or equal to 0, it replaces any existing version; | ||
| 91 | otherwise, the version remains unchanged. | ||
| 92 | If | ||
| 93 | .Fa keyinfo | ||
| 94 | contains any attributes, they remain unchanged. | ||
| 95 | .Pp | ||
| 96 | .Fn PKCS8_pkey_get0 | ||
| 97 | retrieves some information from the | ||
| 98 | .Fa keyinfo | ||
| 99 | object. | ||
| 100 | Internal pointers to the algorithm OID, the | ||
| 101 | .Vt AlgorithmIdentifier , | ||
| 102 | and the encoded private key are stored in | ||
| 103 | .Pf * Fa paobj , | ||
| 104 | .Pf * Fa palgor , | ||
| 105 | and | ||
| 106 | .Pf * Fa pdata , | ||
| 107 | respectively. | ||
| 108 | .Dv NULL | ||
| 109 | pointers can be passed for any of these three arguments if the respective | ||
| 110 | information is not needed. | ||
| 111 | Unless | ||
| 112 | .Fa pdata | ||
| 113 | is | ||
| 114 | .Dv NULL , | ||
| 115 | .Pf * Fa plen | ||
| 116 | is set to the number of bytes in | ||
| 117 | .Pf * Fa pdata . | ||
| 118 | .Pp | ||
| 119 | .Fn PKCS8_pkey_add1_attr_by_NID | ||
| 120 | creates a new X.501 Attribute object using | ||
| 121 | .Xr X509_ATTRIBUTE_create_by_NID 3 | ||
| 122 | and appends it to the attributes of | ||
| 123 | .Fa keyinfo . | ||
| 124 | .Sh RETURN VALUES | ||
| 125 | .Fn PKCS8_pkey_set0 | ||
| 126 | and | ||
| 127 | .Fn PKCS8_pkey_add1_attr_by_NID | ||
| 128 | return 1 for success or 0 for failure. | ||
| 129 | .Pp | ||
| 130 | .Fn PKCS8_pkey_get0 | ||
| 131 | always returns 1. | ||
| 132 | .Pp | ||
| 133 | .Fn PKCS8_pkey_get0_attrs | ||
| 134 | returns an internal pointer to the array of attributes associated with | ||
| 135 | .Fa keyinfo | ||
| 136 | or | ||
| 137 | .Dv NULL | ||
| 138 | if no attributes are set. | ||
| 139 | .Sh SEE ALSO | ||
| 140 | .Xr ASN1_STRING_set0 3 , | ||
| 141 | .Xr EVP_PKCS82PKEY 3 , | ||
| 142 | .Xr OBJ_nid2obj 3 , | ||
| 143 | .Xr PKCS8_PRIV_KEY_INFO_new 3 , | ||
| 144 | .Xr STACK_OF 3 , | ||
| 145 | .Xr X509_ALGOR_new 3 , | ||
| 146 | .Xr X509_ATTRIBUTE_create_by_NID 3 , | ||
| 147 | .Xr X509_ATTRIBUTE_new 3 | ||
| 148 | .Sh HISTORY | ||
| 149 | .Fn PKCS8_pkey_set0 | ||
| 150 | and | ||
| 151 | .Fn PKCS8_pkey_get0 | ||
| 152 | first appeared in OpenSSL 1.0.0 and have been available since | ||
| 153 | .Ox 4.9 . | ||
| 154 | .Pp | ||
| 155 | .Fn PKCS8_pkey_add1_attr_by_NID | ||
| 156 | and | ||
| 157 | .Fn PKCS8_pkey_get0_attrs | ||
| 158 | first appeared in OpenSSL 1.1.0 and have been available since | ||
| 159 | .Ox 6.4 . | ||
