[#PKCS8_decrypt_ex]
= PKCS8&lowbar;decrypt&lowbar;ex
:mrdocs:

Decrypt a PKCS&num;8 encrypted private key using a library context&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:PKCS8_PRIV_KEY_INFO.adoc[PKCS8&lowbar;PRIV&lowbar;KEY&lowbar;INFO]*
PKCS8&lowbar;decrypt&lowbar;ex(
    xref:X509_SIG.adoc[X509&lowbar;SIG] const* p8,
    char const* pass,
    int passlen,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* ctx,
    char const* propq);
----

== Return Value

Decrypted PKCS&num;8 private key info, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *p8*
| Encrypted PKCS&num;8 structure (X509&lowbar;SIG)&period;
| *pass*
| Passphrase for decryption&period;
| *passlen*
| Length of `pass,` or &hyphen;1 to use strlen()&period;
| *ctx*
| Library context for algorithm fetching, or NULL for default&period;
| *propq*
| Property query for algorithm fetching, or NULL&period;
|===


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