Read a named PEM object from a FILE and decode it with d2i.

Synopsis

Declared in <openssl/pem.h>

void*
PEM_ASN1_read(
    d2i_of_void* d2i,
    char const* name,
    FILE* fp,
    void** x,
    pem_password_cb* cb,
    void* u);

Return Value

Decoded object on success, or NULL on failure.

Parameters

Name

Description

d2i

ASN.1 decode callback for the expected type.

name

PEM type label expected on the BEGIN line (e.g. "CERTIFICATE").

fp

FILE to read from.

x

Optional address of an object pointer to reuse, or NULL.

cb

Password callback for encrypted PEM, or NULL.

u

Application data passed to cb.

Created with MrDocs