1109998Smarkm=pod 2109998Smarkm 3109998Smarkm=head1 NAME 4109998Smarkm 5109998Smarkmd2i_PKCS8PrivateKey_bio, d2i_PKCS8PrivateKey_fp, 6109998Smarkmi2d_PKCS8PrivateKey_bio, i2d_PKCS8PrivateKey_fp, 7109998Smarkmi2d_PKCS8PrivateKey_nid_bio, i2d_PKCS8PrivateKey_nid_fp - PKCS#8 format private key functions 8109998Smarkm 9109998Smarkm=head1 SYNOPSIS 10109998Smarkm 11109998Smarkm #include <openssl/evp.h> 12109998Smarkm 13109998Smarkm EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); 14109998Smarkm EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); 15109998Smarkm 16109998Smarkm int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, 17109998Smarkm char *kstr, int klen, 18109998Smarkm pem_password_cb *cb, void *u); 19109998Smarkm 20109998Smarkm int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, 21109998Smarkm char *kstr, int klen, 22109998Smarkm pem_password_cb *cb, void *u); 23109998Smarkm 24109998Smarkm int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, 25109998Smarkm char *kstr, int klen, 26109998Smarkm pem_password_cb *cb, void *u); 27109998Smarkm 28109998Smarkm int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, 29109998Smarkm char *kstr, int klen, 30109998Smarkm pem_password_cb *cb, void *u); 31109998Smarkm 32109998Smarkm=head1 DESCRIPTION 33109998Smarkm 34109998SmarkmThe PKCS#8 functions encode and decode private keys in PKCS#8 format using both 35109998SmarkmPKCS#5 v1.5 and PKCS#5 v2.0 password based encryption algorithms. 36109998Smarkm 37109998SmarkmOther than the use of DER as opposed to PEM these functions are identical to the 38109998Smarkmcorresponding B<PEM> function as described in the L<pem(3)|pem(3)> manual page. 39109998Smarkm 40109998Smarkm=head1 NOTES 41109998Smarkm 42109998SmarkmBefore using these functions L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)> 43109998Smarkmshould be called to initialize the internal algorithm lookup tables otherwise errors about 44109998Smarkmunknown algorithms will occur if an attempt is made to decrypt a private key. 45109998Smarkm 46109998SmarkmThese functions are currently the only way to store encrypted private keys using DER format. 47109998Smarkm 48109998SmarkmCurrently all the functions use BIOs or FILE pointers, there are no functions which 49109998Smarkmwork directly on memory: this can be readily worked around by converting the buffers 50109998Smarkmto memory BIOs, see L<BIO_s_mem(3)|BIO_s_mem(3)> for details. 51109998Smarkm 52109998Smarkm=head1 SEE ALSO 53109998Smarkm 54109998SmarkmL<pem(3)|pem(3)> 55109998Smarkm 56109998Smarkm=cut 57