xref: /freebsd-src/crypto/openssl/doc/man3/X509_REQ_get_extensions.pod (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1*e0c4386eSCy Schubert=pod
2*e0c4386eSCy Schubert
3*e0c4386eSCy Schubert=head1 NAME
4*e0c4386eSCy Schubert
5*e0c4386eSCy SchubertX509_REQ_get_extensions,
6*e0c4386eSCy SchubertX509_REQ_add_extensions, X509_REQ_add_extensions_nid
7*e0c4386eSCy Schubert- handle X.509 extension attributes of a CSR
8*e0c4386eSCy Schubert
9*e0c4386eSCy Schubert=head1 SYNOPSIS
10*e0c4386eSCy Schubert
11*e0c4386eSCy Schubert #include <openssl/x509.h>
12*e0c4386eSCy Schubert
13*e0c4386eSCy Schubert STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
14*e0c4386eSCy Schubert int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *exts);
15*e0c4386eSCy Schubert int X509_REQ_add_extensions_nid(X509_REQ *req,
16*e0c4386eSCy Schubert                                 const STACK_OF(X509_EXTENSION) *exts, int nid);
17*e0c4386eSCy Schubert
18*e0c4386eSCy Schubert=head1 DESCRIPTION
19*e0c4386eSCy Schubert
20*e0c4386eSCy SchubertX509_REQ_get_extensions() returns the first list of X.509 extensions
21*e0c4386eSCy Schubertfound in the attributes of I<req>.
22*e0c4386eSCy SchubertThe returned list is empty if there are no such extensions in I<req>.
23*e0c4386eSCy SchubertThe caller is responsible for freeing the list obtained.
24*e0c4386eSCy Schubert
25*e0c4386eSCy SchubertX509_REQ_add_extensions() adds to I<req> a list of X.509 extensions I<exts>,
26*e0c4386eSCy Schubertwhich must not be NULL, using the default B<NID_ext_req>.
27*e0c4386eSCy SchubertThis function must not be called more than once on the same I<req>.
28*e0c4386eSCy Schubert
29*e0c4386eSCy SchubertX509_REQ_add_extensions_nid() is like X509_REQ_add_extensions()
30*e0c4386eSCy Schubertexcept that I<nid> is used to identify the extensions attribute.
31*e0c4386eSCy SchubertThis function must not be called more than once with the same I<req> and I<nid>.
32*e0c4386eSCy Schubert
33*e0c4386eSCy Schubert=head1 RETURN VALUES
34*e0c4386eSCy Schubert
35*e0c4386eSCy SchubertX509_REQ_get_extensions() returns a pointer to B<STACK_OF(X509_EXTENSION)>
36*e0c4386eSCy Schubertor NULL on error.
37*e0c4386eSCy Schubert
38*e0c4386eSCy SchubertX509_REQ_add_extensions() and X509_REQ_add_extensions_nid()
39*e0c4386eSCy Schubertreturn 1 on success, 0 on error.
40*e0c4386eSCy Schubert
41*e0c4386eSCy Schubert=head1 COPYRIGHT
42*e0c4386eSCy Schubert
43*e0c4386eSCy SchubertCopyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
44*e0c4386eSCy Schubert
45*e0c4386eSCy SchubertLicensed under the Apache License 2.0 (the "License").  You may not use
46*e0c4386eSCy Schubertthis file except in compliance with the License.  You can obtain a copy
47*e0c4386eSCy Schubertin the file LICENSE in the source distribution or at
48*e0c4386eSCy SchubertL<https://www.openssl.org/source/license.html>.
49*e0c4386eSCy Schubert
50*e0c4386eSCy Schubert=cut
51