1=pod
2
3=head1 NAME
4
5X509_REQ_get_extensions,
6X509_REQ_add_extensions, X509_REQ_add_extensions_nid
7- handle X.509 extension attributes of a CSR
8
9=head1 SYNOPSIS
10
11 #include <openssl/x509.h>
12
13 STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(const X509_REQ *req);
14 int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *exts);
15 int X509_REQ_add_extensions_nid(X509_REQ *req,
16                                 const STACK_OF(X509_EXTENSION) *exts, int nid);
17
18=head1 DESCRIPTION
19
20X509_REQ_get_extensions() returns the first list of X.509 extensions
21found in the attributes of I<req>.
22The returned list is empty if there are no such extensions in I<req>.
23The caller is responsible for freeing the list obtained.
24
25X509_REQ_add_extensions_nid() adds to I<req> a list of X.509 extensions I<exts>,
26using I<nid> to identify the extensions attribute.
27I<req> is unchanged if I<exts> is NULL or an empty list.
28This function may be called more than once on the same I<req> and I<nid>.
29In such case any previous extensions are augmented, where an extension to be
30added that has the same OID as a pre-existing one replaces this earlier one.
31
32X509_REQ_add_extensions() is like X509_REQ_add_extensions_nid()
33except that the default B<NID_ext_req> is used.
34
35=head1 RETURN VALUES
36
37X509_REQ_get_extensions() returns a pointer to B<STACK_OF(X509_EXTENSION)>
38or NULL on error.
39
40X509_REQ_add_extensions() and X509_REQ_add_extensions_nid()
41return 1 on success, 0 on error.
42
43=head1 COPYRIGHT
44
45Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
46
47Licensed under the Apache License 2.0 (the "License").  You may not use
48this file except in compliance with the License.  You can obtain a copy
49in the file LICENSE in the source distribution or at
50L<https://www.openssl.org/source/license.html>.
51
52=cut
53