[#PKCS8_pkey_add1_attr_by_OBJ]
= PKCS8&lowbar;pkey&lowbar;add1&lowbar;attr&lowbar;by&lowbar;OBJ
:mrdocs:

Append an attribute identified by `obj` 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;OBJ(
    xref:PKCS8_PRIV_KEY_INFO.adoc[PKCS8&lowbar;PRIV&lowbar;KEY&lowbar;INFO]* p8,
    xref:ASN1_OBJECT.adoc[ASN1&lowbar;OBJECT] const* obj,
    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;
| *obj*
| Attribute type OID&period;
| *type*
| ASN&period;1 string&sol;value type for `bytes` (V&lowbar;ASN1&lowbar;&ast;)&period;
| *bytes*
| Attribute value bytes&period;
| *len*
| Length of `bytes,` or &hyphen;1 if `bytes` is NUL&hyphen;terminated where applicable&period;
|===


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