xref: /openssl/doc/man3/X509_ACERT_get_attr.pod (revision 7ed6de99)
1=pod
2
3=head1 NAME
4
5X509_ACERT_get_attr,
6X509_ACERT_get_attr_by_NID,
7X509_ACERT_get_attr_by_OBJ,
8X509_ACERT_get_attr_count
9- Retrieve attributes from an X509_ACERT structure
10
11=head1 SYNOPSIS
12
13 #include <openssl/x509_acert.h>
14
15 X509_ATTRIBUTE *X509_ACERT_get_attr(const X509_ACERT *x, int loc);
16 int X509_ACERT_get_attr_by_NID(const X509_ACERT *x, int nid, int lastpos);
17 int X509_ACERT_get_attr_by_OBJ(const X509_ACERT *x, const ASN1_OBJECT *obj,
18                                int lastpos);
19 int X509_ACERT_get_attr_count(const X509_ACERT *x);
20
21=head1 DESCRIPTION
22
23X509_ACERT_get0_attr() retrieves the I<loc>th B<X509_ATTRIBUTE> from an
24B<X509_ACERT> I<x>.  X509_ACERT_get_attr_count() returns the total number
25of attributes in the B<X509_ACERT>.
26
27X509_ACERT_get_attr_by_NID() and X509_ACERT_get_attr_by_OBJ() retrieve the next
28attribute location matching I<nid> or I<obj> after I<lastpos>. I<lastpos>
29should initially be set to -1.
30If there are no more entries -1 is returned. If I<nid> is invalid
31(doesn't correspond to a valid OID) then -2 is returned.
32
33=head1 RETURN VALUES
34
35X509_ACERT_get0_attr() return a B<X509_ATTRIBUTE> from an attribute
36certificate, or NULL if the specified attribute is not found.
37
38X509_ACERT_get_attr_by_NID() and X509_ACERT_get_attr_by_OBJ() return
39the location of the next attribute requested or -1 if not found.
40X509_ACERT_get_attr_by_NID() can also return -2 if the supplied NID is invalid.
41
42X509_ACERT_get_attr_count() returns the number of attributes in the given
43attribute certificate.
44
45=head1 HISTORY
46
47X509_ACERT_get0_attr(), X509_ACERT_get_attr_by_NID(), X509_ACERT_get_attr_by_OBJ() and
48X509_ACERT_get_attr_count() were added in OpenSSL 3.4.
49
50=head1 COPYRIGHT
51
52Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
53
54Licensed under the Apache License 2.0 (the "License").  You may not use
55this file except in compliance with the License.  You can obtain a copy
56in the file LICENSE in the source distribution or at
57L<https://www.openssl.org/source/license.html>.
58
59=cut
60