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