[#EVP_PKEY_get_raw_public_key]
= EVP&lowbar;PKEY&lowbar;get&lowbar;raw&lowbar;public&lowbar;key
:mrdocs:

Export the raw public key bytes of `pkey` into `pub&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;PKEY&lowbar;get&lowbar;raw&lowbar;public&lowbar;key(
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY] const* pkey,
    unsigned char* pub,
    size&lowbar;t* len);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pkey*
| Key whose public material is exported (algorithm&hyphen;dependent format)&period;
| *pub*
| Output buffer, or NULL to only query the required length via `len&period;`
| *len*
| On entry, capacity of `pub` when non&hyphen;NULL&semi; on return, number of bytes written or required&period;
|===


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