PEM_ASN1_write_bio

Encode an ASN.1 object with i2d and write it as a PEM block to a BIO.

Synopsis

Declared in <openssl/pem.h>

int
PEM_ASN1_write_bio(
    i2d_of_void* i2d,
    char const* name,
    BIO* bp,
    void const* x,
    EVP_CIPHER const* enc,
    unsigned char const* kstr,
    int klen,
    pem_password_cb* cb,
    void* u);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
i2dEncoder such as i2d_X509.
namePEM type label written after "-----BEGIN ".
bpBIO that receives the PEM text.
xObject passed to i2d.
encOptional cipher for encrypting the PEM, or NULL for cleartext.
kstrOptional encryption key bytes when enc is non-NULL, or NULL to use cb.
klenLength of kstr in bytes.
cbPassword callback used when enc is set and kstr is NULL, or NULL.
uApplication data passed to cb.