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

Name

Description

pdata

Receives newly allocated DER payload in secure memory (caller frees with OPENSSL_secure_free).

plen

Receives the length of *`pdata` in bytes.

pnm

Optional; receives the actual PEM type name from the BEGIN line (caller frees).

name

Expected PEM type label (for example "CERTIFICATE"); non‐matching types are skipped.

bp

BIO to read from.

cb

Password callback for encrypted PEM, or NULL.

u

Application data passed to cb.

Created with MrDocs