PEM_read_bio

Read one PEM object from a BIO, returning name, header, and decoded data.

Synopsis

Declared in <openssl/pem.h>

int
PEM_read_bio(
    BIO* bp,
    char** name,
    char** header,
    unsigned char** data,
    long* len);

Return Value

1 on success, or 0 on failure / end of input.

Parameters

NameDescription
bpBIO to read from.
nameReceives a newly allocated PEM type name (caller frees with OPENSSL_free).
headerReceives a newly allocated PEM header block, or an empty string.
dataReceives newly allocated decoded payload bytes.
lenReceives the length of *data in bytes.