[#PEM_read_X509_PUBKEY]
= PEM&lowbar;read&lowbar;X509&lowbar;PUBKEY
:mrdocs:

Read an X&period;509 SubjectPublicKeyInfo from a PEM&hyphen;encoded FILE stream&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:X509_PUBKEY.adoc[X509&lowbar;PUBKEY]*
PEM&lowbar;read&lowbar;X509&lowbar;PUBKEY(
    FILE* fp,
    xref:X509_PUBKEY.adoc[X509&lowbar;PUBKEY]** x,
    xref:pem_password_cb.adoc[pem&lowbar;password&lowbar;cb]* cb,
    void* u);
----

== Return Value

Public key on success, or NULL on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *fp*
| FILE to read from&period;
| *x*
| Optional address of an X509&lowbar;PUBKEY pointer to reuse, or NULL&period;
| *cb*
| Password callback for encrypted PEM, or NULL&period;
| *u*
| Application data passed to `cb&period;`
|===


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