[#PEM_write]
= PEM&lowbar;write
:mrdocs:

Write a PEM object (header, optional headers, and base64 body) to a FILE&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PEM&lowbar;write(
    FILE* fp,
    char const* name,
    char const* hdr,
    unsigned char const* data,
    long len);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *fp*
| FILE that receives the PEM text&period;
| *name*
| PEM type label such as &quot;CERTIFICATE&quot;&period;
| *hdr*
| Optional additional header lines, or NULL &sol; empty string&period;
| *data*
| Binary payload to base64&hyphen;encode&period;
| *len*
| Length of `data` in bytes&period;
|===


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