[#PKCS12_pbe_crypt_ex]
= PKCS12&lowbar;pbe&lowbar;crypt&lowbar;ex
:mrdocs:

Encrypt or decrypt a buffer using a PKCS&num;12 PBE algorithm&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
unsigned char*
PKCS12&lowbar;pbe&lowbar;crypt&lowbar;ex(
    xref:X509_ALGOR.adoc[X509&lowbar;ALGOR] const* algor,
    char const* pass,
    int passlen,
    unsigned char const* in,
    int inlen,
    unsigned char** data,
    int* datalen,
    int en&lowbar;de,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx,
    char const* propq);
----

== Return Value

Pointer to output buffer (same as &ast;`data),` or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *algor*
| PBE algorithm identifier&period;
| *pass*
| Passphrase&period;
| *passlen*
| Length of `pass,` or &hyphen;1 to use strlen()&period;
| *in*
| Input buffer&period;
| *inlen*
| Length of `in` in bytes&period;
| *data*
| Address of output buffer pointer (malloc&apos;d on success)&period;
| *datalen*
| Address to receive output length in bytes&period;
| *en&lowbar;de*
| 1 to encrypt, 0 to decrypt&period;
| *libctx*
| 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]#
