1d2i_PKCS8PrivateKey(3) OpenSSL d2i_PKCS8PrivateKey(3)
2
3
4
6 d2i_PKCS8PrivateKey_bio, d2i_PKCS8PrivateKey_fp, i2d_PKCS8Pri‐
7 vateKey_bio, i2d_PKCS8PrivateKey_fp, i2d_PKCS8PrivateKey_nid_bio,
8 i2d_PKCS8PrivateKey_nid_fp - PKCS#8 format private key functions
9
11 #include <openssl/evp.h>
12
13 EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u);
14 EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u);
15
16 int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
17 char *kstr, int klen,
18 pem_password_cb *cb, void *u);
19
20 int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
21 char *kstr, int klen,
22 pem_password_cb *cb, void *u);
23
24 int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
25 char *kstr, int klen,
26 pem_password_cb *cb, void *u);
27
28 int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
29 char *kstr, int klen,
30 pem_password_cb *cb, void *u);
31
33 The PKCS#8 functions encode and decode private keys in PKCS#8 format
34 using both PKCS#5 v1.5 and PKCS#5 v2.0 password based encryption algo‐
35 rithms.
36
37 Other than the use of DER as opposed to PEM these functions are identi‐
38 cal to the corresponding PEM function as described in the pem(3) manual
39 page.
40
42 Before using these functions OpenSSL_add_all_algorithms(3) should be
43 called to initialize the internal algorithm lookup tables otherwise
44 errors about unknown algorithms will occur if an attempt is made to
45 decrypt a private key.
46
47 These functions are currently the only way to store encrypted private
48 keys using DER format.
49
50 Currently all the functions use BIOs or FILE pointers, there are no
51 functions which work directly on memory: this can be readily worked
52 around by converting the buffers to memory BIOs, see BIO_s_mem(3) for
53 details.
54
56 pem(3)
57
58
59
600.9.8b 2002-10-07 d2i_PKCS8PrivateKey(3)