[#PKCS12_decrypt_skey_ex]
= PKCS12&lowbar;decrypt&lowbar;skey&lowbar;ex
:mrdocs:

Decrypt the PKCS&num;8 shrouded key in a pkcs8ShroudedKeyBag safeBag&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]*
PKCS12&lowbar;decrypt&lowbar;skey&lowbar;ex(
    xref:PKCS12_SAFEBAG.adoc[PKCS12&lowbar;SAFEBAG] const* bag,
    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
| *bag*
| SafeBag containing an encrypted private key&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]#
