xref: /freebsd/crypto/openssl/doc/man3/X509_ACERT_add1_attr.pod (revision e7be843b4a162e68651d3911f0357ed464915629)
1*e7be843bSPierre Pronchery=pod
2*e7be843bSPierre Pronchery
3*e7be843bSPierre Pronchery=head1 NAME
4*e7be843bSPierre Pronchery
5*e7be843bSPierre ProncheryX509_ACERT_add1_attr,
6*e7be843bSPierre ProncheryX509_ACERT_add1_attr_by_NID,
7*e7be843bSPierre ProncheryX509_ACERT_add1_attr_by_OBJ,
8*e7be843bSPierre ProncheryX509_ACERT_add1_attr_by_txt,
9*e7be843bSPierre ProncheryX509_ACERT_delete_attr
10*e7be843bSPierre Pronchery- X509_ACERT attribute functions
11*e7be843bSPierre Pronchery
12*e7be843bSPierre Pronchery=head1 SYNOPSIS
13*e7be843bSPierre Pronchery
14*e7be843bSPierre Pronchery #include <openssl/x509_acert.h>
15*e7be843bSPierre Pronchery
16*e7be843bSPierre Pronchery int X509_ACERT_add1_attr(X509_ACERT *x, X509_ATTRIBUTE *attr);
17*e7be843bSPierre Pronchery int X509_ACERT_add1_attr_by_NID(X509_ACERT *x, int nid, int type,
18*e7be843bSPierre Pronchery                                 const void *bytes, int len);
19*e7be843bSPierre Pronchery int X509_ACERT_add1_attr_by_OBJ(X509_ACERT *x, const ASN1_OBJECT *obj,
20*e7be843bSPierre Pronchery                                 int type, const void *bytes, int len);
21*e7be843bSPierre Pronchery int X509_ACERT_add1_attr_by_txt(X509_ACERT *x, const char *attrname, int type,
22*e7be843bSPierre Pronchery                                 const unsigned char *bytes, int len);
23*e7be843bSPierre Pronchery X509_ATTRIBUTE *X509_ACERT_delete_attr(X509_ACERT *x, int loc);
24*e7be843bSPierre Pronchery
25*e7be843bSPierre Pronchery=head1 DESCRIPTION
26*e7be843bSPierre Pronchery
27*e7be843bSPierre ProncheryX509_ACERT_add1_attr() adds a constructed X509_ATTRIBUTE B<attr> to the
28*e7be843bSPierre Proncheryexisting X509_ACERT structure B<x>.
29*e7be843bSPierre Pronchery
30*e7be843bSPierre ProncheryX509_ACERT_add1_attr_by_NID() and X509_ACERT_add1_attr_by_OBJ()
31*e7be843bSPierre Proncheryadd an attribute of type I<nid> or I<obj> with a value of ASN1
32*e7be843bSPierre Proncherytype I<type> constructed using I<len> bytes from I<bytes>.
33*e7be843bSPierre Pronchery
34*e7be843bSPierre ProncheryX509_ACERT_add1_attr_by_txt() adds an attribute of type I<attrname> with a value of
35*e7be843bSPierre ProncheryASN1 type I<type> constructed using I<len> bytes from I<bytes>.
36*e7be843bSPierre Pronchery
37*e7be843bSPierre ProncheryX509_ACERT_delete_attr() will delete the I<loc>th attribute from I<x> and
38*e7be843bSPierre Proncheryreturn a pointer to it or NULL if there are fewer than I<loc> attributes
39*e7be843bSPierre Proncherycontained in I<x>.
40*e7be843bSPierre Pronchery
41*e7be843bSPierre Pronchery=head1 RETURN VALUES
42*e7be843bSPierre Pronchery
43*e7be843bSPierre ProncheryX509_ACERT_add1_attr(), X509_ACERT_add1_attr_by_NID(), and
44*e7be843bSPierre ProncheryX509_ACERT_add1_attr_by_OBJ() return 1 for success and 0 for failure.
45*e7be843bSPierre Pronchery
46*e7be843bSPierre ProncheryX509_ACERT_delete_attr() returns a B<X509_ATTRIBUTE> pointer on
47*e7be843bSPierre Proncherysuccess or NULL on failure.
48*e7be843bSPierre Pronchery
49*e7be843bSPierre Pronchery=head1 SEE ALSO
50*e7be843bSPierre Pronchery
51*e7be843bSPierre ProncheryL<X509_ACERT_get_attr_count(3)>
52*e7be843bSPierre Pronchery
53*e7be843bSPierre Pronchery=head1 HISTORY
54*e7be843bSPierre Pronchery
55*e7be843bSPierre ProncheryX509_ACERT_add1_attr(), X509_ACERT_add1_attr_by_NID(), X509_ACERT_add1_attr_by_OBJ(),
56*e7be843bSPierre ProncheryX509_ACERT_add1_attr_by_txt() and X509_ACERT_delete_attr() were added in OpenSSL 3.4.
57*e7be843bSPierre Pronchery
58*e7be843bSPierre Pronchery=head1 COPYRIGHT
59*e7be843bSPierre Pronchery
60*e7be843bSPierre ProncheryCopyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
61*e7be843bSPierre Pronchery
62*e7be843bSPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
63*e7be843bSPierre Proncherythis file except in compliance with the License.  You can obtain a copy
64*e7be843bSPierre Proncheryin the file LICENSE in the source distribution or at
65*e7be843bSPierre ProncheryL<https://www.openssl.org/source/license.html>.
66*e7be843bSPierre Pronchery
67*e7be843bSPierre Pronchery=cut
68