Encode an ASN.1 object with i2d and write it as a PEM block to a BIO.
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);
1 on success, or 0 on failure.
| Name | Description |
|---|---|
| i2d | Encoder such as i2d_X509. |
| name | PEM type label written after "-----BEGIN ". |
| bp | BIO that receives the PEM text. |
| x | Object passed to i2d. |
| enc | Optional cipher for encrypting the PEM, or NULL for cleartext. |
| kstr | Optional encryption key bytes when enc is non-NULL, or NULL to use cb. |
| klen | Length of kstr in bytes. |
| cb | Password callback used when enc is set and kstr is NULL, or NULL. |
| u | Application data passed to cb. |