[#PKCS5_pbe_set0_algor_ex]
= PKCS5&lowbar;pbe&lowbar;set0&lowbar;algor&lowbar;ex
:mrdocs:

Set a PBES1 AlgorithmIdentifier (OID, iteration count, and salt) with a library context&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS5&lowbar;pbe&lowbar;set0&lowbar;algor&lowbar;ex(
    xref:X509_ALGOR.adoc[X509&lowbar;ALGOR]* algor,
    int alg,
    int iter,
    unsigned char const* salt,
    int saltlen,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *algor*
| Destination AlgorithmIdentifier updated in place&period;
| *alg*
| PBE algorithm NID&period;
| *iter*
| Iteration count for key derivation&period;
| *salt*
| Salt octets, or NULL to generate a random salt of length `saltlen` (or a default when `saltlen` is 0)&period;
| *saltlen*
| Length of `salt` in bytes, or the length of salt to generate when `salt` is NULL&period;
| *libctx*
| Library context for random salt generation, or NULL for the default&period;
|===


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