PKCS5_pbe2_set

Build a PKCS#5 PBES2 AlgorithmIdentifier for cipher with PBKDF2.

Synopsis

Declared in <openssl/x509.h>

X509_ALGOR*
PKCS5_pbe2_set(
    EVP_CIPHER const* cipher,
    int iter,
    unsigned char* salt,
    int saltlen);

Return Value

New X509_ALGOR encoding PBES2 parameters, or NULL on error; free with X509_ALGOR_free().

Parameters

NameDescription
cipherContent-encryption cipher for the PBES2 encryption scheme.
iterPBKDF2 iteration count; <=0 selects the default.
saltOptional salt bytes; NULL generates a random salt of saltlen (default 16 if 0).
saltlenSalt length in bytes when salt is NULL / length of salt.