test: add import and export key management hooks for the TLS provider.
[openssl.git] / apps / openssl.cnf
1 #
2 # OpenSSL example configuration file.
3 # See doc/man5/config.pod for more info.
4 #
5 # This is mostly being used for generation of certificate requests,
6 # but may be used for auto loading of providers
7
8 # Note that you can include other files from the main configuration
9 # file using the .include directive.
10 #.include filename
11
12 # This definition stops the following lines choking if HOME isn't
13 # defined.
14 HOME                    = .
15
16  # Use this in order to automatically load providers.
17 openssl_conf = openssl_init
18
19 # Comment this out if you deliberately want to ignore
20 # configuration errors
21 config_diagnostics = 1
22
23 # Extra OBJECT IDENTIFIER info:
24 # oid_file       = $ENV::HOME/.oid
25 oid_section = new_oids
26
27 # To use this configuration file with the "-extfile" option of the
28 # "openssl x509" utility, name here the section containing the
29 # X.509v3 extensions to use:
30 # extensions            =
31 # (Alternatively, use a configuration file that has only
32 # X.509v3 extensions in its main [= default] section.)
33
34 [ new_oids ]
35 # We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
36 # Add a simple OID like this:
37 # testoid1=1.2.3.4
38 # Or use config file substitution like this:
39 # testoid2=${testoid1}.5.6
40
41 # Policies used by the TSA examples.
42 tsa_policy1 = 1.2.3.4.1
43 tsa_policy2 = 1.2.3.4.5.6
44 tsa_policy3 = 1.2.3.4.5.7
45
46 # For FIPS
47 # Optionally include a file that is generated by the OpenSSL fipsinstall
48 # application. This file contains configuration data required by the OpenSSL
49 # fips provider. It contains a named section e.g. [fips_sect] which is
50 # referenced from the [provider_sect] below.
51 # Refer to the OpenSSL security policy for more information.
52 # .include fipsmodule.cnf
53
54 [openssl_init]
55 providers = provider_sect
56
57 # List of providers to load
58 [provider_sect]
59 default = default_sect
60 # The fips section name should match the section name inside the
61 # included fipsmodule.cnf.
62 # fips = fips_sect
63
64 [default_sect]
65 # activate = 1
66
67
68 ####################################################################
69 [ ca ]
70 default_ca      = CA_default            # The default ca section
71
72 ####################################################################
73 [ CA_default ]
74
75 dir             = ./demoCA              # Where everything is kept
76 certs           = $dir/certs            # Where the issued certs are kept
77 crl_dir         = $dir/crl              # Where the issued crl are kept
78 database        = $dir/index.txt        # database index file.
79 #unique_subject = no                    # Set to 'no' to allow creation of
80                                         # several certs with same subject.
81 new_certs_dir   = $dir/newcerts         # default place for new certs.
82
83 certificate     = $dir/cacert.pem       # The CA certificate
84 serial          = $dir/serial           # The current serial number
85 crlnumber       = $dir/crlnumber        # the current crl number
86                                         # must be commented out to leave a V1 CRL
87 crl             = $dir/crl.pem          # The current CRL
88 private_key     = $dir/private/cakey.pem# The private key
89
90 x509_extensions = usr_cert              # The extensions to add to the cert
91
92 # Comment out the following two lines for the "traditional"
93 # (and highly broken) format.
94 name_opt        = ca_default            # Subject Name options
95 cert_opt        = ca_default            # Certificate field options
96
97 # Extension copying option: use with caution.
98 # copy_extensions = copy
99
100 # Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
101 # so this is commented out by default to leave a V1 CRL.
102 # crlnumber must also be commented out to leave a V1 CRL.
103 # crl_extensions        = crl_ext
104
105 default_days    = 365                   # how long to certify for
106 default_crl_days= 30                    # how long before next CRL
107 default_md      = default               # use public key default MD
108 preserve        = no                    # keep passed DN ordering
109
110 # A few difference way of specifying how similar the request should look
111 # For type CA, the listed attributes must be the same, and the optional
112 # and supplied fields are just that :-)
113 policy          = policy_match
114
115 # For the CA policy
116 [ policy_match ]
117 countryName             = match
118 stateOrProvinceName     = match
119 organizationName        = match
120 organizationalUnitName  = optional
121 commonName              = supplied
122 emailAddress            = optional
123
124 # For the 'anything' policy
125 # At this point in time, you must list all acceptable 'object'
126 # types.
127 [ policy_anything ]
128 countryName             = optional
129 stateOrProvinceName     = optional
130 localityName            = optional
131 organizationName        = optional
132 organizationalUnitName  = optional
133 commonName              = supplied
134 emailAddress            = optional
135
136 ####################################################################
137 [ req ]
138 default_bits            = 2048
139 default_keyfile         = privkey.pem
140 distinguished_name      = req_distinguished_name
141 attributes              = req_attributes
142 x509_extensions = v3_ca # The extensions to add to the self signed cert
143
144 # Passwords for private keys if not present they will be prompted for
145 # input_password = secret
146 # output_password = secret
147
148 # This sets a mask for permitted string types. There are several options.
149 # default: PrintableString, T61String, BMPString.
150 # pkix   : PrintableString, BMPString (PKIX recommendation before 2004)
151 # utf8only: only UTF8Strings (PKIX recommendation after 2004).
152 # nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
153 # MASK:XXXX a literal mask value.
154 # WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
155 string_mask = utf8only
156
157 # req_extensions = v3_req # The extensions to add to a certificate request
158
159 [ req_distinguished_name ]
160 countryName                     = Country Name (2 letter code)
161 countryName_default             = AU
162 countryName_min                 = 2
163 countryName_max                 = 2
164
165 stateOrProvinceName             = State or Province Name (full name)
166 stateOrProvinceName_default     = Some-State
167
168 localityName                    = Locality Name (eg, city)
169
170 0.organizationName              = Organization Name (eg, company)
171 0.organizationName_default      = Internet Widgits Pty Ltd
172
173 # we can do this but it is not needed normally :-)
174 #1.organizationName             = Second Organization Name (eg, company)
175 #1.organizationName_default     = World Wide Web Pty Ltd
176
177 organizationalUnitName          = Organizational Unit Name (eg, section)
178 #organizationalUnitName_default =
179
180 commonName                      = Common Name (e.g. server FQDN or YOUR name)
181 commonName_max                  = 64
182
183 emailAddress                    = Email Address
184 emailAddress_max                = 64
185
186 # SET-ex3                       = SET extension number 3
187
188 [ req_attributes ]
189 challengePassword               = A challenge password
190 challengePassword_min           = 4
191 challengePassword_max           = 20
192
193 unstructuredName                = An optional company name
194
195 [ usr_cert ]
196
197 # These extensions are added when 'ca' signs a request.
198
199 # This goes against PKIX guidelines but some CAs do it and some software
200 # requires this to avoid interpreting an end user certificate as a CA.
201
202 basicConstraints=CA:FALSE
203
204 # This is typical in keyUsage for a client certificate.
205 # keyUsage = nonRepudiation, digitalSignature, keyEncipherment
206
207 # PKIX recommendations harmless if included in all certificates.
208 subjectKeyIdentifier=hash
209 authorityKeyIdentifier=keyid,issuer
210
211 # This stuff is for subjectAltName and issuerAltname.
212 # Import the email address.
213 # subjectAltName=email:copy
214 # An alternative to produce certificates that aren't
215 # deprecated according to PKIX.
216 # subjectAltName=email:move
217
218 # Copy subject details
219 # issuerAltName=issuer:copy
220
221 # This is required for TSA certificates.
222 # extendedKeyUsage = critical,timeStamping
223
224 [ v3_req ]
225
226 # Extensions to add to a certificate request
227
228 basicConstraints = CA:FALSE
229 keyUsage = nonRepudiation, digitalSignature, keyEncipherment
230
231 [ v3_ca ]
232
233
234 # Extensions for a typical CA
235
236
237 # PKIX recommendation.
238
239 subjectKeyIdentifier=hash
240
241 authorityKeyIdentifier=keyid:always,issuer
242
243 basicConstraints = critical,CA:true
244
245 # Key usage: this is typical for a CA certificate. However since it will
246 # prevent it being used as an test self-signed certificate it is best
247 # left out by default.
248 # keyUsage = cRLSign, keyCertSign
249
250 # Include email address in subject alt name: another PKIX recommendation
251 # subjectAltName=email:copy
252 # Copy issuer details
253 # issuerAltName=issuer:copy
254
255 # DER hex encoding of an extension: beware experts only!
256 # obj=DER:02:03
257 # Where 'obj' is a standard or added object
258 # You can even override a supported extension:
259 # basicConstraints= critical, DER:30:03:01:01:FF
260
261 [ crl_ext ]
262
263 # CRL extensions.
264 # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
265
266 # issuerAltName=issuer:copy
267 authorityKeyIdentifier=keyid:always
268
269 [ proxy_cert_ext ]
270 # These extensions should be added when creating a proxy certificate
271
272 # This goes against PKIX guidelines but some CAs do it and some software
273 # requires this to avoid interpreting an end user certificate as a CA.
274
275 basicConstraints=CA:FALSE
276
277 # This is typical in keyUsage for a client certificate.
278 # keyUsage = nonRepudiation, digitalSignature, keyEncipherment
279
280 # PKIX recommendations harmless if included in all certificates.
281 subjectKeyIdentifier=hash
282 authorityKeyIdentifier=keyid,issuer
283
284 # This stuff is for subjectAltName and issuerAltname.
285 # Import the email address.
286 # subjectAltName=email:copy
287 # An alternative to produce certificates that aren't
288 # deprecated according to PKIX.
289 # subjectAltName=email:move
290
291 # Copy subject details
292 # issuerAltName=issuer:copy
293
294 # This really needs to be in place for it to be a proxy certificate.
295 proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
296
297 ####################################################################
298 [ tsa ]
299
300 default_tsa = tsa_config1       # the default TSA section
301
302 [ tsa_config1 ]
303
304 # These are used by the TSA reply generation only.
305 dir             = ./demoCA              # TSA root directory
306 serial          = $dir/tsaserial        # The current serial number (mandatory)
307 crypto_device   = builtin               # OpenSSL engine to use for signing
308 signer_cert     = $dir/tsacert.pem      # The TSA signing certificate
309                                         # (optional)
310 certs           = $dir/cacert.pem       # Certificate chain to include in reply
311                                         # (optional)
312 signer_key      = $dir/private/tsakey.pem # The TSA private key (optional)
313 signer_digest  = sha256                 # Signing digest to use. (Optional)
314 default_policy  = tsa_policy1           # Policy if request did not specify it
315                                         # (optional)
316 other_policies  = tsa_policy2, tsa_policy3      # acceptable policies (optional)
317 digests     = sha1, sha256, sha384, sha512  # Acceptable message digests (mandatory)
318 accuracy        = secs:1, millisecs:500, microsecs:100  # (optional)
319 clock_precision_digits  = 0     # number of digits after dot. (optional)
320 ordering                = yes   # Is ordering defined for timestamps?
321                                 # (optional, default: no)
322 tsa_name                = yes   # Must the TSA name be included in the reply?
323                                 # (optional, default: no)
324 ess_cert_id_chain       = no    # Must the ESS cert id chain be included?
325                                 # (optional, default: no)
326 ess_cert_id_alg         = sha1  # algorithm to compute certificate
327                                 # identifier (optional, default: sha1)
328
329 [insta] # CMP using Insta Demo CA
330 # Message transfer
331 server = pki.certificate.fi:8700
332 # proxy = # set this as far as needed, e.g., http://192.168.1.1:8080
333 # tls_use = 0
334 path = pkix/
335
336 # Server authentication
337 recipient = "/C=FI/O=Insta Demo/CN=Insta Demo CA" # or set srvcert or issuer
338 ignore_keyusage = 1 # potentially needed quirk
339 unprotected_errors = 1 # potentially needed quirk
340 extracertsout = insta.extracerts.pem
341
342 # Client authentication
343 ref = 3078 # user identification
344 secret = pass:insta # can be used for both client and server side
345
346 # Generic message options
347 cmd = ir # default operation, can be overridden on cmd line with, e.g., kur
348
349 # Certificate enrollment
350 subject = "/CN=openssl-cmp-test"
351 newkey = insta.priv.pem
352 out_trusted = insta.ca.crt
353 certout = insta.cert.pem
354
355 [pbm] # Password-based protection for Insta CA
356 # Server and client authentication
357 ref = $insta::ref # 3078
358 secret = $insta::secret # pass:insta
359
360 [signature] # Signature-based protection for Insta CA
361 # Server authentication
362 trusted = insta.ca.crt # does not include keyUsage digitalSignature
363
364 # Client authentication
365 secret = # disable PBM
366 key = $insta::newkey # insta.priv.pem
367 cert = $insta::certout # insta.cert.pem
368
369 [ir]
370 cmd = ir
371
372 [cr]
373 cmd = cr
374
375 [kur]
376 # Certificate update
377 cmd = kur
378 oldcert = $insta::certout # insta.cert.pem
379
380 [rr]
381 # Certificate revocation
382 cmd = rr
383 oldcert = $insta::certout # insta.cert.pem