[#OSSL_DECODER_CTX_new_for_pkey]
= OSSL&lowbar;DECODER&lowbar;CTX&lowbar;new&lowbar;for&lowbar;pkey
:mrdocs:

Create a decoder context preconfigured to decode an EVP&lowbar;PKEY&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:OSSL_DECODER_CTX.adoc[OSSL&lowbar;DECODER&lowbar;CTX]*
OSSL&lowbar;DECODER&lowbar;CTX&lowbar;new&lowbar;for&lowbar;pkey(
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]** pkey,
    char const* input&lowbar;type,
    char const* input&lowbar;struct,
    char const* keytype,
    int selection,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx,
    char const* propquery);
----

== Return Value

New decoder context, or NULL on error&semi; free with OSSL&lowbar;DECODER&lowbar;CTX&lowbar;free()&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pkey*
| Address of a pointer set to the decoded key on success&period;
| *input&lowbar;type*
| Expected encoding type (for example &quot;DER&quot;), or NULL&period;
| *input&lowbar;struct*
| Expected ASN&period;1 structure name, or NULL&period;
| *keytype*
| Target key type name (for example &quot;RSA&quot;), or NULL&period;
| *selection*
| OSSL&lowbar;KEYMGMT&lowbar;SELECT&lowbar;&ast; mask for components to decode&period;
| *libctx*
| Library context, or NULL for the default&period;
| *propquery*
| Optional property query for decoder fetching, or NULL&period;
|===


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