[#PKCS12_add_secret]
= PKCS12&lowbar;add&lowbar;secret
:mrdocs:

Create a secretBag safeBag and append it to a stack of safeBags&period;

== Synopsis

Declared in `&lt;openssl&sol;pkcs12&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:PKCS12_SAFEBAG.adoc[PKCS12&lowbar;SAFEBAG]*
PKCS12&lowbar;add&lowbar;secret(
    stack&lowbar;st&lowbar;PKCS12&lowbar;SAFEBAG** pbags,
    int nid&lowbar;type,
    unsigned char const* value,
    int len);
----

== Return Value

The new safeBag, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pbags*
| Address of safeBag stack pointer (created if &ast;`pbags` is NULL)&period;
| *nid&lowbar;type*
| NID tagging the secret contents&period;
| *value*
| Octets of the secret value&period;
| *len*
| Length of `value` in bytes&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
