PKCS12_add_safe_ex

Pack safeBags into a PKCS#7 contentInfo and append it to a stack of safes.

Synopsis

Declared in <openssl/pkcs12.h>

int
PKCS12_add_safe_ex(
    stack_st_PKCS7** psafes,
    stack_st_PKCS12_SAFEBAG* bags,
    int safe_nid,
    int iter,
    char const* pass,
    OSSL_LIB_CTX* ctx,
    char const* propq);

Return Value

1 on success, 0 on failure.

Parameters

NameDescription
psafesAddress of PKCS#7 stack pointer (created if *psafes is NULL).
bagsStack of safeBags to pack.
safe_nid-1 for plain data, 0 for default encrypted, or a PBE NID for encrypted.
iterIteration count for encryption, or 0 for default (2048).
passPassphrase when safe_nid selects encryption, or NULL for plain data.
ctxLibrary context for algorithm fetching, or NULL for default.
propqProperty query for algorithm fetching, or NULL.