PKCS12_pack_p7encdata

Pack safeBags into a PKCS#7 encrypted-data ContentInfo (default library context).

Synopsis

Declared in <openssl/pkcs12.h>

PKCS7*
PKCS12_pack_p7encdata(
    int pbe_nid,
    char const* pass,
    int passlen,
    unsigned char* salt,
    int saltlen,
    int iter,
    stack_st_PKCS12_SAFEBAG* bags);

Return Value

PKCS#7 encrypted-data object, or NULL on error.

Parameters

NameDescription
pbe_nidPBE or cipher NID for encryption (cipher NID selects PBES2 with that cipher).
passPassphrase for encryption.
passlenLength of pass, or -1 to use strlen().
saltSalt for key derivation.
saltlenLength of salt in bytes.
iterIteration count for key derivation.
bagsStack of safeBags to encrypt.