[#EVP_PKEY_new_raw_public_key_ex]
= EVP&lowbar;PKEY&lowbar;new&lowbar;raw&lowbar;public&lowbar;key&lowbar;ex
:mrdocs:

Create an EVP&lowbar;PKEY from raw public&hyphen;key octets using a named algorithm and library context&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]*
EVP&lowbar;PKEY&lowbar;new&lowbar;raw&lowbar;public&lowbar;key&lowbar;ex(
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx,
    char const* keytype,
    char const* propq,
    unsigned char const* pub,
    size&lowbar;t len);
----

== Return Value

New EVP&lowbar;PKEY, or NULL on failure&semi; free with EVP&lowbar;PKEY&lowbar;free&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *libctx*
| Library context used to fetch the key type, or NULL for the default&period;
| *keytype*
| Algorithm name such as &quot;ED25519&quot; or &quot;X25519&quot;&period;
| *propq*
| Property query string, or NULL&period;
| *pub*
| Raw public&hyphen;key bytes in the algorithm&hyphen;native format&period;
| *len*
| Length of `pub` in bytes&period;
|===


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