PEM_read_bio_ex

Read one PEM object from a BIO with controllable decoding behaviour.

Synopsis

Declared in <openssl/pem.h>

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

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
bpBIO to read from.
nameReceives the allocated type name from the BEGIN line; caller frees it.
headerReceives allocated encapsulation headers, or an empty string; caller frees it.
dataReceives allocated base64-decoded payload; caller frees it.
lenReceives the length of data in bytes.
flagsBitwise OR of PEM_FLAG_SECURE, PEM_FLAG_EAY_COMPATIBLE, and/or PEM_FLAG_ONLY_B64.