openssl.cnf 11 KB

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