Oops! Get the pmatch test the right way round.
[openssl.git] / apps / openssl.cnf
1 #
2 # OpenSSL example configuration file.
3 # This is mostly being used for generation of certificate requests.
4 #
5
6 RANDFILE                = $ENV::HOME/.rnd
7 oid_file                = $ENV::HOME/.oid
8 oid_section             = new_oids
9
10 # To use this configuration file with the "-config" option of the
11 # "openssl x509" utility, name here the section containing the
12 # X.509v3 extensions to use:
13 # extensions            = 
14 # (Alternatively, use a configuration file that has only
15 # X.509v3 extensions in its main [= default] section.)
16
17 [ new_oids ]
18
19 # We can add new OIDs in here for use by 'ca' and 'req'.
20 # Add a simple OID like this:
21 # testoid1=1.2.3.4
22 # Or use config file substitution like this:
23 # testoid2=${testoid1}.5.6
24
25 ####################################################################
26 [ ca ]
27 default_ca      = CA_default            # The default ca section
28
29 ####################################################################
30 [ CA_default ]
31
32 dir             = ./demoCA              # Where everything is kept
33 certs           = $dir/certs            # Where the issued certs are kept
34 crl_dir         = $dir/crl              # Where the issued crl are kept
35 database        = $dir/index.txt        # database index file.
36 new_certs_dir   = $dir/newcerts         # default place for new certs.
37
38 certificate     = $dir/cacert.pem       # The CA certificate
39 serial          = $dir/serial           # The current serial number
40 crl             = $dir/crl.pem          # The current CRL
41 private_key     = $dir/private/cakey.pem# The private key
42 RANDFILE        = $dir/private/.rand    # private random number file
43
44 x509_extensions = usr_cert              # The extentions to add to the cert
45 crl_extensions  = crl_ext               # Extensions to add to CRL
46 default_days    = 365                   # how long to certify for
47 default_crl_days= 30                    # how long before next CRL
48 default_md      = md5                   # which md to use.
49 preserve        = no                    # keep passed DN ordering
50
51 # A few difference way of specifying how similar the request should look
52 # For type CA, the listed attributes must be the same, and the optional
53 # and supplied fields are just that :-)
54 policy          = policy_match
55
56 # For the CA policy
57 [ policy_match ]
58 countryName             = match
59 stateOrProvinceName     = match
60 organizationName        = match
61 organizationalUnitName  = optional
62 commonName              = supplied
63 emailAddress            = optional
64
65 # For the 'anything' policy
66 # At this point in time, you must list all acceptable 'object'
67 # types.
68 [ policy_anything ]
69 countryName             = optional
70 stateOrProvinceName     = optional
71 localityName            = optional
72 organizationName        = optional
73 organizationalUnitName  = optional
74 commonName              = supplied
75 emailAddress            = optional
76
77 ####################################################################
78 [ req ]
79 default_bits            = 1024
80 default_keyfile         = privkey.pem
81 distinguished_name      = req_distinguished_name
82 attributes              = req_attributes
83 x509_extensions = v3_ca # The extentions to add to the self signed cert
84
85 [ req_distinguished_name ]
86 countryName                     = Country Name (2 letter code)
87 countryName_default             = AU
88 countryName_min                 = 2
89 countryName_max                 = 2
90
91 stateOrProvinceName             = State or Province Name (full name)
92 stateOrProvinceName_default     = Some-State
93
94 localityName                    = Locality Name (eg, city)
95
96 0.organizationName              = Organization Name (eg, company)
97 0.organizationName_default      = Internet Widgits Pty Ltd
98
99 # we can do this but it is not needed normally :-)
100 #1.organizationName             = Second Organization Name (eg, company)
101 #1.organizationName_default     = World Wide Web Pty Ltd
102
103 organizationalUnitName          = Organizational Unit Name (eg, section)
104 #organizationalUnitName_default =
105
106 commonName                      = Common Name (eg, YOUR name)
107 commonName_max                  = 64
108
109 emailAddress                    = Email Address
110 emailAddress_max                = 40
111
112 # SET-ex3                       = SET extension number 3
113
114 [ req_attributes ]
115 challengePassword               = A challenge password
116 challengePassword_min           = 4
117 challengePassword_max           = 20
118
119 unstructuredName                = An optional company name
120
121 [ usr_cert ]
122
123 # These extensions are added when 'ca' signs a request.
124
125 # This goes against PKIX guidelines but some CAs do it and some software
126 # requires this to avoid interpreting an end user certificate as a CA.
127
128 basicConstraints=CA:FALSE
129
130 # Here are some examples of the usage of nsCertType. If it is omitted
131 # the certificate can be used for anything *except* object signing.
132
133 # This is OK for an SSL server.
134 #nsCertType                     = server
135
136 # For an object signing certificate this would be used.
137 #nsCertType = objsign
138
139 # For normal client use this is typical
140 #nsCertType = client, email
141
142 # This is typical also
143
144 keyUsage = nonRepudiation, digitalSignature, keyEncipherment
145
146 nsComment                       = "OpenSSL Generated Certificate"
147
148 # PKIX recommendations
149 subjectKeyIdentifier=hash
150 authorityKeyIdentifier=keyid,issuer:always
151
152 # Import the email address.
153
154 subjectAltName=email:copy
155
156 # Copy subject details
157
158 issuerAltName=issuer:copy
159
160 #nsCaRevocationUrl              = http://www.domain.dom/ca-crl.pem
161 #nsBaseUrl
162 #nsRevocationUrl
163 #nsRenewalUrl
164 #nsCaPolicyUrl
165 #nsSslServerName
166
167 [ v3_ca]
168
169 # Extensions for a typical CA
170
171 # It's a CA certificate
172 basicConstraints = CA:true
173
174 # PKIX recommendation.
175
176 subjectKeyIdentifier=hash
177
178 authorityKeyIdentifier=keyid:always,issuer:always
179
180 # This is what PKIX recommends but some broken software chokes on critical
181 # extensions.
182 #basicConstraints = critical,CA:true
183
184 # Key usage: again this should really be critical.
185 keyUsage = cRLSign, keyCertSign
186
187 # Some might want this also
188 #nsCertType = sslCA, emailCA
189
190 # Include email address in subject alt name: another PKIX recommendation
191 subjectAltName=email:copy
192 # Copy issuer details
193 issuerAltName=issuer:copy
194
195 # RAW DER hex encoding of an extension: beware experts only!
196 # 1.2.3.5=RAW:02:03
197 # You can even override a supported extension:
198 # basicConstraints= critical, RAW:30:03:01:01:FF
199
200 [ crl_ext ]
201
202 # CRL extensions.
203 # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
204
205 issuerAltName=issuer:copy
206 authorityKeyIdentifier=keyid:always,issuer:always