Encode an ASN.1 object with i2d and write it as PEM to a FILE.
Declared in <openssl/pem.h>
int
PEM_ASN1_write(
i2d_of_void* i2d,
char const* name,
FILE* fp,
void const* x,
EVP_CIPHER const* enc,
unsigned char const* kstr,
int klen,
pem_password_cb* callback,
void* u);
1 on success, or 0 on failure.
| Name | Description |
|---|---|
| i2d | ASN.1 encode callback for the object type. |
| name | PEM type label used on the BEGIN/END lines. |
| fp | FILE to write to. |
| x | Object to encode. |
| enc | Optional cipher for traditional PEM encryption, or NULL. |
| kstr | Optional key material for enc, or NULL to prompt via callback. |
| klen | Length of kstr in bytes. |
| callback | Password callback when encrypting without kstr, or NULL. |
| u | Application data passed to callback. |