X509_REQ_ADD1_ATTR(3)
π NAME π
okay so bestie, welcome to X509_REQ_ADD1_ATTR(3) β the manual page for X.501 Attributes of PKCS#10 certification requests. It covers this whole squad: X509_REQ_add1_attr, X509_REQ_add1_attr_by_OBJ, X509_REQ_add1_attr_by_NID, X509_REQ_add1_attr_by_txt, X509_REQ_delete_attr, X509_REQ_get_attr, X509_REQ_get_attr_count, X509_REQ_get_attr_by_OBJ, and X509_REQ_get_attr_by_NID. Yes queen, thatβs all of them. π
β¨ SYNOPSIS β¨
library βlibcryptoβ #include <openssl/x509.h>
int
X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
int
X509_REQ_add1_attr_by_OBJ(X509_REQ *req, const ASN1_OBJECT *obj,
int type, const unsigned char *data, int len);
int
X509_REQ_add1_attr_by_NID(X509_REQ *req, int nid, int type,
const unsigned char *data, int len);
int
X509_REQ_add1_attr_by_txt(X509_REQ *req, const char *name, int type,
const unsigned char *data, int len);
X509_ATTRIBUTE *
X509_REQ_delete_attr(X509_REQ *req, int index);
X509_ATTRIBUTE *
X509_REQ_get_attr(const X509_REQ *req, int index);
int
X509_REQ_get_attr_count(const X509_REQ *req);
int
X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj,
int start_after);
int
X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int start_after);
πΈ DESCRIPTION πΈ
These functions support associating an array of X.501 Attributes with a PKCS#10 certification request. Itβs giving βletβs attach some extra lore to this requestβ energy. π
X509_REQ_add1_attr()β appends a deep copy ofattr, allocating a new array if necessary.X509_REQ_add1_attr_by_OBJ(),X509_REQ_add1_attr_by_NID(), andX509_REQ_add1_attr_by_txt()β create a new X.501 Attribute object usingX509_ATTRIBUTE_create_by_OBJ(3),X509_ATTRIBUTE_create_by_NID(3), orX509_ATTRIBUTE_create_by_txt(3), respectively, allocating a new array if necessary.X509_REQ_delete_attr()β deletes the attribute with the zero-based index.X509_REQ_get_attr()β returns the attribute with the zero-based index.X509_REQ_get_attr_count()β returns the number of attributes currently associated withreq.X509_REQ_get_attr_by_OBJ()andX509_REQ_get_attr_by_NID()β search for an attribute of the typeobjornid.
π RETURN VALUES π
X509_REQ_add1_attr(),X509_REQ_add1_attr_by_OBJ(),X509_REQ_add1_attr_by_NID(), andX509_REQ_add1_attr_by_txt()β return1for success or0for failure.X509_REQ_delete_attr()andX509_REQ_get_attr()β return the deleted or requested attribute, orNULLif the requested index is negative or greater than or equal to the current number of attributes associated withreq.X509_REQ_get_attr_count()β returns the current number of attributes.X509_REQ_get_attr_by_OBJ()andX509_REQ_get_attr_by_NID()β return the index of the first attribute that has an index greater thanstart_afterand a type matchingobjornid, respectively, or-1on failure. In addition,X509_REQ_get_attr_by_NID()returns-2ifOBJ_nid2obj(3)fails on the requestednid.
π¦ SEE ALSO π¦
π HISTORY π
These functions first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7. iconic behavior, honestly. β
source vibe: Debian, dated June 8, 2025, for the X509_REQ_ADD1_ATTR(3) page β mwah π
π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms