PEM_bytes_read_bio_secmem

Read a named PEM object from a BIO into secure memory, decrypting if needed.

Synopsis

Declared in <openssl/pem.h>

int
PEM_bytes_read_bio_secmem(
    unsigned char** pdata,
    long* plen,
    char** pnm,
    char const* name,
    BIO* bp,
    pem_password_cb* cb,
    void* u);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
pdataReceives newly allocated DER payload in secure memory (caller frees with OPENSSL_secure_free).
plenReceives the length of *pdata in bytes.
pnmOptional; receives the actual PEM type name from the BEGIN line (caller frees).
nameExpected PEM type label (for example "CERTIFICATE"); non-matching types are skipped.
bpBIO to read from.
cbPassword callback for encrypted PEM, or NULL.
uApplication data passed to cb.