[#EVP_PKEY_get1_encoded_public_key]
= EVP&lowbar;PKEY&lowbar;get1&lowbar;encoded&lowbar;public&lowbar;key
:mrdocs:

Allocate and return the encoded public&hyphen;key octet string for `pkey&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
size&lowbar;t
EVP&lowbar;PKEY&lowbar;get1&lowbar;encoded&lowbar;public&lowbar;key(
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pkey,
    unsigned char** ppub);
----

== Return Value

Length of the encoded public key in bytes, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pkey*
| Key whose public key is exported&period;
| *ppub*
| On success, set to a newly allocated buffer holding the encoded public key&semi; free with OPENSSL&lowbar;free()&period;
|===


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