summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2016-12-28 01:38:16 +0000
committerschwarze <>2016-12-28 01:38:16 +0000
commitc644ecaf8f2621ab8df368198d6897fabc09db2f (patch)
tree5ba14d8df39ce3fffc21f08db5d06995d6e6c30c /src
parent0a4a483c2cf508757470e03668bf0dd23dde8778 (diff)
downloadopenbsd-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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/d2i_PrivateKey.347
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
129decodes a private key using algorithm 141decodes a private key using algorithm
130.Fa type . 142.Fa type .
131It attempts to use any key specific format or the PKCS#8 unencrypted 143It attempts to use any algorithm specific format or the PKCS#8 unencrypted
132.Vt PrivateKeyInfo 144.Vt PrivateKeyInfo
133format defined in RFC 5208 section 5. 145format defined in RFC 5208 section 5.
134The 146The
@@ -157,11 +169,28 @@ pointer.
157.Fn i2d_PrivateKey 169.Fn i2d_PrivateKey
158encodes 170encodes
159.Fa val_in . 171.Fa val_in .
160It uses a key specific format or, if none is defined for that key type, 172It uses an algorithm specific format or, if none is defined for
161the PKCS#8 unencrypted 173that key type, the PKCS#8 unencrypted
162.Vt PrivateKeyInfo 174.Vt PrivateKeyInfo
163format. 175format.
164.Pp 176.Pp
177.Fn i2d_PKCS8PrivateKeyInfo_bio
178and
179.Fn i2d_PKCS8PrivateKeyInfo_fp
180encode
181.Fa val_in
182in PKCS#8 unencrypted
183.Vt PrivateKeyInfo
184format.
185They are similar to
186.Fn i2d_PrivateKey
187except that they don't use any algorithm-specific formats
188and that they write to a
189.Vt BIO
190or
191.Vt FILE
192pointer rather than to a buffer.
193.Pp
165All these functions use DER format and unencrypted keys. 194All these functions use DER format and unencrypted keys.
166Applications wishing to encrypt or decrypt private keys should use other 195Applications wishing to encrypt or decrypt private keys should use other
167functions such as 196functions such as
@@ -209,7 +238,7 @@ depending on the algorithm used by
209and 238and
210.Fn d2i_PublicKey 239.Fn d2i_PublicKey
211return a valid 240return a valid
212.Vt EVP_KEY 241.Vt EVP_PKEY
213structure or 242structure or
214.Dv NULL 243.Dv NULL
215if an error occurs. 244if an error occurs.
@@ -220,9 +249,15 @@ and
220return the number of bytes successfully encoded or a negative value if 249return the number of bytes successfully encoded or a negative value if
221an error occurs. 250an error occurs.
222.Pp 251.Pp
252.Fn i2d_PKCS8PrivateKeyInfo_bio
253and
254.Fn i2d_PKCS8PrivateKeyInfo_fp
255return 1 for success or 0 if an error occurs.
256.Pp
223For all functions, the error code can be obtained by calling 257For 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 ,