[#PKCS12_PBE_keyivgen_ex]
= PKCS12&lowbar;PBE&lowbar;keyivgen&lowbar;ex
:mrdocs:

Initialise a cipher context for PKCS&num;12 PBE encryption or decryption&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS12&lowbar;PBE&lowbar;keyivgen&lowbar;ex(
    xref:EVP_CIPHER_CTX.adoc[EVP&lowbar;CIPHER&lowbar;CTX]* ctx,
    char const* pass,
    int passlen,
    xref:ASN1_TYPE.adoc[ASN1&lowbar;TYPE]* param,
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* cipher,
    xref:EVP_MD.adoc[EVP&lowbar;MD] const* md&lowbar;type,
    int en&lowbar;de,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx,
    char const* propq);
----

== Return Value

1 on success, 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Cipher context to initialise&period;
| *pass*
| Passphrase (treated as a byte sequence)&period;
| *passlen*
| Length of `pass,` or &hyphen;1 to use strlen()&period;
| *param*
| PBE algorithm parameters&period;
| *cipher*
| Cipher for the operation&period;
| *md&lowbar;type*
| Message digest for key derivation&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]#
