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

Name

Description

pass

Passphrase for encryption and MAC.

name

Friendly name for the key and certificate.

pkey

Private key to include, or NULL.

cert

Entity certificate to include, or NULL.

ca

Optional additional certificates, or NULL.

nid_key

PBE NID for key encryption, or 0/‐1 for defaults/no encryption.

nid_cert

PBE NID for certificate encryption, or 0/‐1 for defaults/no encryption.

iter

Encryption iteration count, or 0 for default.

mac_iter

MAC iteration count, or 0/‐1 for default/omit MAC.

keytype

MS key‐usage flag (KEY_SIG or KEY_EX), or 0 to omit.

ctx

Library context for algorithm fetching, or NULL for default.

propq

Property query for algorithm fetching, or NULL.

Created with MrDocs