[#PKCS12_add_key_ex] = PKCS12_add_key_ex :mrdocs: Create a key safeBag and append it to a stack of safeBags. == Synopsis Declared in `<openssl/pkcs12.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:PKCS12_SAFEBAG.adoc[PKCS12_SAFEBAG]* PKCS12_add_key_ex( xref:stack_st_PKCS12_SAFEBAG.adoc[stack_st_PKCS12_SAFEBAG]** pbags, xref:EVP_PKEY.adoc[EVP_PKEY]* key, int key_usage, int iter, int key_nid, char const* pass, xref:OSSL_LIB_CTX.adoc[OSSL_LIB_CTX]* ctx, char const* propq); ---- == Return Value The new safeBag, or NULL on error. == Parameters [cols="1,4"] |=== | Name| Description | *pbags* | Address of safeBag stack pointer (created if *`pbags` is NULL). | *key* | Private key to add. | *key_usage* | MS key‐usage flag (KEY_SIG or KEY_EX), or 0 to omit. | *iter* | Iteration count for key encryption, or 0 for default. | *key_nid* | PBE NID for key encryption, or ‐1 for an unencrypted keyBag. | *pass* | Passphrase when `key_nid` selects encryption, or NULL otherwise. | *ctx* | Library context for algorithm fetching, or NULL for default. | *propq* | Property query for algorithm fetching, or NULL. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#