1.Dd $Mdocdate: November 12 2015 $ 2.Dt D2I_PKCS8PRIVATEKEY_BIO 3 3.Os 4.Sh NAME 5.Nm d2i_PKCS8PrivateKey_bio , 6.Nm d2i_PKCS8PrivateKey_fp , 7.Nm i2d_PKCS8PrivateKey_bio , 8.Nm i2d_PKCS8PrivateKey_fp , 9.Nm i2d_PKCS8PrivateKey_nid_bio , 10.Nm i2d_PKCS8PrivateKey_nid_fp 11.Nd PKCS#8 format private key functions 12.Sh SYNOPSIS 13.In openssl/evp.h 14.Ft EVP_PKEY * 15.Fo d2i_PKCS8PrivateKey_bio 16.Fa "BIO *bp" 17.Fa "EVP_PKEY **x" 18.Fa "pem_password_cb *cb" 19.Fa "void *u" 20.Fc 21.Ft EVP_PKEY * 22.Fo d2i_PKCS8PrivateKey_fp 23.Fa "FILE *fp" 24.Fa "EVP_PKEY **x" 25.Fa "pem_password_cb *cb" 26.Fa "void *u" 27.Fc 28.Ft int 29.Fo i2d_PKCS8PrivateKey_bio 30.Fa "BIO *bp" 31.Fa "EVP_PKEY *x" 32.Fa "const EVP_CIPHER *enc" 33.Fa "char *kstr" 34.Fa "int klen" 35.Fa "pem_password_cb *cb" 36.Fa "void *u" 37.Fc 38.Ft int 39.Fo i2d_PKCS8PrivateKey_fp 40.Fa "FILE *fp" 41.Fa "EVP_PKEY *x" 42.Fa "const EVP_CIPHER *enc" 43.Fa "char *kstr" 44.Fa "int klen" 45.Fa "pem_password_cb *cb" 46.Fa "void *u" 47.Fc 48.Ft int 49.Fo i2d_PKCS8PrivateKey_nid_bio 50.Fa "BIO *bp" 51.Fa "EVP_PKEY *x" 52.Fa "int nid" 53.Fa "char *kstr" 54.Fa "int klen" 55.Fa "pem_password_cb *cb" 56.Fa "void *u" 57.Fc 58.Ft int 59.Fo i2d_PKCS8PrivateKey_nid_fp 60.Fa "FILE *fp" 61.Fa "EVP_PKEY *x" 62.Fa "int nid" 63.Fa "char *kstr" 64.Fa "int klen" 65.Fa "pem_password_cb *cb" 66.Fa "void *u" 67.Fc 68.Sh DESCRIPTION 69The PKCS#8 functions encode and decode private keys in PKCS#8 format 70using both PKCS#5 v1.5 and PKCS#5 v2.0 password based encryption 71algorithms. 72.Pp 73Other than the use of DER as opposed to PEM these functions are 74identical to the corresponding 75.Xr pem 3 76functions. 77.Sh NOTES 78Before using these functions, 79.Xr OpenSSL_add_all_algorithms 3 80should be called to initialize the internal algorithm lookup tables. 81Otherwise errors about unknown algorithms will occur if an attempt is 82made to decrypt a private key. 83.Pp 84These functions are currently the only way to store encrypted private 85keys using DER format. 86.Pp 87Currently all the functions use 88.Vt BIO 89or 90.Vt FILE 91pointers, there are no functions which work directly on memory: 92this can be readily worked around by converting the buffers to 93memory BIOs, see 94.Xr BIO_s_mem 3 95for details. 96.Sh SEE ALSO 97.Xr pem 3 98