Create a PKCS#12 structure from a key, certificate, and optional CA stack (default library context).
Declared in <openssl/pkcs12.h>
PKCS12*
PKCS12_create(
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);
New PKCS#12 structure, or NULL on error.
| 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. |