1=pod
2
3=head1 NAME
4
5OSSL_IETF_ATTR_SYNTAX,
6OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority,
7OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority,
8OSSL_IETF_ATTR_SYNTAX_get_value_num,
9OSSL_IETF_ATTR_SYNTAX_get0_value,
10OSSL_IETF_ATTR_SYNTAX_add1_value
11- Accessors and setters for OSSL_IETF_ATTR_SYNTAX
12
13=head1 SYNOPSIS
14
15 #include <openssl/x509_acert.h>
16
17 typedef struct OSSL_IETF_ATTR_SYNTAX_st OSSL_IETF_ATTR_SYNTAX;
18
19 const GENERAL_NAMES *
20 OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority(const OSSL_IETF_ATTR_SYNTAX *a);
21 void OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority(OSSL_IETF_ATTR_SYNTAX *a,
22                                                 GENERAL_NAMES *names);
23
24 int OSSL_IETF_ATTR_SYNTAX_get_value_num(const OSSL_IETF_ATTR_SYNTAX *a);
25 void *OSSL_IETF_ATTR_SYNTAX_get0_value(const OSSL_IETF_ATTR_SYNTAX *a,
26                                        int ind, int *type);
27 int OSSL_IETF_ATTR_SYNTAX_add1_value(OSSL_IETF_ATTR_SYNTAX *a, int type,
28                                      void *data);
29
30=head1 DESCRIPTION
31
32B<OSSL_IETF_ATTR_SYNTAX> is an opaque structure that represents the
33IetfAttrSyntax type defined in RFC 5755 (Section 4.4) for use
34as an AttributeValue.
35
36OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority() and OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority()
37get and set the policyAuthority field of the structure. Both routines act on
38internal pointers of the structure and must not be freed by the application.
39
40An B<OSSL_IETF_ATTR_SYNTAX> object also holds a sequence of values.
41OSSL_IETF_ATTR_SYNTAX_get_value_num() returns the number of values in the
42sequence.  OSSL_IETF_ATTR_SYNTAX_add1_value(), adds a copy of I<data> of a specified
43I<type> to the sequence.  The caller should free the I<data> after use.
44
45OSSL_IETF_ATTR_SYNTAX_get0_value() will return the value and a specific index I<ind>
46in the sequence or NULL on error.  If I<type> is not NULL, the type of the
47value will be written to this location.
48
49The I<type> of the values stored in the B<OSSL_IETF_ATTR_SYNTAX> value sequence is
50one of the following:
51
52=over 4
53
54=item OSSL_IETFAS_OCTETS
55
56A pointer to an ASN1_OCTET_STRING
57
58=item OSSL_IETFAS_OID
59
60A pointer to an ASN1_OBJECT
61
62=item OSSL_IETFAS_STRING
63
64A pointer to an ASN1_UTF8STRING
65
66=back
67
68=head1 RETURN VALUES
69
70OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority() returns an pointer to a
71B<GENERAL_NAMES> structure or B<NULL> if the policy authority has not been
72set.
73
74OSSL_IETF_ATTR_SYNTAX_get_value_num() returns the number of entries in the value
75sequence or -1 on error.
76
77OSSL_IETF_ATTR_SYNTAX_get0_value() returns a pointer to the value at the given index
78or NULL if the index is out of range.
79
80OSSL_IETF_ATTR_SYNTAX_add1_value() returns 1 on success and 0 on failure.
81
82=head1 HISTORY
83
84OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority(), OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority(),
85OSSL_IETF_ATTR_SYNTAX_get_value_num(), OSSL_IETF_ATTR_SYNTAX_get0_value(), and
86OSSL_IETF_ATTR_SYNTAX_add1_value() were added in OpenSSL 3.4.
87
88=head1 COPYRIGHT
89
90Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
91
92Licensed under the Apache License 2.0 (the "License").  You may not use
93this file except in compliance with the License.  You can obtain a copy
94in the file LICENSE in the source distribution or at
95L<https://www.openssl.org/source/license.html>.
96
97=cut
98