summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-12-28 01:38:17 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-12-28 01:38:17 +0000
commitc59a44669e546057a005a7a56c221547900ce982 (patch)
treea4343acae4a0dc77df6baaa53e697834fe6a0ca1 /lib
parent589ffdc3100008cfbe2b948536780d1468dab5b2 (diff)
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 'lib')
-rw-r--r--lib/libcrypto/man/d2i_PrivateKey.347
1 files changed, 41 insertions, 6 deletions
diff --git a/lib/libcrypto/man/d2i_PrivateKey.3 b/lib/libcrypto/man/d2i_PrivateKey.3
index 3c5e9f8cc83..caf7479289d 100644
--- a/lib/libcrypto/man/d2i_PrivateKey.3
+++ b/lib/libcrypto/man/d2i_PrivateKey.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: d2i_PrivateKey.3,v 1.4 2016/12/25 20:01:48 schwarze Exp $
+.\" $OpenBSD: d2i_PrivateKey.3,v 1.5 2016/12/28 01:38:16 schwarze Exp $
.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file is a derived work.
@@ -65,7 +65,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: December 25 2016 $
+.Dd $Mdocdate: December 28 2016 $
.Dt D2I_PRIVATEKEY 3
.Os
.Sh NAME
@@ -74,6 +74,8 @@
.Nm i2d_PrivateKey ,
.Nm d2i_PrivateKey_bio ,
.Nm d2i_PrivateKey_fp ,
+.Nm i2d_PKCS8PrivateKeyInfo_bio ,
+.Nm i2d_PKCS8PrivateKeyInfo_fp ,
.Nm d2i_PublicKey ,
.Nm i2d_PublicKey
.Nd decode and encode EVP_PKEY objects
@@ -107,6 +109,16 @@
.Fa "FILE *in_fp"
.Fa "EVP_PKEY **val_out"
.Fc
+.Ft int
+.Fo i2d_PKCS8PrivateKeyInfo_bio
+.Fa "BIO *out_bio"
+.Fa "EVP_PKEY *val_in"
+.Fc
+.Ft int
+.Fo i2d_PKCS8PrivateKeyInfo_fp
+.Fa "FILE *out_fp"
+.Fa "EVP_PKEY *val_in"
+.Fc
.Ft EVP_PKEY *
.Fo d2i_PublicKey
.Fa "int type"
@@ -128,7 +140,7 @@ For details about the semantics, examples, caveats, and bugs, see
.Fn d2i_PrivateKey
decodes a private key using algorithm
.Fa type .
-It attempts to use any key specific format or the PKCS#8 unencrypted
+It attempts to use any algorithm specific format or the PKCS#8 unencrypted
.Vt PrivateKeyInfo
format defined in RFC 5208 section 5.
The
@@ -157,11 +169,28 @@ pointer.
.Fn i2d_PrivateKey
encodes
.Fa val_in .
-It uses a key specific format or, if none is defined for that key type,
-the PKCS#8 unencrypted
+It uses an algorithm specific format or, if none is defined for
+that key type, the PKCS#8 unencrypted
.Vt PrivateKeyInfo
format.
.Pp
+.Fn i2d_PKCS8PrivateKeyInfo_bio
+and
+.Fn i2d_PKCS8PrivateKeyInfo_fp
+encode
+.Fa val_in
+in PKCS#8 unencrypted
+.Vt PrivateKeyInfo
+format.
+They are similar to
+.Fn i2d_PrivateKey
+except that they don't use any algorithm-specific formats
+and that they write to a
+.Vt BIO
+or
+.Vt FILE
+pointer rather than to a buffer.
+.Pp
All these functions use DER format and unencrypted keys.
Applications wishing to encrypt or decrypt private keys should use other
functions such as
@@ -209,7 +238,7 @@ depending on the algorithm used by
and
.Fn d2i_PublicKey
return a valid
-.Vt EVP_KEY
+.Vt EVP_PKEY
structure or
.Dv NULL
if an error occurs.
@@ -220,9 +249,15 @@ and
return the number of bytes successfully encoded or a negative value if
an error occurs.
.Pp
+.Fn i2d_PKCS8PrivateKeyInfo_bio
+and
+.Fn i2d_PKCS8PrivateKeyInfo_fp
+return 1 for success or 0 if an error occurs.
+.Pp
For all functions, the error code can be obtained by calling
.Xr ERR_get_error 3 .
.Sh SEE ALSO
+.Xr d2i_PKCS8_PRIV_KEY_INFO 3 ,
.Xr d2i_PKCS8PrivateKey_bio 3 ,
.Xr EVP_PKEY_type 3 ,
.Xr PEM_write_PrivateKey 3 ,