PKCS12_set_mac

Compute and store the MAC and MAC parameters in a PKCS#12 object.

Synopsis

Declared in <openssl/pkcs12.h>

int
PKCS12_set_mac(
    PKCS12* p12,
    char const* pass,
    int passlen,
    unsigned char* salt,
    int saltlen,
    int iter,
    EVP_MD const* md_type);

Return Value

1 on success, 0 on error.

Parameters

NameDescription
p12PKCS#12 structure to update.
passPassphrase for the HMAC.
passlenLength of pass, or -1 to use strlen().
saltSalt for MAC key derivation, or NULL to generate one.
saltlenLength of salt in bytes.
iterIteration count for MAC key derivation (1 omits the count from the structure).
md_typeMessage digest for the HMAC.