summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/x509v3.cnf.5
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/man/x509v3.cnf.5731
1 files changed, 731 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/x509v3.cnf.5 b/src/lib/libcrypto/man/x509v3.cnf.5
new file mode 100644
index 0000000000..22e013a87e
--- /dev/null
+++ b/src/lib/libcrypto/man/x509v3.cnf.5
@@ -0,0 +1,731 @@
1.\" $OpenBSD: x509v3.cnf.5,v 1.1 2016/12/11 18:06:09 schwarze Exp $
2.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2004, 2006, 2013, 2014, 2015, 2016 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: December 11 2016 $
53.Dt X509V3.CNF 5
54.Os
55.Sh NAME
56.Nm x509v3.cnf
57.Nd X.509 V3 certificate extension configuration format
58.Sh DESCRIPTION
59Several of the OpenSSL utilities can add extensions to a certificate or
60certificate request based on the contents of a configuration file.
61The file format is based on the
62.Xr openssl.cnf 5
63format.
64.Pp
65Typically the application will contain an option to point to an
66extension section.
67Each line of the extension section takes the form:
68.Pp
69.D1 Ar extension_name Ns = Ns Oo Cm critical , Oc Ar extension_options
70.Pp
71If
72.Cm critical
73is present, then the extension will be critical.
74.Pp
75The format of
76.Ar extension_options
77depends on the value of
78.Ar extension_name .
79.Pp
80There are four main types of extension: string extensions, multi-valued
81extensions, raw extensions, and arbitrary extensions.
82.Pp
83String extensions simply have a string which contains either the value
84itself or how it is obtained.
85For example:
86.Pp
87.Dl nsComment="This is a Comment"
88.Pp
89Multi-valued extensions have a short form and a long form.
90The short form is a list of names and values:
91.Pp
92.Dl basicConstraints=critical,CA:true,pathlen:1
93.Pp
94The long form allows the values to be placed in a separate section:
95.Bd -literal -offset indent
96basicConstraints=critical,@bs_section
97
98[bs_section]
99CA=true
100pathlen=1
101.Ed
102.Pp
103Both forms are equivalent.
104.Pp
105The syntax of raw extensions is governed by the extension code:
106it can for example contain data in multiple sections.
107The correct syntax to use is defined by the extension code itself:
108check out the certificate policies extension for an example.
109.Pp
110If an extension type is unsupported, then the arbitrary extension
111syntax must be used, see the
112.Sx ARBITRARY EXTENSIONS
113section for more details.
114.Sh STANDARD EXTENSIONS
115The following sections describe each supported extension in detail.
116.Ss Basic constraints
117This is a multi-valued extension which indicates whether a certificate
118is a CA certificate.
119The first (mandatory) name is
120.Ic CA
121followed by
122.Cm TRUE
123or
124.Cm FALSE .
125If
126.Ic CA
127is
128.Cm TRUE ,
129then an optional
130.Ic pathlen
131name followed by an non-negative value can be included.
132For example:
133.Bd -literal -offset indent
134basicConstraints=CA:TRUE
135basicConstraints=CA:FALSE
136basicConstraints=critical,CA:TRUE, pathlen:0
137.Ed
138.Pp
139A CA certificate must include the
140.Ic basicConstraints
141value with the
142.Ic CA
143field set to
144.Cm TRUE .
145An end user certificate must either set
146.Ic CA
147to
148.Cm FALSE
149or exclude the extension entirely.
150Some software may require the inclusion of
151.Ic basicConstraints
152with
153.Ic CA
154set to
155.Cm FALSE
156for end entity certificates.
157.Pp
158The
159.Ic pathlen
160parameter indicates the maximum number of CAs that can appear below
161this one in a chain.
162So if you have a CA with a
163.Ic pathlen
164of zero it can only be used to sign end user certificates and not
165further CAs.
166.Ss Key usage
167Key usage is a multi-valued extension consisting of a list of names of
168the permitted key usages.
169.Pp
170The supported names are:
171.Ic digitalSignature ,
172.Ic nonRepudiation ,
173.Ic keyEncipherment ,
174.Ic dataEncipherment ,
175.Ic keyAgreement ,
176.Ic keyCertSign ,
177.Ic cRLSign ,
178.Ic encipherOnly ,
179and
180.Ic decipherOnly .
181Examples:
182.Bd -literal -offset indent
183keyUsage=digitalSignature, nonRepudiation
184keyUsage=critical, keyCertSign
185.Ed
186.Ss Extended key usage
187This extensions consists of a list of usages indicating purposes for
188which the certificate public key can be used for.
189.Pp
190These can either be object short names or the dotted numerical form of OIDs.
191While any OID can be used, only certain values make sense.
192In particular the following PKIX, NS and MS values are meaningful:
193.Bl -column emailProtection
194.It Em value Ta Em meaning
195.It Ic serverAuth Ta SSL/TLS web server authentication
196.It Ic clientAuth Ta SSL/TLS web client authentication
197.It Ic codeSigning Ta code signing
198.It Ic emailProtection Ta E-mail protection (S/MIME)
199.It Ic timeStamping Ta trusted timestamping
200.It Ic OCSPSigning Ta OCSP signing
201.It Ic ipsecIKE Ta IPsec internet key exchange
202.It Ic msCodeInd Ta Microsoft individual code signing (authenticode)
203.It Ic msCodeCom Ta Microsoft commercial code signing (authenticode)
204.It Ic msCTLSign Ta Microsoft trust list signing
205.It Ic msEFS Ta Microsoft encrypted file system
206.El
207.Pp
208Examples:
209.Bd -literal -offset indent
210extendedKeyUsage=critical,codeSigning,1.2.3.4
211extendedKeyUsage=serverAuth,clientAuth
212.Ed
213.Ss Subject key identifier
214This is really a string extension and can take two possible values.
215Either the word
216.Cm hash
217which will automatically follow the guidelines in RFC 3280
218or a hex string giving the extension value to include.
219The use of the hex string is strongly discouraged.
220Example:
221.Pp
222.Dl subjectKeyIdentifier=hash
223.Ss Authority key identifier
224The authority key identifier extension permits two options,
225.Cm keyid
226and
227.Cm issuer :
228both can take the optional value
229.Cm always .
230.Pp
231If the
232.Cm keyid
233option is present, an attempt is made to copy the subject
234key identifier from the parent certificate.
235If the value
236.Cm always
237is present, then an error is returned if the option fails.
238.Pp
239The
240.Cm issuer
241option copies the issuer and serial number from the issuer certificate.
242This will only be done if the
243.Cm keyid
244option fails or is not included unless the
245.Cm always
246flag will always include the value.
247Example:
248.Pp
249.Dl authorityKeyIdentifier=keyid,issuer
250.Ss Subject alternative name
251The subject alternative name extension allows various literal values to
252be included in the configuration file.
253These include
254.Ic email
255(an email address),
256.Ic URI
257(a uniform resource indicator),
258.Ic DNS
259(a DNS domain name),
260.Ic RID
261(a registered ID: OBJECT IDENTIFIER),
262.Ic IP
263(an IP address),
264.Ic dirName
265(a distinguished name), and
266.Ic otherName .
267.Pp
268The
269.Ic email
270option include a special
271.Cm copy
272value.
273This will automatically include any email addresses contained in the
274certificate subject name in the extension.
275.Pp
276The IP address used in the
277.Ic IP
278options can be in either IPv4 or IPv6 format.
279.Pp
280The value of
281.Ic dirName
282should point to a section containing the distinguished name to use as a
283set of name value pairs.
284Multi values AVAs can be formed by prefacing the name with a
285.Ql +
286character.
287.Pp
288.Ic otherName
289can include arbitrary data associated with an OID: the value should
290be the OID followed by a semicolon and the content in standard
291.Xr ASN1_generate_nconf 3
292format.
293Examples:
294.Bd -literal -offset 2n
295subjectAltName=email:copy,email:my@other.address,URI:http://my.url.here/
296subjectAltName=IP:192.168.7.1
297subjectAltName=IP:13::17
298subjectAltName=email:my@other.address,RID:1.2.3.4
299subjectAltName=otherName:1.2.3.4;UTF8:some other identifier
300
301subjectAltName=dirName:dir_sect
302
303[dir_sect]
304C=UK
305O=My Organization
306OU=My Unit
307CN=My Name
308.Ed
309.Ss Issuer alternative name
310The issuer alternative name option supports all the literal options of
311subject alternative name.
312It does not support the
313.Ic email : Ns Cm copy
314option because that would not make sense.
315It does support an additional
316.Ic issuer : Ns Cm copy
317option that will copy all the subject alternative name values from
318the issuer certificate (if possible).
319Example:
320.Pp
321.Dl issuserAltName = issuer:copy
322.Ss Authority info access
323The authority information access extension gives details about how to
324access certain information relating to the CA.
325Its syntax is
326.Ar accessOID ; location
327where
328.Ar location
329has the same syntax as subject alternative name (except that
330.Ic email : Ns Cm copy
331is not supported).
332.Ar accessOID
333can be any valid OID but only certain values are meaningful,
334for example
335.Cm OCSP
336and
337.Cm caIssuers .
338Example:
339.Bd -literal -offset indent
340authorityInfoAccess = OCSP;URI:http://ocsp.my.host/
341authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html
342.Ed
343.Ss CRL distribution points
344This is a multi-valued extension whose options can be either in
345.Ar name : Ns Ar value
346pair form using the same form as subject alternative name or a
347single value representing a section name containing all the
348distribution point fields.
349.Pp
350For a
351.Ar name : Ns Ar value
352pair a new DistributionPoint with the fullName field set to the
353given value, both the cRLissuer and reasons fields are omitted in
354this case.
355.Pp
356In the single option case, the section indicated contains values
357for each field.
358In this section:
359.Pp
360If the name is
361.Ic fullname ,
362the value field should contain the full name of the distribution
363point in the same format as subject alternative name.
364.Pp
365If the name is
366.Ic relativename ,
367then the value field should contain a section name whose contents
368represent a DN fragment to be placed in this field.
369.Pp
370The name
371.Ic CRLIssuer ,
372if present, should contain a value for this field in subject
373alternative name format.
374.Pp
375If the name is
376.Ic reasons ,
377the value field should consist of a comma separated field containing
378the reasons.
379Valid reasons are:
380.Cm keyCompromise ,
381.Cm CACompromise ,
382.Cm affiliationChanged ,
383.Cm superseded ,
384.Cm cessationOfOperation ,
385.Cm certificateHold ,
386.Cm privilegeWithdrawn ,
387and
388.Cm AACompromise .
389.Pp
390Simple examples:
391.Bd -literal -offset indent
392crlDistributionPoints=URI:http://myhost.com/myca.crl
393crlDistributionPoints=URI:http://my.com/my.crl,URI:http://oth.com/my.crl
394.Ed
395.Pp
396Full distribution point example:
397.Bd -literal -offset indent
398crlDistributionPoints=crldp1_section
399
400[crldp1_section]
401fullname=URI:http://myhost.com/myca.crl
402CRLissuer=dirName:issuer_sect
403reasons=keyCompromise, CACompromise
404
405[issuer_sect]
406C=UK
407O=Organisation
408CN=Some Name
409.Ed
410.Ss Issuing distribution point
411This extension should only appear in CRLs.
412It is a multi-valued extension whose syntax is similar to the "section"
413pointed to by the CRL distribution points extension with a few
414differences.
415.Pp
416The names
417.Ic reasons
418and
419.Ic CRLissuer
420are not recognized.
421.Pp
422The name
423.Ic onlysomereasons
424is accepted which sets this field.
425The value is in the same format as the CRL distribution point
426.Ic reasons
427field.
428.Pp
429The names
430.Ic onlyuser ,
431.Ic onlyCA ,
432.Ic onlyAA ,
433and
434.Ic indirectCRL
435are also accepted.
436The values should be a boolean values
437.Cm ( TRUE
438or
439.Cm FALSE )
440to indicate the value of the corresponding field.
441Example:
442.Bd -literal -offset indent
443issuingDistributionPoint=critical, @idp_section
444
445[idp_section]
446fullname=URI:http://myhost.com/myca.crl
447indirectCRL=TRUE
448onlysomereasons=keyCompromise, CACompromise
449
450[issuer_sect]
451C=UK
452O=Organisation
453CN=Some Name
454.Ed
455.Ss Certificate policies
456This is a raw extension.
457All the fields of this extension can be set by using the appropriate
458syntax.
459.Pp
460If you follow the PKIX recommendations and just using one OID, then you
461just include the value of that OID.
462Multiple OIDs can be set separated by commas, for example:
463.Pp
464.Dl certificatePolicies= 1.2.4.5, 1.1.3.4
465.Pp
466If you wish to include qualifiers, then the policy OID and qualifiers
467need to be specified in a separate section: this is done by using the
468.Pf @ Ar section
469syntax instead of a literal OID value.
470.Pp
471The section referred to must include the policy OID using the name
472.Ic policyIdentifier .
473.Ic CPSuri
474qualifiers can be included using the syntax:
475.Pp
476.D1 Ic CPS . Ns Ar nnn Ns = Ns Ar value
477.Pp
478.Ic userNotice
479qualifiers can be set using the syntax:
480.Pp
481.D1 Ic userNotice . Ns Ar nnn Ns =@ Ns Ar notice
482.Pp
483The value of the
484.Ic userNotice
485qualifier is specified in the relevant section.
486This section can include
487.Ic explicitText ,
488.Ic organization ,
489and
490.Ic noticeNumbers
491options.
492.Ic explicitText
493and
494.Ic organization
495are text strings,
496.Ic noticeNumbers
497is a comma separated list of numbers.
498The
499.Ic organization
500and
501.Ic noticeNumbers
502options (if included) must
503.Em both
504be present.
505If you use the
506.Ic userNotice
507option with IE5 then you need the
508.Ic ia5org
509option at the top level to modify the encoding: otherwise it will
510not be interpreted properly.
511Example:
512.Bd -literal -offset indent
513certificatePolicies=ia5org,1.2.3.4,1.5.6.7.8,@polsect
514
515[polsect]
516policyIdentifier = 1.3.5.8
517CPS.1="http://my.host.name/"
518CPS.2="http://my.your.name/"
519userNotice.1=@notice
520
521[notice]
522explicitText="Explicit Text Here"
523organization="Organisation Name"
524noticeNumbers=1,2,3,4
525.Ed
526.Pp
527The
528.Ic ia5org
529option changes the type of the
530.Ic organization
531field.
532In RFC 2459, it can only be of type DisplayText.
533In RFC 3280, IA5Strring is also permissible.
534Some software (for example some versions of MSIE) may require
535.Ic ia5org .
536.Ss Policy constraints
537This is a multi-valued extension which consists of the names
538.Ic requireExplicitPolicy
539or
540.Ic inhibitPolicyMapping
541and a non-negative integer value.
542At least one component must be present.
543Example:
544.Pp
545.Dl policyConstraints = requireExplicitPolicy:3
546.Ss Inhibit any policy
547This is a string extension whose value must be a non-negative integer.
548Example:
549.Pp
550.Dl inhibitAnyPolicy = 2
551.Ss Name constraints
552The name constraints extension is a multi-valued extension.
553The name should begin with the word
554.Cm permitted
555or
556.Cm excluded
557followed by a semicolon.
558The rest of the name and the value follows the syntax of subjectAltName
559except
560.Ic email : Ns Cm copy
561is not supported and the
562.Ic IP
563form should consist of an IP addresses and subnet mask separated
564by a slash.
565Examples:
566.Bd -literal -offset indent
567nameConstraints=permitted;IP:192.168.0.0/255.255.0.0
568nameConstraints=permitted;email:.somedomain.com
569nameConstraints=excluded;email:.com
570.Ed
571.Ss OCSP no check
572The OCSP no check extension is a string extension,
573but its value is ignored.
574Example:
575.Pp
576.Dl noCheck = ignored
577.Ss TLS Feature (aka must staple)
578This is a multi-valued extension consisting of a list of TLS extension
579identifiers.
580Each identifier may be a number in the range from 0 to 65535 or a
581supported name.
582When a TLS client sends a listed extension, the TLS server is expected
583to include that extension in its reply.
584.Pp
585The supported names are:
586.Cm status_request
587and
588.Cm status_request_v2 .
589Example:
590.Pp
591.Dl tlsfeature = status_request
592.Sh DEPRECATED EXTENSIONS
593The following extensions are non standard, Netscape specific and largely
594obsolete.
595Their use in new applications is discouraged.
596.Ss Netscape string extensions
597Netscape comment
598.Ic ( nsComment )
599is a string extension containing a comment which will be displayed when
600the certificate is viewed in some browsers.
601Example:
602.Pp
603.Dl nsComment = "Some Random Comment"
604.Pp
605Other supported extensions in this category are:
606.Ic nsBaseUrl ,
607.Ic nsRevocationUrl ,
608.Ic nsCaRevocationUrl ,
609.Ic nsRenewalUrl ,
610.Ic nsCaPolicyUrl ,
611and
612.Ic nsSslServerName .
613.Ss Netscape certificate type
614This is a multi-valued extensions which consists of a list of flags to
615be included.
616It was used to indicate the purposes for which a certificate could be
617used.
618The
619.Ic basicConstraints ,
620.Ic keyUsage ,
621and extended key usage extensions are now used instead.
622.Pp
623Acceptable values for
624.Ic nsCertType
625are:
626.Cm client ,
627.Cm server ,
628.Cm email ,
629.Cm objsign ,
630.Cm reserved ,
631.Cm sslCA ,
632.Cm emailCA ,
633.Cm objCA .
634.Sh ARBITRARY EXTENSIONS
635If an extension is not supported by the OpenSSL code, then it must
636be encoded using the arbitrary extension format.
637It is also possible to use the arbitrary format for supported
638extensions.
639Extreme care should be taken to ensure that the data is formatted
640correctly for the given extension type.
641.Pp
642There are two ways to encode arbitrary extensions.
643.Pp
644The first way is to use the word
645.Cm ASN1
646followed by the extension content using the same syntax as
647.Xr ASN1_generate_nconf 3 .
648For example:
649.Bd -literal -offset indent
6501.2.3.4=critical,ASN1:UTF8String:Some random data
6511.2.3.4=ASN1:SEQUENCE:seq_sect
652
653[seq_sect]
654field1 = UTF8:field1
655field2 = UTF8:field2
656.Ed
657.Pp
658It is also possible to use the word
659.Cm DER
660to include the raw encoded data in any extension.
661.Bd -literal -offset indent
6621.2.3.4=critical,DER:01:02:03:04
6631.2.3.4=DER:01020304
664.Ed
665.Pp
666The value following
667.Cm DER
668is a hex dump of the DER encoding of the extension.
669Any extension can be placed in this form to override the default behaviour.
670For example:
671.Pp
672.Dl basicConstraints=critical,DER:00:01:02:03
673.Sh FILES
674.Bl -tag -width /etc/ssl/x509v3.cnf -compact
675.It Pa /etc/ssl/x509v3.cnf
676standard configuration file
677.El
678.Sh SEE ALSO
679.Xr openssl 1 ,
680.Xr ASN1_generate_nconf 3 ,
681.Xr openssl.cnf 5
682.Sh HISTORY
683X509v3 extension code was first added to OpenSSL 0.9.2.
684.Sh CAVEATS
685There is no guarantee that a specific implementation will process a
686given extension.
687It may therefore sometimes be possible to use certificates for purposes
688prohibited by their extensions because a specific application does not
689recognize or honour the values of the relevant extensions.
690.Pp
691The
692.Cm DER
693and
694.Cm ASN1
695options should be used with caution.
696It is possible to create totally invalid extensions if they are not used
697carefully.
698.Pp
699If an extension is multi-value and a field value must contain a comma,
700the long form must be used.
701Otherwise the comma would be misinterpreted as a field separator.
702For example,
703.Pp
704.Dl subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
705.Pp
706will produce an error, but the following form is valid:
707.Bd -literal -offset indent
708subjectAltName=@subject_alt_section
709
710[subject_alt_section]
711subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar
712.Ed
713.Pp
714Due to the behaviour of the OpenSSL CONF library, the same field
715name can only occur once in a section.
716That means that
717.Bd -literal -offset indent
718subjectAltName=@alt_section
719
720[alt_section]
721email=steve@here
722email=steve@there
723.Ed
724.Pp
725will only use the last value.
726This can be worked around by using the form:
727.Bd -literal -offset indent
728[alt_section]
729email.1=steve@here
730email.2=steve@there
731.Ed