diff options
Diffstat (limited to 'src/lib/libcrypto/man/X509_EXTENSION_set_object.3')
-rw-r--r-- | src/lib/libcrypto/man/X509_EXTENSION_set_object.3 | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 b/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 new file mode 100644 index 0000000000..32bb9c6828 --- /dev/null +++ b/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 | |||
@@ -0,0 +1,221 @@ | |||
1 | .\" $OpenBSD: X509_EXTENSION_set_object.3,v 1.1 2016/12/04 20:51:47 schwarze Exp $ | ||
2 | .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: December 4 2016 $ | ||
52 | .Dt X509_EXTENSION_SET_OBJECT 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm X509_EXTENSION_set_object , | ||
56 | .Nm X509_EXTENSION_set_critical , | ||
57 | .Nm X509_EXTENSION_set_data , | ||
58 | .Nm X509_EXTENSION_create_by_NID , | ||
59 | .Nm X509_EXTENSION_create_by_OBJ , | ||
60 | .Nm X509_EXTENSION_get_object , | ||
61 | .Nm X509_EXTENSION_get_critical , | ||
62 | .Nm X509_EXTENSION_get_data | ||
63 | .Nd extension utility functions | ||
64 | .Sh SYNOPSIS | ||
65 | .Ft int | ||
66 | .Fo X509_EXTENSION_set_object | ||
67 | .Fa "X509_EXTENSION *ex" | ||
68 | .Fa "ASN1_OBJECT *obj" | ||
69 | .Fc | ||
70 | .Ft int | ||
71 | .Fo X509_EXTENSION_set_critical | ||
72 | .Fa "X509_EXTENSION *ex" | ||
73 | .Fa "int crit" | ||
74 | .Fc | ||
75 | .Ft int | ||
76 | .Fo X509_EXTENSION_set_data | ||
77 | .Fa "X509_EXTENSION *ex" | ||
78 | .Fa "ASN1_OCTET_STRING *data" | ||
79 | .Fc | ||
80 | .Ft X509_EXTENSION * | ||
81 | .Fo X509_EXTENSION_create_by_NID | ||
82 | .Fa "X509_EXTENSION **ex" | ||
83 | .Fa "int nid" | ||
84 | .Fa "int crit" | ||
85 | .Fa "ASN1_OCTET_STRING *data" | ||
86 | .Fc | ||
87 | .Ft X509_EXTENSION * | ||
88 | .Fo X509_EXTENSION_create_by_OBJ | ||
89 | .Fa "X509_EXTENSION **ex" | ||
90 | .Fa "ASN1_OBJECT *obj" | ||
91 | .Fa "int crit" | ||
92 | .Fa "ASN1_OCTET_STRING *data" | ||
93 | .Fc | ||
94 | .Ft ASN1_OBJECT * | ||
95 | .Fo X509_EXTENSION_get_object | ||
96 | .Fa "X509_EXTENSION *ex" | ||
97 | .Fc | ||
98 | .Ft int | ||
99 | .Fo X509_EXTENSION_get_critical | ||
100 | .Fa "X509_EXTENSION *ex" | ||
101 | .Fc | ||
102 | .Ft ASN1_OCTET_STRING * | ||
103 | .Fo X509_EXTENSION_get_data | ||
104 | .Fa "X509_EXTENSION *ne" | ||
105 | .Fc | ||
106 | .Sh DESCRIPTION | ||
107 | .Fn X509_EXTENSION_set_object | ||
108 | sets the extension type of | ||
109 | .Fa ex | ||
110 | to | ||
111 | .Fa obj . | ||
112 | The | ||
113 | .Fa obj | ||
114 | pointer is duplicated internally so | ||
115 | .Fa obj | ||
116 | should be freed up after use. | ||
117 | .Pp | ||
118 | .Fn X509_EXTENSION_set_critical | ||
119 | sets the criticality of | ||
120 | .Fa ex | ||
121 | to | ||
122 | .Fa crit . | ||
123 | If | ||
124 | .Fa crit | ||
125 | is zero, the extension in non-critical, otherwise it is critical. | ||
126 | .Pp | ||
127 | .Fn X509_EXTENSION_set_data | ||
128 | sets the data in extension | ||
129 | .Fa ex | ||
130 | to | ||
131 | .Fa data . | ||
132 | The | ||
133 | .Fa data | ||
134 | pointer is duplicated internally. | ||
135 | .Pp | ||
136 | .Fn X509_EXTENSION_create_by_NID | ||
137 | creates an extension of type | ||
138 | .Fa nid , | ||
139 | criticality | ||
140 | .Fa crit | ||
141 | using data | ||
142 | .Fa data . | ||
143 | The created extension is returned and written to | ||
144 | .Pf * Fa ex | ||
145 | reusing or allocating a new extension if necessary, so | ||
146 | .Pf * Fa ex | ||
147 | should either be | ||
148 | .Dv NULL | ||
149 | or a valid | ||
150 | .Vt X509_EXTENSION | ||
151 | structure. | ||
152 | It must not be an uninitialised pointer. | ||
153 | .Pp | ||
154 | .Fn X509_EXTENSION_create_by_OBJ | ||
155 | is identical to | ||
156 | .Fn X509_EXTENSION_create_by_NID | ||
157 | except that it creates an extension using | ||
158 | .Fa obj | ||
159 | instead of a NID. | ||
160 | .Pp | ||
161 | .Fn X509_EXTENSION_get_object | ||
162 | returns the extension type of | ||
163 | .Fa ex | ||
164 | as an | ||
165 | .Vt ASN1_OBJECT | ||
166 | pointer. | ||
167 | The returned pointer is an internal value which must not be freed up. | ||
168 | .Pp | ||
169 | .Fn X509_EXTENSION_get_critical | ||
170 | returns the criticality of extension | ||
171 | .Fa ex | ||
172 | it returns 1 for critical and 0 for non-critical. | ||
173 | .Pp | ||
174 | .Fn X509_EXTENSION_get_data | ||
175 | returns the data of extension | ||
176 | .Fa ex . | ||
177 | The returned pointer is an internal value which must not be freed up. | ||
178 | .Pp | ||
179 | These functions manipulate the contents of an extension directly. | ||
180 | Most applications will want to parse or encode and add an extension: | ||
181 | they should use the extension encode and decode functions instead | ||
182 | such as | ||
183 | .Xr X509_add1_ext_i2d 3 | ||
184 | and | ||
185 | .Xr X509_get_ext_d2i 3 . | ||
186 | .Pp | ||
187 | The | ||
188 | .Fa data | ||
189 | associated with an extension is the extension encoding in an | ||
190 | .Vt ASN1_OCTET_STRING | ||
191 | structure. | ||
192 | .Sh RETURN VALUES | ||
193 | .Fn X509_EXTENSION_set_object , | ||
194 | .Fn X509_EXTENSION_set_critical , | ||
195 | and | ||
196 | .Fn X509_EXTENSION_set_data | ||
197 | return 1 for success or 0 for failure. | ||
198 | .Pp | ||
199 | .Fn X509_EXTENSION_create_by_NID | ||
200 | and | ||
201 | .Fn X509_EXTENSION_create_by_OBJ | ||
202 | return an | ||
203 | .Vt X509_EXTENSION | ||
204 | pointer or | ||
205 | .Dv NULL | ||
206 | if an error occurs. | ||
207 | .Pp | ||
208 | .Fn X509_EXTENSION_get_object | ||
209 | returns an | ||
210 | .Vt ASN1_OBJECT | ||
211 | pointer. | ||
212 | .Pp | ||
213 | .Fn X509_EXTENSION_get_critical | ||
214 | returns 0 for non-critical or 1 for critical. | ||
215 | .Pp | ||
216 | .Fn X509_EXTENSION_get_data | ||
217 | returns an | ||
218 | .Vt ASN1_OCTET_STRING | ||
219 | pointer. | ||
220 | .Sh SEE ALSO | ||
221 | .Xr X509V3_get_d2i 3 | ||