diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/X509_EXTENSION_set_object.3 | 159 | 
1 files changed, 106 insertions, 53 deletions
| diff --git a/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 b/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 index 32bb9c6828..4dcf987546 100644 --- a/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 +++ b/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 | |||
| @@ -1,7 +1,24 @@ | |||
| 1 | .\" $OpenBSD: X509_EXTENSION_set_object.3,v 1.1 2016/12/04 20:51:47 schwarze Exp $ | 1 | .\" $OpenBSD: X509_EXTENSION_set_object.3,v 1.2 2016/12/15 15:13:54 schwarze Exp $ | 
| 2 | .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 | 2 | .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 | 
| 3 | .\" | 3 | .\" | 
| 4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | 4 | .\" This file is a derived work. | 
| 5 | .\" The changes are covered by the following Copyright and license: | ||
| 6 | .\" | ||
| 7 | .\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> | ||
| 8 | .\" | ||
| 9 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 10 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 11 | .\" copyright notice and this permission notice appear in all copies. | ||
| 12 | .\" | ||
| 13 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 14 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 15 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 16 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 17 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 18 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 20 | .\" | ||
| 21 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
| 5 | .\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. | 22 | .\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. | 
| 6 | .\" | 23 | .\" | 
| 7 | .\" Redistribution and use in source and binary forms, with or without | 24 | .\" Redistribution and use in source and binary forms, with or without | 
| @@ -48,20 +65,41 @@ | |||
| 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 
| 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 
| 50 | .\" | 67 | .\" | 
| 51 | .Dd $Mdocdate: December 4 2016 $ | 68 | .Dd $Mdocdate: December 15 2016 $ | 
| 52 | .Dt X509_EXTENSION_SET_OBJECT 3 | 69 | .Dt X509_EXTENSION_SET_OBJECT 3 | 
| 53 | .Os | 70 | .Os | 
| 54 | .Sh NAME | 71 | .Sh NAME | 
| 72 | .Nm X509_EXTENSION_new , | ||
| 73 | .Nm X509_EXTENSION_free , | ||
| 74 | .Nm X509_EXTENSION_create_by_NID , | ||
| 75 | .Nm X509_EXTENSION_create_by_OBJ , | ||
| 55 | .Nm X509_EXTENSION_set_object , | 76 | .Nm X509_EXTENSION_set_object , | 
| 56 | .Nm X509_EXTENSION_set_critical , | 77 | .Nm X509_EXTENSION_set_critical , | 
| 57 | .Nm X509_EXTENSION_set_data , | 78 | .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 , | 79 | .Nm X509_EXTENSION_get_object , | 
| 61 | .Nm X509_EXTENSION_get_critical , | 80 | .Nm X509_EXTENSION_get_critical , | 
| 62 | .Nm X509_EXTENSION_get_data | 81 | .Nm X509_EXTENSION_get_data | 
| 63 | .Nd extension utility functions | 82 | .Nd create, change, and inspect X.509 Extension objects | 
| 64 | .Sh SYNOPSIS | 83 | .Sh SYNOPSIS | 
| 84 | .In openssl/x509.h | ||
| 85 | .Ft X509_EXTENSION * | ||
| 86 | .Fn X509_EXTENSION_new void | ||
| 87 | .Ft void | ||
| 88 | .Fn X509_EXTENSION_free "X509_EXTENSION *ex" | ||
| 89 | .Ft X509_EXTENSION * | ||
| 90 | .Fo X509_EXTENSION_create_by_NID | ||
| 91 | .Fa "X509_EXTENSION **ex" | ||
| 92 | .Fa "int nid" | ||
| 93 | .Fa "int crit" | ||
| 94 | .Fa "ASN1_OCTET_STRING *data" | ||
| 95 | .Fc | ||
| 96 | .Ft X509_EXTENSION * | ||
| 97 | .Fo X509_EXTENSION_create_by_OBJ | ||
| 98 | .Fa "X509_EXTENSION **ex" | ||
| 99 | .Fa "ASN1_OBJECT *obj" | ||
| 100 | .Fa "int crit" | ||
| 101 | .Fa "ASN1_OCTET_STRING *data" | ||
| 102 | .Fc | ||
| 65 | .Ft int | 103 | .Ft int | 
| 66 | .Fo X509_EXTENSION_set_object | 104 | .Fo X509_EXTENSION_set_object | 
| 67 | .Fa "X509_EXTENSION *ex" | 105 | .Fa "X509_EXTENSION *ex" | 
| @@ -77,20 +115,6 @@ | |||
| 77 | .Fa "X509_EXTENSION *ex" | 115 | .Fa "X509_EXTENSION *ex" | 
| 78 | .Fa "ASN1_OCTET_STRING *data" | 116 | .Fa "ASN1_OCTET_STRING *data" | 
| 79 | .Fc | 117 | .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 * | 118 | .Ft ASN1_OBJECT * | 
| 95 | .Fo X509_EXTENSION_get_object | 119 | .Fo X509_EXTENSION_get_object | 
| 96 | .Fa "X509_EXTENSION *ex" | 120 | .Fa "X509_EXTENSION *ex" | 
| @@ -104,6 +128,53 @@ | |||
| 104 | .Fa "X509_EXTENSION *ne" | 128 | .Fa "X509_EXTENSION *ne" | 
| 105 | .Fc | 129 | .Fc | 
| 106 | .Sh DESCRIPTION | 130 | .Sh DESCRIPTION | 
| 131 | .Fn X509_EXTENSION_new | ||
| 132 | allocates and initializes an empty | ||
| 133 | .Vt X509_EXTENSION | ||
| 134 | object, representing an ASN.1 Extension structure | ||
| 135 | defined in RFC 5280 section 4.1. | ||
| 136 | It is a wrapper object around specific extension objects of different | ||
| 137 | types and stores an extension type identifier and a criticality | ||
| 138 | flag in addition to the DER-encoded form of the wrapped object. | ||
| 139 | .Vt X509_EXTENSION | ||
| 140 | objects can be used for X.509 v3 certificates inside | ||
| 141 | .Vt X509_CINF | ||
| 142 | objects and for X.509 v2 certificate revocation lists inside | ||
| 143 | .Vt X509_CRL_INFO | ||
| 144 | and | ||
| 145 | .Vt X509_REVOKED | ||
| 146 | objects. | ||
| 147 | .Pp | ||
| 148 | .Fn X509_EXTENSION_free | ||
| 149 | frees | ||
| 150 | .Fa ex | ||
| 151 | and all objects it is using. | ||
| 152 | .Pp | ||
| 153 | .Fn X509_EXTENSION_create_by_NID | ||
| 154 | creates an extension of type | ||
| 155 | .Fa nid | ||
| 156 | and criticality | ||
| 157 | .Fa crit | ||
| 158 | using data | ||
| 159 | .Fa data . | ||
| 160 | The created extension is returned and written to | ||
| 161 | .Pf * Fa ex | ||
| 162 | reusing or allocating a new extension if necessary, so | ||
| 163 | .Pf * Fa ex | ||
| 164 | should either be | ||
| 165 | .Dv NULL | ||
| 166 | or a valid | ||
| 167 | .Vt X509_EXTENSION | ||
| 168 | structure. | ||
| 169 | It must not be an uninitialised pointer. | ||
| 170 | .Pp | ||
| 171 | .Fn X509_EXTENSION_create_by_OBJ | ||
| 172 | is identical to | ||
| 173 | .Fn X509_EXTENSION_create_by_NID | ||
| 174 | except that it creates an extension using | ||
| 175 | .Fa obj | ||
| 176 | instead of a NID. | ||
| 177 | .Pp | ||
| 107 | .Fn X509_EXTENSION_set_object | 178 | .Fn X509_EXTENSION_set_object | 
| 108 | sets the extension type of | 179 | sets the extension type of | 
| 109 | .Fa ex | 180 | .Fa ex | 
| @@ -133,31 +204,6 @@ The | |||
| 133 | .Fa data | 204 | .Fa data | 
| 134 | pointer is duplicated internally. | 205 | pointer is duplicated internally. | 
| 135 | .Pp | 206 | .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 | 207 | .Fn X509_EXTENSION_get_object | 
| 162 | returns the extension type of | 208 | returns the extension type of | 
| 163 | .Fa ex | 209 | .Fa ex | 
| @@ -190,13 +236,8 @@ associated with an extension is the extension encoding in an | |||
| 190 | .Vt ASN1_OCTET_STRING | 236 | .Vt ASN1_OCTET_STRING | 
| 191 | structure. | 237 | structure. | 
| 192 | .Sh RETURN VALUES | 238 | .Sh RETURN VALUES | 
| 193 | .Fn X509_EXTENSION_set_object , | 239 | .Fn X509_EXTENSION_new , | 
| 194 | .Fn X509_EXTENSION_set_critical , | 240 | .Fn X509_EXTENSION_create_by_NID , | 
| 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 | 241 | and | 
| 201 | .Fn X509_EXTENSION_create_by_OBJ | 242 | .Fn X509_EXTENSION_create_by_OBJ | 
| 202 | return an | 243 | return an | 
| @@ -205,6 +246,12 @@ pointer or | |||
| 205 | .Dv NULL | 246 | .Dv NULL | 
| 206 | if an error occurs. | 247 | if an error occurs. | 
| 207 | .Pp | 248 | .Pp | 
| 249 | .Fn X509_EXTENSION_set_object , | ||
| 250 | .Fn X509_EXTENSION_set_critical , | ||
| 251 | and | ||
| 252 | .Fn X509_EXTENSION_set_data | ||
| 253 | return 1 for success or 0 for failure. | ||
| 254 | .Pp | ||
| 208 | .Fn X509_EXTENSION_get_object | 255 | .Fn X509_EXTENSION_get_object | 
| 209 | returns an | 256 | returns an | 
| 210 | .Vt ASN1_OBJECT | 257 | .Vt ASN1_OBJECT | 
| @@ -218,4 +265,10 @@ returns an | |||
| 218 | .Vt ASN1_OCTET_STRING | 265 | .Vt ASN1_OCTET_STRING | 
| 219 | pointer. | 266 | pointer. | 
| 220 | .Sh SEE ALSO | 267 | .Sh SEE ALSO | 
| 221 | .Xr X509V3_get_d2i 3 | 268 | .Xr OCSP_CRLID_new 3 , | 
| 269 | .Xr OCSP_SERVICELOC_new 3 , | ||
| 270 | .Xr X509V3_get_d2i 3 , | ||
| 271 | .Xr X509v3_get_ext_by_NID | ||
| 272 | .Sh STANDARDS | ||
| 273 | RFC 5280: Internet X.509 Public Key Infrastructure Certificate and | ||
| 274 | Certificate Revocation List (CRL) Profile | ||
