[#PKCS8_pkey_add1_attr_by_NID]
= PKCS8&lowbar;pkey&lowbar;add1&lowbar;attr&lowbar;by&lowbar;NID
:mrdocs:

Append an attribute identified by NID `nid` to a PKCS&num;8 private key info&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS8&lowbar;pkey&lowbar;add1&lowbar;attr&lowbar;by&lowbar;NID(
    xref:PKCS8_PRIV_KEY_INFO.adoc[PKCS8&lowbar;PRIV&lowbar;KEY&lowbar;INFO]* p8,
    int nid,
    int type,
    unsigned char const* bytes,
    int len);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *p8*
| PKCS&num;8 structure receiving the attribute&period;
| *nid*
| Attribute type NID&period;
| *type*
| ASN&period;1 type of the attribute data&period;
| *bytes*
| Attribute value bytes&period;
| *len*
| Length of `bytes&period;`
|===


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