[#PKCS12_pack_p7encdata_ex]
= PKCS12&lowbar;pack&lowbar;p7encdata&lowbar;ex
:mrdocs:

Pack safeBags into a PKCS&num;7 encrypted&hyphen;data ContentInfo&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:PKCS7.adoc[PKCS7]*
PKCS12&lowbar;pack&lowbar;p7encdata&lowbar;ex(
    int pbe&lowbar;nid,
    char const* pass,
    int passlen,
    unsigned char* salt,
    int saltlen,
    int iter,
    xref:stack_st_PKCS12_SAFEBAG.adoc[stack&lowbar;st&lowbar;PKCS12&lowbar;SAFEBAG]* bags,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* ctx,
    char const* propq);
----

== Return Value

PKCS&num;7 encrypted&hyphen;data object, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pbe&lowbar;nid*
| PBE or cipher NID for encryption&period;
| *pass*
| Passphrase for encryption&period;
| *passlen*
| Length of `pass,` or &hyphen;1 to use strlen()&period;
| *salt*
| Salt for key derivation&period;
| *saltlen*
| Length of `salt` in bytes&period;
| *iter*
| Iteration count for key derivation&period;
| *bags*
| Stack of safeBags to encrypt&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]#
