[#EVP_PKEY_set1_encoded_public_key]
= EVP&lowbar;PKEY&lowbar;set1&lowbar;encoded&lowbar;public&lowbar;key
:mrdocs:

Set the public key on `pkey` from an encoded public&hyphen;key octet string&period;

== Synopsis

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

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

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pkey*
| Key object that receives the public key (type must already be set)&period;
| *pub*
| Encoded public&hyphen;key bytes (format is algorithm&hyphen;specific, for example a TLS point)&period;
| *publen*
| Length of `pub` in bytes&period;
|===


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