[#PKCS12_key_gen_uni]
= PKCS12&lowbar;key&lowbar;gen&lowbar;uni
:mrdocs:

Derive key material using the PKCS&num;12 key&hyphen;generation function (BMPString passphrase)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS12&lowbar;key&lowbar;gen&lowbar;uni(
    unsigned char* pass,
    int passlen,
    unsigned char* salt,
    int saltlen,
    int id,
    int iter,
    int n,
    unsigned char* out,
    xref:EVP_MD.adoc[EVP&lowbar;MD] const* md&lowbar;type);
----

== Return Value

1 on success, 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pass*
| Unicode passphrase (big&hyphen;endian UTF&hyphen;16, not NUL&hyphen;terminated)&period;
| *passlen*
| Length of `pass` in bytes&period;
| *salt*
| Salt for derivation&period;
| *saltlen*
| Length of `salt` in bytes&period;
| *id*
| Purpose byte (PKCS12&lowbar;KEY&lowbar;ID, PKCS12&lowbar;IV&lowbar;ID, or PKCS12&lowbar;MAC&lowbar;ID)&period;
| *iter*
| Iteration count (values less than 1 are treated as 1)&period;
| *n*
| Number of bytes to derive&period;
| *out*
| Buffer to receive derived key material&period;
| *md&lowbar;type*
| Message digest for the derivation&period;
|===


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