PKCS12_create_ex

Create a PKCS#12 structure from a key, certificate, and optional CA stack.

Synopsis

Declared in <openssl/pkcs12.h>

PKCS12*
PKCS12_create_ex(
    char const* pass,
    char const* name,
    EVP_PKEY* pkey,
    X509* cert,
    stack_st_X509* ca,
    int nid_key,
    int nid_cert,
    int iter,
    int mac_iter,
    int keytype,
    OSSL_LIB_CTX* ctx,
    char const* propq);

Return Value

New PKCS#12 structure, or NULL on error.

Parameters

NameDescription
passPassphrase for encryption and MAC.
nameFriendly name for the key and certificate.
pkeyPrivate key to include, or NULL.
certEntity certificate to include, or NULL.
caOptional additional certificates, or NULL.
nid_keyPBE NID for key encryption, or 0/-1 for defaults/no encryption.
nid_certPBE NID for certificate encryption, or 0/-1 for defaults/no encryption.
iterEncryption iteration count, or 0 for default.
mac_iterMAC iteration count, or 0/-1 for default/omit MAC.
keytypeMS key-usage flag (KEY_SIG or KEY_EX), or 0 to omit.
ctxLibrary context for algorithm fetching, or NULL for default.
propqProperty query for algorithm fetching, or NULL.