[#PEM_X509_INFO_write_bio]
= PEM&lowbar;X509&lowbar;INFO&lowbar;write&lowbar;bio
:mrdocs:

Write the certificate, CRL, and&sol;or private key from an X509&lowbar;INFO as PEM&period;

== Synopsis

Declared in `&lt;openssl&sol;pem&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PEM&lowbar;X509&lowbar;INFO&lowbar;write&lowbar;bio(
    xref:BIO.adoc[BIO]* bp,
    xref:X509_INFO.adoc[X509&lowbar;INFO] const* xi,
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER]* enc,
    unsigned char const* kstr,
    int klen,
    xref:pem_password_cb.adoc[pem&lowbar;password&lowbar;cb]* cd,
    void* u);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *bp*
| BIO to write to&period;
| *xi*
| Bundle whose non&hyphen;NULL members are encoded&period;
| *enc*
| Optional cipher for encrypting a private key, or NULL&period;
| *kstr*
| Optional key material for `enc,` or NULL to prompt via `cd&period;`
| *klen*
| Length of `kstr` in bytes&period;
| *cd*
| Password callback used when encrypting without `kstr,` or NULL&period;
| *u*
| Application data passed to `cd&period;`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
