diff options
author | schwarze <> | 2016-12-28 01:38:16 +0000 |
---|---|---|
committer | schwarze <> | 2016-12-28 01:38:16 +0000 |
commit | c644ecaf8f2621ab8df368198d6897fabc09db2f (patch) | |
tree | 5ba14d8df39ce3fffc21f08db5d06995d6e6c30c | |
parent | 0a4a483c2cf508757470e03668bf0dd23dde8778 (diff) | |
download | openbsd-c644ecaf8f2621ab8df368198d6897fabc09db2f.tar.gz openbsd-c644ecaf8f2621ab8df368198d6897fabc09db2f.tar.bz2 openbsd-c644ecaf8f2621ab8df368198d6897fabc09db2f.zip |
Document i2d_PKCS8PrivateKeyInfo_bio(3) and i2d_PKCS8PrivateKeyInfo_fp(3),
listed in <openssl/x509.h> and in OpenSSL doc/man3/d2i_X509.pod.
These functions are very similar to i2d_PrivateKey(3) but very
different from i2d_PKCS8PrivateKey_bio(3), that's why they go into
this manual page and not into the other one. When the naming was
decided, somebody clearly considered too briefly or too long.
-rw-r--r-- | src/lib/libcrypto/man/d2i_PrivateKey.3 | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/src/lib/libcrypto/man/d2i_PrivateKey.3 b/src/lib/libcrypto/man/d2i_PrivateKey.3 index 3c5e9f8cc8..caf7479289 100644 --- a/src/lib/libcrypto/man/d2i_PrivateKey.3 +++ b/src/lib/libcrypto/man/d2i_PrivateKey.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: d2i_PrivateKey.3,v 1.4 2016/12/25 20:01:48 schwarze Exp $ | 1 | .\" $OpenBSD: d2i_PrivateKey.3,v 1.5 2016/12/28 01:38:16 schwarze Exp $ |
2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | 2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 |
3 | .\" | 3 | .\" |
4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
@@ -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: December 25 2016 $ | 68 | .Dd $Mdocdate: December 28 2016 $ |
69 | .Dt D2I_PRIVATEKEY 3 | 69 | .Dt D2I_PRIVATEKEY 3 |
70 | .Os | 70 | .Os |
71 | .Sh NAME | 71 | .Sh NAME |
@@ -74,6 +74,8 @@ | |||
74 | .Nm i2d_PrivateKey , | 74 | .Nm i2d_PrivateKey , |
75 | .Nm d2i_PrivateKey_bio , | 75 | .Nm d2i_PrivateKey_bio , |
76 | .Nm d2i_PrivateKey_fp , | 76 | .Nm d2i_PrivateKey_fp , |
77 | .Nm i2d_PKCS8PrivateKeyInfo_bio , | ||
78 | .Nm i2d_PKCS8PrivateKeyInfo_fp , | ||
77 | .Nm d2i_PublicKey , | 79 | .Nm d2i_PublicKey , |
78 | .Nm i2d_PublicKey | 80 | .Nm i2d_PublicKey |
79 | .Nd decode and encode EVP_PKEY objects | 81 | .Nd decode and encode EVP_PKEY objects |
@@ -107,6 +109,16 @@ | |||
107 | .Fa "FILE *in_fp" | 109 | .Fa "FILE *in_fp" |
108 | .Fa "EVP_PKEY **val_out" | 110 | .Fa "EVP_PKEY **val_out" |
109 | .Fc | 111 | .Fc |
112 | .Ft int | ||
113 | .Fo i2d_PKCS8PrivateKeyInfo_bio | ||
114 | .Fa "BIO *out_bio" | ||
115 | .Fa "EVP_PKEY *val_in" | ||
116 | .Fc | ||
117 | .Ft int | ||
118 | .Fo i2d_PKCS8PrivateKeyInfo_fp | ||
119 | .Fa "FILE *out_fp" | ||
120 | .Fa "EVP_PKEY *val_in" | ||
121 | .Fc | ||
110 | .Ft EVP_PKEY * | 122 | .Ft EVP_PKEY * |
111 | .Fo d2i_PublicKey | 123 | .Fo d2i_PublicKey |
112 | .Fa "int type" | 124 | .Fa "int type" |
@@ -128,7 +140,7 @@ For details about the semantics, examples, caveats, and bugs, see | |||
128 | .Fn d2i_PrivateKey | 140 | .Fn d2i_PrivateKey |
129 | decodes a private key using algorithm | 141 | decodes a private key using algorithm |
130 | .Fa type . | 142 | .Fa type . |
131 | It attempts to use any key specific format or the PKCS#8 unencrypted | 143 | It attempts to use any algorithm specific format or the PKCS#8 unencrypted |
132 | .Vt PrivateKeyInfo | 144 | .Vt PrivateKeyInfo |
133 | format defined in RFC 5208 section 5. | 145 | format defined in RFC 5208 section 5. |
134 | The | 146 | The |
@@ -157,11 +169,28 @@ pointer. | |||
157 | .Fn i2d_PrivateKey | 169 | .Fn i2d_PrivateKey |
158 | encodes | 170 | encodes |
159 | .Fa val_in . | 171 | .Fa val_in . |
160 | It uses a key specific format or, if none is defined for that key type, | 172 | It uses an algorithm specific format or, if none is defined for |
161 | the PKCS#8 unencrypted | 173 | that key type, the PKCS#8 unencrypted |
162 | .Vt PrivateKeyInfo | 174 | .Vt PrivateKeyInfo |
163 | format. | 175 | format. |
164 | .Pp | 176 | .Pp |
177 | .Fn i2d_PKCS8PrivateKeyInfo_bio | ||
178 | and | ||
179 | .Fn i2d_PKCS8PrivateKeyInfo_fp | ||
180 | encode | ||
181 | .Fa val_in | ||
182 | in PKCS#8 unencrypted | ||
183 | .Vt PrivateKeyInfo | ||
184 | format. | ||
185 | They are similar to | ||
186 | .Fn i2d_PrivateKey | ||
187 | except that they don't use any algorithm-specific formats | ||
188 | and that they write to a | ||
189 | .Vt BIO | ||
190 | or | ||
191 | .Vt FILE | ||
192 | pointer rather than to a buffer. | ||
193 | .Pp | ||
165 | All these functions use DER format and unencrypted keys. | 194 | All these functions use DER format and unencrypted keys. |
166 | Applications wishing to encrypt or decrypt private keys should use other | 195 | Applications wishing to encrypt or decrypt private keys should use other |
167 | functions such as | 196 | functions such as |
@@ -209,7 +238,7 @@ depending on the algorithm used by | |||
209 | and | 238 | and |
210 | .Fn d2i_PublicKey | 239 | .Fn d2i_PublicKey |
211 | return a valid | 240 | return a valid |
212 | .Vt EVP_KEY | 241 | .Vt EVP_PKEY |
213 | structure or | 242 | structure or |
214 | .Dv NULL | 243 | .Dv NULL |
215 | if an error occurs. | 244 | if an error occurs. |
@@ -220,9 +249,15 @@ and | |||
220 | return the number of bytes successfully encoded or a negative value if | 249 | return the number of bytes successfully encoded or a negative value if |
221 | an error occurs. | 250 | an error occurs. |
222 | .Pp | 251 | .Pp |
252 | .Fn i2d_PKCS8PrivateKeyInfo_bio | ||
253 | and | ||
254 | .Fn i2d_PKCS8PrivateKeyInfo_fp | ||
255 | return 1 for success or 0 if an error occurs. | ||
256 | .Pp | ||
223 | For all functions, the error code can be obtained by calling | 257 | For all functions, the error code can be obtained by calling |
224 | .Xr ERR_get_error 3 . | 258 | .Xr ERR_get_error 3 . |
225 | .Sh SEE ALSO | 259 | .Sh SEE ALSO |
260 | .Xr d2i_PKCS8_PRIV_KEY_INFO 3 , | ||
226 | .Xr d2i_PKCS8PrivateKey_bio 3 , | 261 | .Xr d2i_PKCS8PrivateKey_bio 3 , |
227 | .Xr EVP_PKEY_type 3 , | 262 | .Xr EVP_PKEY_type 3 , |
228 | .Xr PEM_write_PrivateKey 3 , | 263 | .Xr PEM_write_PrivateKey 3 , |