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

Build a PKCS&num;5 PBES2 AlgorithmIdentifier for `cipher` with optional IV and PBKDF2 PRF&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&lowbar;iv(
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* cipher,
    int iter,
    unsigned char* salt,
    int saltlen,
    unsigned char* aiv,
    int prf&lowbar;nid);
----

== Return Value

Newly allocated X509&lowbar;ALGOR, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cipher*
| Cipher that defines the encryption scheme&period;
| *iter*
| PBKDF2 iteration count&period;
| *salt*
| Salt bytes, or NULL as implemented&period;
| *saltlen*
| Length of `salt` in bytes&period;
| *aiv*
| Explicit IV bytes, or NULL to generate one&period;
| *prf&lowbar;nid*
| NID of the PBKDF2 PRF, or 0 for the default&period;
|===


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