[#PEM_ASN1_write_bio] = PEM_ASN1_write_bio :mrdocs: Encode an ASN.1 object with `i2d` and write it as a PEM block to a BIO. == Synopsis Declared in `<openssl/pem.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int PEM_ASN1_write_bio( xref:i2d_of_void.adoc[i2d_of_void]* i2d, char const* name, xref:BIO.adoc[BIO]* bp, void const* x, xref:EVP_CIPHER-07.adoc[EVP_CIPHER] const* enc, unsigned char const* kstr, int klen, xref:pem_password_cb.adoc[pem_password_cb]* cb, void* u); ---- == Return Value 1 on success, or 0 on failure. == Parameters [cols="1,4"] |=== | 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.` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#