PEM_read_bio_PrivateKey_ex

Read a private key from a PEM-encoded BIO with an explicit library context.

Synopsis

Declared in <openssl/pem.h>

EVP_PKEY*
PEM_read_bio_PrivateKey_ex(
    BIO* bp,
    EVP_PKEY** x,
    pem_password_cb* cb,
    void* u,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

Private key on success, or NULL on failure.

Parameters

NameDescription
bpBIO to read from.
xOptional address of an EVP_PKEY pointer to reuse, or NULL.
cbPassword callback for encrypted PEM / PKCS#8, or NULL.
uApplication data passed to cb.
libctxLibrary context used for provider-backed decoding, or NULL for the default.
propqProperty query for algorithm fetches, or NULL.