Read one PEM object from a FILE, returning name, header, and decoded data.
Declared in <openssl/pem.h>
int
PEM_read(
FILE* fp,
char** name,
char** header,
unsigned char** data,
long* len);
1 on success, or 0 on failure / end of input.
| Name | Description |
|---|---|
| fp | FILE to read from. |
| name | Receives a newly allocated PEM type name (caller frees with OPENSSL_free). |
| header | Receives a newly allocated PEM header block, or an empty string. |
| data | Receives newly allocated decoded payload bytes. |
| len | Receives the length of *data in bytes. |