"Fossies" - the Fresh Open Source Software Archive

Member "libressl-2.9.2/man/d2i_PKCS8PrivateKey_bio.3" (23 Mar 2018, 5386 Bytes) of package /linux/misc/libressl-2.9.2.tar.gz:


Caution: As a special service "Fossies" has tried to format the requested manual source page into HTML format but links to other man pages may be missing or even errorneous. Alternatively you can here view or download the uninterpreted manual source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

D2I_PKCS8PRIVATEKEY_B... BSD Library Functions Manual D2I_PKCS8PRIVATEKEY_B...

NAME

d2i_PKCS8PrivateKey_bio, d2i_PKCS8PrivateKey_fp, i2d_PKCS8PrivateKey_bio, i2d_PKCS8PrivateKey_fp, i2d_PKCS8PrivateKey_nid_bio, i2d_PKCS8PrivateKey_nid_fp — PKCS#8 format private key functions

SYNOPSIS

#include <openssl/evp.h>

EVP_PKEY *

d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u);

EVP_PKEY *

d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u);

int

i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u);

int

i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u);

int

i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u);

int

i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u);

DESCRIPTION

The PKCS#8 functions encode and decode private keys in PKCS#8 format using both PKCS#5 v1.5 and PKCS#5 v2.0 password based encryption algorithms.

Other than the use of DER as opposed to PEM these functions are identical to the corresponding functions described in PEM_read_PrivateKey(3).

Before using these functions, OpenSSL_add_all_algorithms(3) should be called to initialize the internal algorithm lookup tables. Otherwise errors about unknown algorithms will occur if an attempt is made to decrypt a private key.

These functions are currently the only way to store encrypted private keys using DER format.

Currently all the functions use BIO or FILE pointers. There are no functions which work directly on memory, though this can be readily worked around by converting the buffers to memory BIOs; see BIO_s_mem(3) for details.

RETURN VALUES

d2i_PKCS8PrivateKey_bio() and d2i_PKCS8PrivateKey_fp() return a EVP_PKEY object or NULL if an error occurs.

i2d_PKCS8PrivateKey_bio(), i2d_PKCS8PrivateKey_fp(), i2d_PKCS8PrivateKey_nid_bio(), and i2d_PKCS8PrivateKey_nid_fp() return 1 on success or 0 on error.

SEE ALSO

d2i_X509_SIG(3), PEM_write_PKCS8PrivateKey(3), PKCS8_PRIV_KEY_INFO_new(3)

HISTORY

These functions first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.

CAVEATS

Do not confuse these functions with i2d_PKCS8PrivateKeyInfo_bio(3) and i2d_PKCS8PrivateKeyInfo_fp(3), which write out private keys in unencrypted DER format.

BSD March 22, 2018 BSD