summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_REQ_add_extensions.3
diff options
context:
space:
mode:
authorschwarze <>2021-10-27 14:54:07 +0000
committerschwarze <>2021-10-27 14:54:07 +0000
commitd384065832e8b720d1cbe4eac3eae438c8308cc1 (patch)
tree3924d44a77b3f007dc99eaa2e9d6445dc7cb337b /src/lib/libcrypto/man/X509_REQ_add_extensions.3
parentc38681fc92419b629f9b8e957e2ea0ced5305ac3 (diff)
downloadopenbsd-d384065832e8b720d1cbe4eac3eae438c8308cc1.tar.gz
openbsd-d384065832e8b720d1cbe4eac3eae438c8308cc1.tar.bz2
openbsd-d384065832e8b720d1cbe4eac3eae438c8308cc1.zip
new manual page X509_REQ_add_extensions(3)
documenting six functions for extensions in certification requests
Diffstat (limited to 'src/lib/libcrypto/man/X509_REQ_add_extensions.3')
-rw-r--r--src/lib/libcrypto/man/X509_REQ_add_extensions.3141
1 files changed, 141 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/X509_REQ_add_extensions.3 b/src/lib/libcrypto/man/X509_REQ_add_extensions.3
new file mode 100644
index 0000000000..8610edf8ca
--- /dev/null
+++ b/src/lib/libcrypto/man/X509_REQ_add_extensions.3
@@ -0,0 +1,141 @@
1.\" $OpenBSD: X509_REQ_add_extensions.3,v 1.1 2021/10/27 14:54:07 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: October 27 2021 $
18.Dt X509_REQ_ADD_EXTENSIONS 3
19.Os
20.Sh NAME
21.Nm X509_REQ_add_extensions ,
22.Nm X509_REQ_add_extensions_nid ,
23.Nm X509_REQ_get_extensions ,
24.Nm X509_REQ_set_extension_nids ,
25.Nm X509_REQ_get_extension_nids ,
26.Nm X509_REQ_extension_nid
27.Nd extensions in certification requests
28.Sh SYNOPSIS
29.In openssl/x509.h
30.Ft int
31.Fo X509_REQ_add_extensions
32.Fa "X509_REQ *req"
33.Fa "STACK_OF(X509_EXTENSION) *extensions"
34.Fc
35.Ft int
36.Fo X509_REQ_add_extensions_nid
37.Fa "X509_REQ *req"
38.Fa "STACK_OF(X509_EXTENSION) *extensions"
39.Fa "int nid"
40.Fc
41.Ft STACK_OF(X509_EXTENSION) *
42.Fn X509_REQ_get_extensions "X509_REQ *req"
43.Ft void
44.Fn X509_REQ_set_extension_nids "int *nids"
45.Ft int *
46.Fn X509_REQ_get_extension_nids void
47.Ft int
48.Fn X509_REQ_extension_nid "int nid"
49.Sh DESCRIPTION
50.Fn X509_REQ_add_extensions
51encodes the array of
52.Fa extensions
53using
54.Xr i2d_X509_EXTENSIONS 3
55and adds a new X.501 Attribute object of the type
56.Dv NID_ext_req
57to
58.Fa req
59using the equivalent of
60.Xr X509_ATTRIBUTE_create_by_NID 3
61with a
62.Fa type
63of
64.Dv V_ASN1_SEQUENCE .
65.Pp
66.Fn X509_REQ_add_extensions_nid
67is identical except that the specified
68.Fa nid
69is used as the X.501 Attribute type instead of
70.Dv NID_ext_req .
71.Pp
72.Fn X509_REQ_get_extensions
73retrieves the first value of the first X.501 Attribute of appropriate type.
74By default, the attribute types
75.Dv NID_ext_req
76and
77.Dv NID_ms_ext_req
78are considered appropriate.
79.Pp
80.Fn X509_REQ_set_extension_nids
81replaces the list of attribute types that
82.Fn X509_REQ_get_extensions
83considers appropriate for storing extensions.
84The
85.Fa nids
86argument is interpreted as a pointer to the first element
87of a variable-sized array of
88.Vt int .
89The last element of the array has to be
90.Dv NID_undef .
91The array needs to remain valid until
92.Fn X509_REQ_set_extension_nids
93is called again with a different argument.
94.Pp
95.Fn X509_REQ_extension_nid
96checks whether
97.Fn X509_REQ_get_extensions
98regards the
99.Fa nid
100argument as a type appropriate for storing extensions.
101.Sh RETURN VALUES
102.Fn X509_REQ_add_extensions
103and
104.Fn X509_REQ_add_extensions_nid
105returns 1 for success or 0 for failure.
106.Pp
107.Fn X509_REQ_get_extensions
108returns a newly allocated array of ASN.1
109.Vt Extension
110objects or
111.Dv NULL
112if
113.Fa req
114is
115.Dv NULL ,
116does not contain
117.Vt CertificationRequestInfo ,
118contains no attribute of an appropriate type,
119or if decoding or memory allocation fails.
120.Pp
121.Fn X509_REQ_get_extension_nids
122returns the pointer installed with
123.Fn X509_REQ_set_extension_nids
124or a pointer to a static array
125.Brq Dv NID_ext_req , NID_ms_ext_req , NID_undef
126by default.
127.Pp
128.Fn X509_REQ_extension_nid
129returns 1 if
130.Fa nid
131is considered appropriate or 0 otherwise.
132.Sh SEE ALSO
133.Xr d2i_X509_EXTENSION 3 ,
134.Xr STACK_OF 3 ,
135.Xr X509_EXTENSION_new 3 ,
136.Xr X509_REQ_new 3 ,
137.Xr X509V3_extensions_print 3
138.Sh HISTORY
139These functions first appeared in OpenSSL 0.9.5
140and have been available since
141.Ox 2.7 .