[#PKCS5_pbe2_set]
= PKCS5&lowbar;pbe2&lowbar;set
:mrdocs:

Build a PKCS&num;5 PBES2 AlgorithmIdentifier for `cipher` with PBKDF2&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:X509_ALGOR.adoc[X509&lowbar;ALGOR]*
PKCS5&lowbar;pbe2&lowbar;set(
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* cipher,
    int iter,
    unsigned char* salt,
    int saltlen);
----

== Return Value

New X509&lowbar;ALGOR encoding PBES2 parameters, or NULL on error&semi; free with X509&lowbar;ALGOR&lowbar;free()&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cipher*
| Content&hyphen;encryption cipher for the PBES2 encryption scheme&period;
| *iter*
| PBKDF2 iteration count&semi; &lt;&equals;0 selects the default&period;
| *salt*
| Optional salt bytes&semi; NULL generates a random salt of `saltlen` (default 16 if 0)&period;
| *saltlen*
| Salt length in bytes when `salt` is NULL &sol; length of `salt&period;`
|===


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