[#PKCS12_add1_attr_by_NID]
= PKCS12&lowbar;add1&lowbar;attr&lowbar;by&lowbar;NID
:mrdocs:

Add a PKCS&num;12 attribute to a safeBag by NID&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS12&lowbar;add1&lowbar;attr&lowbar;by&lowbar;NID(
    xref:PKCS12_SAFEBAG.adoc[PKCS12&lowbar;SAFEBAG]* bag,
    int nid,
    int type,
    unsigned char const* bytes,
    int len);
----

== Return Value

1 on success, 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *bag*
| SafeBag to modify&period;
| *nid*
| NID of the attribute type&period;
| *type*
| ASN&period;1 type of the attribute value&period;
| *bytes*
| Attribute value octets&period;
| *len*
| Length of `bytes&period;`
|===


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