PEM_write_bio

Write a PEM object (header, optional headers, and base64 body) to a BIO.

Synopsis

Declared in <openssl/pem.h>

int
PEM_write_bio(
    BIO* bp,
    char const* name,
    char const* hdr,
    unsigned char const* data,
    long len);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
bpBIO that receives the PEM text.
namePEM type label such as "CERTIFICATE".
hdrOptional additional header lines, or NULL / empty string.
dataBinary payload to base64-encode.
lenLength of data in bytes.