X509_ATTRIBUTE.3ossl 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .nr rF 0
  58. .if \n(.g .if rF .nr rF 1
  59. .if (\n(rF:(\n(.g==0)) \{\
  60. . if \nF \{\
  61. . de IX
  62. . tm Index:\\$1\t\\n%\t"\\$2"
  63. ..
  64. . if !\nF==2 \{\
  65. . nr % 0
  66. . nr F 2
  67. . \}
  68. . \}
  69. .\}
  70. .rr rF
  71. .\"
  72. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  73. .\" Fear. Run. Save yourself. No user-serviceable parts.
  74. . \" fudge factors for nroff and troff
  75. .if n \{\
  76. . ds #H 0
  77. . ds #V .8m
  78. . ds #F .3m
  79. . ds #[ \f1
  80. . ds #] \fP
  81. .\}
  82. .if t \{\
  83. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  84. . ds #V .6m
  85. . ds #F 0
  86. . ds #[ \&
  87. . ds #] \&
  88. .\}
  89. . \" simple accents for nroff and troff
  90. .if n \{\
  91. . ds ' \&
  92. . ds ` \&
  93. . ds ^ \&
  94. . ds , \&
  95. . ds ~ ~
  96. . ds /
  97. .\}
  98. .if t \{\
  99. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  100. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  101. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  102. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  103. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  104. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  105. .\}
  106. . \" troff and (daisy-wheel) nroff accents
  107. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  108. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  109. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  110. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  111. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  112. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  113. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  114. .ds ae a\h'-(\w'a'u*4/10)'e
  115. .ds Ae A\h'-(\w'A'u*4/10)'E
  116. . \" corrections for vroff
  117. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  118. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  119. . \" for low resolution devices (crt and lpr)
  120. .if \n(.H>23 .if \n(.V>19 \
  121. \{\
  122. . ds : e
  123. . ds 8 ss
  124. . ds o a
  125. . ds d- d\h'-1'\(ga
  126. . ds D- D\h'-1'\(hy
  127. . ds th \o'bp'
  128. . ds Th \o'LP'
  129. . ds ae ae
  130. . ds Ae AE
  131. .\}
  132. .rm #[ #] #H #V #F C
  133. .\" ========================================================================
  134. .\"
  135. .IX Title "X509_ATTRIBUTE 3ossl"
  136. .TH X509_ATTRIBUTE 3ossl "2024-09-03" "3.3.2" "OpenSSL"
  137. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  138. .\" way too many mistakes in technical documents.
  139. .if n .ad l
  140. .nh
  141. .SH "NAME"
  142. X509_ATTRIBUTE, X509at_get_attr,
  143. X509at_get_attr_count, X509at_get_attr_by_NID, X509at_get_attr_by_OBJ,
  144. X509at_delete_attr,
  145. X509at_add1_attr,
  146. X509at_add1_attr_by_OBJ, X509at_add1_attr_by_NID, X509at_add1_attr_by_txt,
  147. X509at_get0_data_by_OBJ,
  148. X509_ATTRIBUTE_create, X509_ATTRIBUTE_create_by_NID,
  149. X509_ATTRIBUTE_create_by_OBJ, X509_ATTRIBUTE_create_by_txt,
  150. X509_ATTRIBUTE_set1_object, X509_ATTRIBUTE_set1_data,
  151. X509_ATTRIBUTE_count,
  152. X509_ATTRIBUTE_get0_data, X509_ATTRIBUTE_get0_object, X509_ATTRIBUTE_get0_type
  153. \&\- X509 attribute functions
  154. .SH "SYNOPSIS"
  155. .IX Header "SYNOPSIS"
  156. .Vb 1
  157. \& #include <openssl/x509.h>
  158. \&
  159. \& typedef struct x509_attributes_st X509_ATTRIBUTE;
  160. \&
  161. \& int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
  162. \& int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
  163. \& int lastpos);
  164. \& int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
  165. \& const ASN1_OBJECT *obj, int lastpos);
  166. \& X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
  167. \& X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
  168. \& STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
  169. \& X509_ATTRIBUTE *attr);
  170. \& STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)
  171. \& **x, const ASN1_OBJECT *obj,
  172. \& int type,
  173. \& const unsigned char *bytes,
  174. \& int len);
  175. \& STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)
  176. \& **x, int nid, int type,
  177. \& const unsigned char *bytes,
  178. \& int len);
  179. \& STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
  180. \& **x, const char *attrname,
  181. \& int type,
  182. \& const unsigned char *bytes,
  183. \& int len);
  184. \& void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x,
  185. \& const ASN1_OBJECT *obj, int lastpos, int type);
  186. \& X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
  187. \& X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
  188. \& int atrtype, const void *data,
  189. \& int len);
  190. \& X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
  191. \& const ASN1_OBJECT *obj,
  192. \& int atrtype, const void *data,
  193. \& int len);
  194. \& X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
  195. \& const char *atrname, int type,
  196. \& const unsigned char *bytes,
  197. \& int len);
  198. \& int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
  199. \& int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
  200. \& const void *data, int len);
  201. \& void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype,
  202. \& void *data);
  203. \& int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr);
  204. \& ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
  205. \& ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
  206. .Ve
  207. .SH "DESCRIPTION"
  208. .IX Header "DESCRIPTION"
  209. \&\fBX509_ATTRIBUTE\fR objects are used by many standards including X509, X509_REQ,
  210. \&\s-1PKCS12, PKCS8, PKCS7\s0 and \s-1CMS.\s0
  211. .PP
  212. The \fBX509_ATTRIBUTE\fR object is used to represent the \s-1ASN.1\s0 Attribute as defined
  213. in \s-1RFC 5280,\s0 i.e.
  214. .PP
  215. .Vb 3
  216. \& Attribute ::= SEQUENCE {
  217. \& type AttributeType,
  218. \& values SET OF AttributeValue }
  219. \&
  220. \& AttributeType ::= OBJECT IDENTIFIER
  221. \& AttributeValue ::= ANY \-\- DEFINED BY AttributeType
  222. .Ve
  223. .PP
  224. For example \s-1CMS\s0 defines the signing-time attribute as:
  225. .PP
  226. .Vb 2
  227. \& id\-signingTime OBJECT IDENTIFIER ::= { iso(1) member\-body(2)
  228. \& us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 }
  229. \&
  230. \& SigningTime ::= Time
  231. \&
  232. \& Time ::= CHOICE {
  233. \& utcTime UTCTime,
  234. \& generalizedTime GeneralizedTime }
  235. .Ve
  236. .PP
  237. In OpenSSL \fBAttributeType\fR maps to an \fB\s-1ASN1_OBJECT\s0\fR object
  238. and \fBAttributeValue\fR maps to a list of \fB\s-1ASN1_TYPE\s0\fR objects.
  239. .PP
  240. The following functions are used for \fBX509_ATTRIBUTE\fR objects.
  241. .PP
  242. \&\fBX509at_get_attr_by_OBJ()\fR finds the location of the first matching object \fIobj\fR
  243. in a list of attributes \fIsk\fR. The search starts at the position after \fIlastpos\fR.
  244. If the returned value is positive then it can be used on the next call to
  245. \&\fBX509at_get_attr_by_OBJ()\fR as the value of \fIlastpos\fR in order to iterate through
  246. the remaining attributes. \fIlastpos\fR can be set to any negative value on the
  247. first call, in order to start searching from the start of the list.
  248. .PP
  249. \&\fBX509at_get_attr_by_NID()\fR is similar to \fBX509at_get_attr_by_OBJ()\fR except that it
  250. passes the numerical identifier (\s-1NID\s0) \fInid\fR associated with the object.
  251. See <openssl/obj_mac.h> for a list of NID_*.
  252. .PP
  253. \&\fBX509at_get_attr()\fR returns the \fBX509_ATTRIBUTE\fR object at index \fIloc\fR in the
  254. list of attributes \fIx\fR. \fIloc\fR should be in the range from 0 to
  255. \&\fBX509at_get_attr_count()\fR \- 1.
  256. .PP
  257. \&\fBX509at_delete_attr()\fR removes the \fBX509_ATTRIBUTE\fR object at index \fIloc\fR in
  258. the list of attributes \fIx\fR.
  259. .PP
  260. \&\fBX509at_add1_attr()\fR pushes a copy of the passed in \fBX509_ATTRIBUTE\fR object
  261. to the list \fIx\fR.
  262. Both \fIx\fR and \fIattr\fR must be non \s-1NULL\s0 or an error will occur.
  263. If \fI*x\fR is \s-1NULL\s0 then a new list is created, otherwise it uses the
  264. passed in list. An error will occur if an existing attribute (with the same
  265. attribute type) already exists in the attribute list.
  266. .PP
  267. \&\fBX509at_add1_attr_by_OBJ()\fR creates a new \fBX509_ATTRIBUTE\fR using
  268. \&\fBX509_ATTRIBUTE_set1_object()\fR and \fBX509_ATTRIBUTE_set1_data()\fR to assign a new
  269. \&\fIobj\fR with type \fItype\fR and data \fIbytes\fR of length \fIlen\fR and then pushes it
  270. to the attribute list \fIx\fR. Both \fIx\fR and \fIattr\fR must be non \s-1NULL\s0 or an error
  271. will occur. If \fI*x\fR is \s-1NULL\s0 then a new attribute list is created. If \fIobj\fR
  272. already exists in the attribute list then an error occurs.
  273. .PP
  274. \&\fBX509at_add1_attr_by_NID()\fR is similar to \fBX509at_add1_attr_by_OBJ()\fR except that it
  275. passes the numerical identifier (\s-1NID\s0) \fInid\fR associated with the object.
  276. See <openssl/obj_mac.h> for a list of NID_*.
  277. .PP
  278. \&\fBX509at_add1_attr_by_txt()\fR is similar to \fBX509at_add1_attr_by_OBJ()\fR except that it
  279. passes a name \fIattrname\fR associated with the object.
  280. See <openssl/obj_mac.h> for a list of SN_* names.
  281. .PP
  282. \&\fBX509_ATTRIBUTE_set1_object()\fR assigns a \fB\s-1ASN1_OBJECT\s0\fR \fIobj\fR
  283. to the attribute \fIattr\fR. If \fIattr\fR contained an existing \fB\s-1ASN1_OBJECT\s0\fR then
  284. it is freed. An error occurs if either \fIattr\fR or \fIobj\fR are \s-1NULL,\s0 or if
  285. the passed in \fIobj\fR cannot be duplicated.
  286. .PP
  287. \&\fBX509_ATTRIBUTE_set1_data()\fR pushes a new \fB\s-1ASN1_TYPE\s0\fR object onto the \fIattr\fR
  288. attributes list. The new object is assigned a copy of the data in \fIdata\fR of
  289. size \fIlen\fR.
  290. If \fIattrtype\fR has flag \fI\s-1MBSTRING_FLAG\s0\fR set then a table lookup using the
  291. \&\fIattr\fR attributes \s-1NID\s0 is used to set an \fB\s-1ASN1_STRING\s0\fR using
  292. \&\fBASN1_STRING_set_by_NID()\fR, and the passed in \fIdata\fR must be in the format
  293. required for that object type or an error will occur.
  294. If \fIlen\fR is not \-1 then internally \fBASN1_STRING_type_new()\fR is
  295. used with the passed in \fIattrtype\fR.
  296. If \fIattrtype\fR is 0 the call does nothing except return 1.
  297. .PP
  298. \&\fBX509_ATTRIBUTE_create()\fR creates a new \fBX509_ATTRIBUTE\fR using the \fInid\fR
  299. to set the \fB\s-1ASN1_OBJECT\s0\fR \s-1OID\s0 and the \fIatrtype\fR and \fIvalue\fR to set the
  300. \&\fB\s-1ASN1_TYPE\s0\fR.
  301. .PP
  302. \&\fBX509_ATTRIBUTE_create_by_OBJ()\fR uses \fBX509_ATTRIBUTE_set1_object()\fR and
  303. \&\fBX509_ATTRIBUTE_set1_data()\fR to assign a new \fIobj\fR with type \fIatrtype\fR and
  304. data \fIdata\fR of length \fIlen\fR. If the passed in attribute \fIattr\fR \s-1OR\s0 \fI*attr\fR is
  305. \&\s-1NULL\s0 then a new \fBX509_ATTRIBUTE\fR will be returned, otherwise the passed in
  306. \&\fBX509_ATTRIBUTE\fR is used. Note that the \s-1ASN1_OBJECT\s0 \fIobj\fR is pushed onto the
  307. attributes existing list of objects, which could be an issue if the attributes
  308. <\s-1ASN1_OBJECT\s0> was different.
  309. .PP
  310. \&\fBX509_ATTRIBUTE_create_by_NID()\fR is similar to \fBX509_ATTRIBUTE_create_by_OBJ()\fR
  311. except that it passes the numerical identifier (\s-1NID\s0) \fInid\fR associated with the
  312. object. See <openssl/obj_mac.h> for a list of NID_*.
  313. .PP
  314. \&\fBX509_ATTRIBUTE_create_by_txt()\fR is similar to \fBX509_ATTRIBUTE_create_by_OBJ()\fR
  315. except that it passes a name \fIatrname\fR associated with the
  316. object. See <openssl/obj_mac.h> for a list of SN_* names.
  317. .PP
  318. \&\fBX509_ATTRIBUTE_count()\fR returns the number of \fB\s-1ASN1_TYPE\s0\fR objects in an
  319. attribute \fIattr\fR.
  320. .PP
  321. \&\fBX509_ATTRIBUTE_get0_type()\fR returns the \fB\s-1ASN1_TYPE\s0\fR object at index \fIidx\fR in
  322. the attribute list \fIattr\fR. \fIidx\fR should be in the
  323. range of 0 to \fBX509_ATTRIBUTE_count()\fR \- 1 or an error will occur.
  324. .PP
  325. \&\fBX509_ATTRIBUTE_get0_data()\fR returns the data of an \fB\s-1ASN1_TYPE\s0\fR object at
  326. index \fIidx\fR in the attribute \fIattr\fR. \fIdata\fR is unused and can be set to \s-1NULL.\s0
  327. An error will occur if the attribute type \fIatrtype\fR does not match the type of
  328. the \fB\s-1ASN1_TYPE\s0\fR object at index \fIidx\fR \s-1OR\s0 if \fIatrtype\fR is either
  329. \&\fBV_ASN1_BOOLEAN\fR or \fBV_ASN1_NULL\fR \s-1OR\s0 if the \fIidx\fR is not in the
  330. range 0 to \fBX509_ATTRIBUTE_count()\fR \- 1.
  331. .PP
  332. \&\fBX509at_get0_data_by_OBJ()\fR finds the first attribute in an attribute list \fIx\fR
  333. that matches the \fIobj\fR starting at index \fIlastpos\fR and returns the data
  334. retrieved from the found attributes first \fB\s-1ASN1_TYPE\s0\fR object. An error will
  335. occur if the attribute type \fItype\fR does not match the type of the \fB\s-1ASN1_TYPE\s0\fR
  336. object \s-1OR\s0 if \fItype\fR is either \fBV_ASN1_BOOLEAN\fR or \fBV_ASN1_NULL\fR \s-1OR\s0 the
  337. attribute is not found.
  338. If \fIlastpos\fR is less than \-1 then an error will occur if there are multiple
  339. objects in the list \fIx\fR that match \fIobj\fR.
  340. If \fIlastpos\fR is less than \-2 then an error will occur if there is more than
  341. one \fB\s-1ASN1_TYPE\s0\fR object in the found attribute.
  342. .SH "RETURN VALUES"
  343. .IX Header "RETURN VALUES"
  344. \&\fBX509at_get_attr_count()\fR returns the number of attributes in the list \fIx\fR or \-1
  345. if \fIx\fR is \s-1NULL.\s0
  346. .PP
  347. \&\fBX509at_get_attr_by_OBJ()\fR returns \-1 if either the list is empty \s-1OR\s0 the object
  348. is not found, otherwise it returns the location of the object in the list.
  349. .PP
  350. \&\fBX509at_get_attr_by_NID()\fR is similar to \fBX509at_get_attr_by_OBJ()\fR, except that
  351. it returns \-2 if the \fInid\fR is not known by OpenSSL.
  352. .PP
  353. \&\fBX509at_get_attr()\fR returns either an \fBX509_ATTRIBUTE\fR or \s-1NULL\s0 if there is a error.
  354. .PP
  355. \&\fBX509at_delete_attr()\fR returns either the removed \fBX509_ATTRIBUTE\fR or \s-1NULL\s0 if
  356. there is a error.
  357. .PP
  358. \&\fBX509_ATTRIBUTE_count()\fR returns \-1 on error, otherwise it returns the number
  359. of \fB\s-1ASN1_TYPE\s0\fR elements.
  360. .PP
  361. \&\fBX509_ATTRIBUTE_get0_type()\fR returns \s-1NULL\s0 on error, otherwise it returns a
  362. \&\fB\s-1ASN1_TYPE\s0\fR object.
  363. .PP
  364. \&\fBX509_ATTRIBUTE_get0_data()\fR returns \s-1NULL\s0 if an error occurs,
  365. otherwise it returns the data associated with an \fB\s-1ASN1_TYPE\s0\fR object.
  366. .PP
  367. \&\fBX509_ATTRIBUTE_set1_object()\fR and \fBX509_ATTRIBUTE_set1_data()\fR returns 1 on
  368. success, or 0 otherwise.
  369. .PP
  370. \&\fBX509_ATTRIBUTE_create()\fR, \fBX509_ATTRIBUTE_create_by_OBJ()\fR,
  371. \&\fBX509_ATTRIBUTE_create_by_NID()\fR and \fBX509_ATTRIBUTE_create_by_txt()\fR return either
  372. a \fBX509_ATTRIBUTE\fR on success, or \s-1NULL\s0 if there is a error.
  373. .PP
  374. \&\fBX509at_add1_attr()\fR, \fBX509at_add1_attr_by_OBJ()\fR, \fBX509at_add1_attr_by_NID()\fR and
  375. \&\fBX509at_add1_attr_by_txt()\fR return \s-1NULL\s0 on error, otherwise they return a list
  376. of \fBX509_ATTRIBUTE\fR.
  377. .PP
  378. \&\fBX509at_get0_data_by_OBJ()\fR returns the data retrieved from the found attributes
  379. first \fB\s-1ASN1_TYPE\s0\fR object, or \s-1NULL\s0 if an error occurs.
  380. .SH "SEE ALSO"
  381. .IX Header "SEE ALSO"
  382. \&\fBASN1_TYPE_get\fR\|(3),
  383. \&\fBASN1_INTEGER_get\fR\|(3),
  384. \&\fBASN1_ENUMERATED_get\fR\|(3),
  385. \&\fBASN1_STRING_get0_data\fR\|(3),
  386. \&\fBASN1_STRING_length\fR\|(3),
  387. \&\fBASN1_STRING_type\fR\|(3),
  388. \&\fBX509_REQ_get_attr\fR\|(3),
  389. \&\fBEVP_PKEY_get_attr\fR\|(3),
  390. \&\fBCMS_signed_get_attr\fR\|(3),
  391. \&\fBPKCS8_pkey_get0_attrs\fR\|(3),
  392. .SH "COPYRIGHT"
  393. .IX Header "COPYRIGHT"
  394. Copyright 2023\-2024 The OpenSSL Project Authors. All Rights Reserved.
  395. .PP
  396. Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
  397. this file except in compliance with the License. You can obtain a copy
  398. in the file \s-1LICENSE\s0 in the source distribution or at
  399. <https://www.openssl.org/source/license.html>.