1 .\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.39)
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
9 .de Vb \" Begin verbatim text
14 .de Ve \" End verbatim text
18 .\" Set up some character translations and predefined strings. \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD. Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
54 .\" Avoid warning from groff about undefined register 'F'.
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{\
62 . tm Index:\\$1\t\\n%\t"\\$2"
72 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73 .\" Fear. Run. Save yourself. No user-serviceable parts.
74 . \" fudge factors for nroff and troff
83 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
89 . \" simple accents for nroff and troff
99 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
106 . \" troff and (daisy-wheel) nroff accents
107 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114 .ds ae a\h'-(\w'a'u*4/10)'e
115 .ds Ae A\h'-(\w'A'u*4/10)'E
116 . \" corrections for vroff
117 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119 . \" for low resolution devices (crt and lpr)
120 .if \n(.H>23 .if \n(.V>19 \
133 .\" ========================================================================
135 .IX Title "X509V3_GET_D2I 3"
136 .TH X509V3_GET_D2I 3 "2019-09-10" "1.1.1d" "OpenSSL"
137 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
142 X509_get0_extensions, X509_CRL_get0_extensions, X509_REVOKED_get0_extensions, X509V3_get_d2i, X509V3_add1_i2d, X509V3_EXT_d2i, X509V3_EXT_i2d, X509_get_ext_d2i, X509_add1_ext_i2d, X509_CRL_get_ext_d2i, X509_CRL_add1_ext_i2d, X509_REVOKED_get_ext_d2i, X509_REVOKED_add1_ext_i2d \- X509 extension decode and encode functions
144 .IX Header "SYNOPSIS"
146 \& #include <openssl/x509v3.h>
148 \& void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit,
150 \& int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,
151 \& int crit, unsigned long flags);
153 \& void *X509V3_EXT_d2i(X509_EXTENSION *ext);
154 \& X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext);
156 \& void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx);
157 \& int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
158 \& unsigned long flags);
160 \& void *X509_CRL_get_ext_d2i(const X509_CRL *crl, int nid, int *crit, int *idx);
161 \& int X509_CRL_add1_ext_i2d(X509_CRL *crl, int nid, void *value, int crit,
162 \& unsigned long flags);
164 \& void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *r, int nid, int *crit, int *idx);
165 \& int X509_REVOKED_add1_ext_i2d(X509_REVOKED *r, int nid, void *value, int crit,
166 \& unsigned long flags);
168 \& const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
169 \& const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
170 \& const STACK_OF(X509_EXTENSION) *X509_REVOKED_get0_extensions(const X509_REVOKED *r);
173 .IX Header "DESCRIPTION"
174 \&\fBX509V3_get_ext_d2i()\fR looks for an extension with \s-1OID\s0 \fBnid\fR in the extensions
175 \&\fBx\fR and, if found, decodes it. If \fBidx\fR is \fB\s-1NULL\s0\fR then only one
176 occurrence of an extension is permissible otherwise the first extension after
177 index \fB*idx\fR is returned and \fB*idx\fR updated to the location of the extension.
178 If \fBcrit\fR is not \fB\s-1NULL\s0\fR then \fB*crit\fR is set to a status value: \-2 if the
179 extension occurs multiple times (this is only returned if \fBidx\fR is \fB\s-1NULL\s0\fR),
180 \&\-1 if the extension could not be found, 0 if the extension is found and is
181 not critical and 1 if critical. A pointer to an extension specific structure
182 or \fB\s-1NULL\s0\fR is returned.
184 \&\fBX509V3_add1_i2d()\fR adds extension \fBvalue\fR to \s-1STACK\s0 \fB*x\fR (allocating a new
185 \&\s-1STACK\s0 if necessary) using \s-1OID\s0 \fBnid\fR and criticality \fBcrit\fR according
188 \&\fBX509V3_EXT_d2i()\fR attempts to decode the \s-1ASN.1\s0 data contained in extension
189 \&\fBext\fR and returns a pointer to an extension specific structure or \fB\s-1NULL\s0\fR
190 if the extension could not be decoded (invalid syntax or not supported).
192 \&\fBX509V3_EXT_i2d()\fR encodes the extension specific structure \fBext\fR
193 with \s-1OID\s0 \fBext_nid\fR and criticality \fBcrit\fR.
195 \&\fBX509_get_ext_d2i()\fR and \fBX509_add1_ext_i2d()\fR operate on the extensions of
196 certificate \fBx\fR, they are otherwise identical to \fBX509V3_get_d2i()\fR and
197 \&\fBX509V3_add_i2d()\fR.
199 \&\fBX509_CRL_get_ext_d2i()\fR and \fBX509_CRL_add1_ext_i2d()\fR operate on the extensions
200 of \s-1CRL\s0 \fBcrl\fR, they are otherwise identical to \fBX509V3_get_d2i()\fR and
201 \&\fBX509V3_add_i2d()\fR.
203 \&\fBX509_REVOKED_get_ext_d2i()\fR and \fBX509_REVOKED_add1_ext_i2d()\fR operate on the
204 extensions of \fBX509_REVOKED\fR structure \fBr\fR (i.e for \s-1CRL\s0 entry extensions),
205 they are otherwise identical to \fBX509V3_get_d2i()\fR and \fBX509V3_add_i2d()\fR.
207 \&\fBX509_get0_extensions()\fR, \fBX509_CRL_get0_extensions()\fR and
208 \&\fBX509_REVOKED_get0_extensions()\fR return a stack of all the extensions
209 of a certificate a \s-1CRL\s0 or a \s-1CRL\s0 entry respectively.
212 In almost all cases an extension can occur at most once and multiple
213 occurrences is an error. Therefore the \fBidx\fR parameter is usually \fB\s-1NULL\s0\fR.
215 The \fBflags\fR parameter may be one of the following values.
217 \&\fBX509V3_ADD_DEFAULT\fR appends a new extension only if the extension does
218 not already exist. An error is returned if the extension does already
221 \&\fBX509V3_ADD_APPEND\fR appends a new extension, ignoring whether the extension
224 \&\fBX509V3_ADD_REPLACE\fR replaces an extension if it exists otherwise appends
227 \&\fBX509V3_ADD_REPLACE_EXISTING\fR replaces an existing extension if it exists
228 otherwise returns an error.
230 \&\fBX509V3_ADD_KEEP_EXISTING\fR appends a new extension only if the extension does
231 not already exist. An error \fBis not\fR returned if the extension does already
234 \&\fBX509V3_ADD_DELETE\fR extension \fBnid\fR is deleted: no new extension is added.
236 If \fBX509V3_ADD_SILENT\fR is ored with \fBflags\fR: any error returned will not
237 be added to the error queue.
239 The function \fBX509V3_get_d2i()\fR will return \fB\s-1NULL\s0\fR if the extension is not
240 found, occurs multiple times or cannot be decoded. It is possible to
241 determine the precise reason by checking the value of \fB*crit\fR.
242 .SH "SUPPORTED EXTENSIONS"
243 .IX Header "SUPPORTED EXTENSIONS"
244 The following sections contain a list of all supported extensions
245 including their name and \s-1NID.\s0
246 .SS "\s-1PKIX\s0 Certificate Extensions"
247 .IX Subsection "PKIX Certificate Extensions"
248 The following certificate extensions are defined in \s-1PKIX\s0 standards such as
252 \& Basic Constraints NID_basic_constraints
253 \& Key Usage NID_key_usage
254 \& Extended Key Usage NID_ext_key_usage
256 \& Subject Key Identifier NID_subject_key_identifier
257 \& Authority Key Identifier NID_authority_key_identifier
259 \& Private Key Usage Period NID_private_key_usage_period
261 \& Subject Alternative Name NID_subject_alt_name
262 \& Issuer Alternative Name NID_issuer_alt_name
264 \& Authority Information Access NID_info_access
265 \& Subject Information Access NID_sinfo_access
267 \& Name Constraints NID_name_constraints
269 \& Certificate Policies NID_certificate_policies
270 \& Policy Mappings NID_policy_mappings
271 \& Policy Constraints NID_policy_constraints
272 \& Inhibit Any Policy NID_inhibit_any_policy
274 \& TLS Feature NID_tlsfeature
276 .SS "Netscape Certificate Extensions"
277 .IX Subsection "Netscape Certificate Extensions"
278 The following are (largely obsolete) Netscape certificate extensions.
281 \& Netscape Cert Type NID_netscape_cert_type
282 \& Netscape Base Url NID_netscape_base_url
283 \& Netscape Revocation Url NID_netscape_revocation_url
284 \& Netscape CA Revocation Url NID_netscape_ca_revocation_url
285 \& Netscape Renewal Url NID_netscape_renewal_url
286 \& Netscape CA Policy Url NID_netscape_ca_policy_url
287 \& Netscape SSL Server Name NID_netscape_ssl_server_name
288 \& Netscape Comment NID_netscape_comment
290 .SS "Miscellaneous Certificate Extensions"
291 .IX Subsection "Miscellaneous Certificate Extensions"
293 \& Strong Extranet ID NID_sxnet
294 \& Proxy Certificate Information NID_proxyCertInfo
296 .SS "\s-1PKIX CRL\s0 Extensions"
297 .IX Subsection "PKIX CRL Extensions"
298 The following are \s-1CRL\s0 extensions from \s-1PKIX\s0 standards such as \s-1RFC5280.\s0
301 \& CRL Number NID_crl_number
302 \& CRL Distribution Points NID_crl_distribution_points
303 \& Delta CRL Indicator NID_delta_crl
304 \& Freshest CRL NID_freshest_crl
305 \& Invalidity Date NID_invalidity_date
306 \& Issuing Distribution Point NID_issuing_distribution_point
309 The following are \s-1CRL\s0 entry extensions from \s-1PKIX\s0 standards such as \s-1RFC5280.\s0
312 \& CRL Reason Code NID_crl_reason
313 \& Certificate Issuer NID_certificate_issuer
315 .SS "\s-1OCSP\s0 Extensions"
316 .IX Subsection "OCSP Extensions"
318 \& OCSP Nonce NID_id_pkix_OCSP_Nonce
319 \& OCSP CRL ID NID_id_pkix_OCSP_CrlID
320 \& Acceptable OCSP Responses NID_id_pkix_OCSP_acceptableResponses
321 \& OCSP No Check NID_id_pkix_OCSP_noCheck
322 \& OCSP Archive Cutoff NID_id_pkix_OCSP_archiveCutoff
323 \& OCSP Service Locator NID_id_pkix_OCSP_serviceLocator
324 \& Hold Instruction Code NID_hold_instruction_code
326 .SS "Certificate Transparency Extensions"
327 .IX Subsection "Certificate Transparency Extensions"
328 The following extensions are used by certificate transparency, \s-1RFC6962\s0
331 \& CT Precertificate SCTs NID_ct_precert_scts
332 \& CT Certificate SCTs NID_ct_cert_scts
335 .IX Header "RETURN VALUES"
336 \&\fBX509V3_EXT_d2i()\fR and *\fBX509V3_get_d2i()\fR return a pointer to an extension
337 specific structure of \fB\s-1NULL\s0\fR if an error occurs.
339 \&\fBX509V3_EXT_i2d()\fR returns a pointer to an \fBX509_EXTENSION\fR structure
340 or \fB\s-1NULL\s0\fR if an error occurs.
342 \&\fBX509V3_add1_i2d()\fR returns 1 if the operation is successful and 0 if it
343 fails due to a non-fatal error (extension not found, already exists,
344 cannot be encoded) or \-1 due to a fatal error such as a memory allocation
347 \&\fBX509_get0_extensions()\fR, \fBX509_CRL_get0_extensions()\fR and
348 \&\fBX509_REVOKED_get0_extensions()\fR return a stack of extensions. They return
349 \&\s-1NULL\s0 if no extensions are present.
351 .IX Header "SEE ALSO"
352 \&\fBd2i_X509\fR\|(3),
353 \&\fBERR_get_error\fR\|(3),
354 \&\fBX509_CRL_get0_by_serial\fR\|(3),
355 \&\fBX509_get0_signature\fR\|(3),
356 \&\fBX509_get_ext_d2i\fR\|(3),
357 \&\fBX509_get_extension_flags\fR\|(3),
358 \&\fBX509_get_pubkey\fR\|(3),
359 \&\fBX509_get_subject_name\fR\|(3),
360 \&\fBX509_get_version\fR\|(3),
361 \&\fBX509_NAME_add_entry_by_txt\fR\|(3),
362 \&\fBX509_NAME_ENTRY_get_object\fR\|(3),
363 \&\fBX509_NAME_get_index_by_NID\fR\|(3),
364 \&\fBX509_NAME_print_ex\fR\|(3),
365 \&\fBX509_new\fR\|(3),
366 \&\fBX509_sign\fR\|(3),
367 \&\fBX509_verify_cert\fR\|(3)
369 .IX Header "COPYRIGHT"
370 Copyright 2015\-2016 The OpenSSL Project Authors. All Rights Reserved.
372 Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
373 this file except in compliance with the License. You can obtain a copy
374 in the file \s-1LICENSE\s0 in the source distribution or at
375 <https://www.openssl.org/source/license.html>.