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