wolfssl.cnf 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. #
  2. # wolfssl configuration file
  3. #
  4. HOME = .
  5. RANDFILE = $ENV::HOME/.rnd
  6. oid_section = new_oids
  7. [ new_oids ]
  8. # Policies used by the TSA examples.
  9. tsa_policy1 = 1.2.3.4.1
  10. tsa_policy2 = 1.2.3.4.5.6
  11. tsa_policy3 = 1.2.3.4.5.7
  12. ####################################################################
  13. [ ca ]
  14. default_ca = CA_default # The default ca section
  15. ####################################################################
  16. [ CA_default ]
  17. ####################################################################
  18. # CHANGE THIS LINE TO BE YOUR WOLFSSL_ROOT DIRECTORY #
  19. # #
  20. dir = $HOME./.. #
  21. ####################################################################
  22. certs = $dir/certs # Where the issued certs are kept
  23. crl_dir = $dir/certs/crl # Where the issued crl are kept
  24. database = $dir/certs/crl/demoCA/index.txt # database index file.
  25. new_certs_dir = $dir/certs # default place for new certs.
  26. certificate = $dir/certs/ca-cert.pem # The CA certificate
  27. serial = $dir/certs/serial # The current serial number
  28. crlnumber = $dir/certs/crl/crlnumber # the current crl number
  29. crl = $dir/certs/crl/crl.pem # The current CRL
  30. private_key = $dir/certs/ca-key.pem # The private key
  31. RANDFILE = $dir/certs/private/.rand # private random number file
  32. x509_extensions = usr_cert # The extensions to add to the cert
  33. name_opt = ca_default # Subject Name options
  34. cert_opt = ca_default # Certificate field options
  35. default_days = 1000 # how long to certify for
  36. default_crl_days = 30 # how long before next CRL
  37. default_md = default # use public key default MD
  38. preserve = no # keep passed DN ordering
  39. policy = policy_match
  40. # For the CA policy
  41. [ policy_match ]
  42. countryName = match
  43. stateOrProvinceName = match
  44. organizationName = match
  45. organizationalUnitName = optional
  46. commonName = supplied
  47. emailAddress = optional
  48. # For the 'anything' policy
  49. [ policy_anything ]
  50. countryName = optional
  51. stateOrProvinceName = optional
  52. localityName = optional
  53. organizationName = optional
  54. organizationalUnitName = optional
  55. commonName = supplied
  56. emailAddress = optional
  57. # default req
  58. [ req ]
  59. default_bits = 2048
  60. default_keyfile = privkey.pem
  61. distinguished_name = req_distinguished_name
  62. attributes = req_attributes
  63. x509_extensions = v3_ca # The extensions to add to the self signed cert
  64. string_mask = utf8only
  65. #default req_dist_name
  66. [ req_distinguished_name ]
  67. countryName = Country Name (2 letter code)
  68. countryName_default = US
  69. countryName_min = 2
  70. countryName_max = 2
  71. stateOrProvinceName = State or Province Name (full name)
  72. stateOrProvinceName_default = Montana
  73. localityName = Locality Name (eg, city)
  74. localityName_default = Bozeman
  75. 0.organizationName = Organization Name (eg, company)
  76. 0.organizationName_default = Sawtooth
  77. organizationalUnitName = Organizational Unit Name (eg, section)
  78. organizationalUnitName_default = Consulting
  79. commonName = Common Name (e.g. server FQDN or YOUR name)
  80. commonName_default = www.wolfssl.com
  81. commonName_max = 64
  82. emailAddress = Email Address
  83. emailAddress_default = info@wolfssl.com
  84. emailAddress_max = 64
  85. userId = User ID
  86. userId_default = wolfSSL
  87. #default req_attr
  88. [ req_attributes ]
  89. challengePassword = A challenge password
  90. challengePassword_min = 4
  91. challengePassword_max = 20
  92. unstructuredName = An optional company name
  93. # These extensions are added when 'ca' signs a request.
  94. [ usr_cert ]
  95. basicConstraints=CA:FALSE
  96. nsComment = "wolfSSL Generated Certificate using openSSL command line utility."
  97. subjectKeyIdentifier=hash
  98. authorityKeyIdentifier=keyid,issuer
  99. #wolfssl extensions
  100. [wolfssl_opts]
  101. subjectKeyIdentifier=hash
  102. authorityKeyIdentifier=keyid:always,issuer:always
  103. basicConstraints=CA:true
  104. subjectAltName=DNS:example.com, IP:127.0.0.1
  105. extendedKeyUsage=serverAuth, clientAuth
  106. #wolfssl extensions for intermediate CAs
  107. [wolfssl_opts_ICA]
  108. subjectKeyIdentifier=hash
  109. authorityKeyIdentifier=keyid:always,issuer:always
  110. basicConstraints=CA:true
  111. keyUsage=keyCertSign, cRLSign
  112. # CA with pathlen 0
  113. [ pathlen_0 ]
  114. subjectKeyIdentifier=hash
  115. authorityKeyIdentifier=keyid:always,issuer:always
  116. basicConstraints=CA:true,pathlen:0
  117. keyUsage=keyCertSign, cRLSign
  118. # CA with pathlen 1
  119. [ pathlen_1 ]
  120. subjectKeyIdentifier=hash
  121. authorityKeyIdentifier=keyid:always,issuer:always
  122. basicConstraints=CA:true,pathlen:1
  123. keyUsage=keyCertSign, cRLSign
  124. # CA with pathlen 127
  125. [ pathlen_127 ]
  126. subjectKeyIdentifier=hash
  127. authorityKeyIdentifier=keyid:always,issuer:always
  128. basicConstraints=CA:true,pathlen:127
  129. keyUsage=keyCertSign, cRLSign
  130. # CA with pathlen 100
  131. [ pathlen_100 ]
  132. subjectKeyIdentifier=hash
  133. authorityKeyIdentifier=keyid:always,issuer:always
  134. basicConstraints=CA:true,pathlen:100
  135. keyUsage=keyCertSign, cRLSign
  136. # CA with pathlen 128
  137. [ pathlen_128 ]
  138. subjectKeyIdentifier=hash
  139. authorityKeyIdentifier=keyid:always,issuer:always
  140. basicConstraints=CA:true,pathlen:128
  141. keyUsage=keyCertSign, cRLSign
  142. # CA with pathlen 5
  143. [ pathlen_5 ]
  144. subjectKeyIdentifier=hash
  145. authorityKeyIdentifier=keyid:always,issuer:always
  146. basicConstraints=CA:true,pathlen:5
  147. keyUsage=keyCertSign, cRLSign
  148. # CA with pathlen 10
  149. [ pathlen_10 ]
  150. subjectKeyIdentifier=hash
  151. authorityKeyIdentifier=keyid:always,issuer:always
  152. basicConstraints=CA:true,pathlen:10
  153. keyUsage=keyCertSign, cRLSign
  154. # CA with pathlen 20
  155. [ pathlen_20 ]
  156. subjectKeyIdentifier=hash
  157. authorityKeyIdentifier=keyid:always,issuer:always
  158. basicConstraints=CA:true,pathlen:20
  159. keyUsage=keyCertSign, cRLSign
  160. # CA with pathlen 99
  161. [ pathlen_99 ]
  162. subjectKeyIdentifier=hash
  163. authorityKeyIdentifier=keyid:always,issuer:always
  164. basicConstraints=CA:true,pathlen:99
  165. keyUsage=keyCertSign, cRLSign
  166. # CA with pathlen 2
  167. [ pathlen_2 ]
  168. subjectKeyIdentifier=hash
  169. authorityKeyIdentifier=keyid:always,issuer:always
  170. basicConstraints=CA:true,pathlen:2
  171. keyUsage=keyCertSign, cRLSign
  172. # test pathlen server cert
  173. [ test_pathlen ]
  174. subjectKeyIdentifier=hash
  175. authorityKeyIdentifier=keyid:always,issuer:always
  176. basicConstraints=CA:false
  177. [ entity_no_CA_BOOL ]
  178. subjectKeyIdentifier=hash
  179. authorityKeyIdentifier=keyid:always,issuer:always
  180. basicConstraints=pathlen:0
  181. keyUsage=digitalSignature
  182. extendedKeyUsage=clientAuth,serverAuth
  183. # Extensions to add to a certificate request
  184. [ v3_req ]
  185. basicConstraints = CA:FALSE
  186. keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  187. # Extensions for a typical CA
  188. [ v3_ca ]
  189. subjectKeyIdentifier=hash
  190. authorityKeyIdentifier=keyid:always,issuer:always
  191. basicConstraints = CA:true
  192. # CRL extensions.
  193. [ crl_ext ]
  194. authorityKeyIdentifier=keyid:always
  195. # These extensions should be added when creating a proxy certificate
  196. [ proxy_cert_ext ]
  197. basicConstraints=CA:FALSE
  198. nsComment = "wolfSSL Generated Certificate using openSSL command line utility"
  199. subjectKeyIdentifier=hash
  200. authorityKeyIdentifier=keyid,issuer
  201. proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
  202. # Test of rejecting duplicate policy extension OIDs
  203. [ policy_test ]
  204. subjectKeyIdentifier=hash
  205. authorityKeyIdentifier=keyid:always,issuer:always
  206. basicConstraints=CA:FALSE
  207. certificatePolicies=1.2.3.4,@policy_add
  208. [ policy_add ]
  209. policyIdentifier=1.2.3.4
  210. CPS.1="www.wolfssl.com"
  211. userNotice.1=@policy_usr
  212. [ policy_usr ]
  213. explicitText="Test of duplicate OIDs with different qualifiers"
  214. # create certificate without the digitalSignature bit set and uses sha1 sig
  215. [ digsigku ]
  216. subjectKeyIdentifier=hash
  217. authorityKeyIdentifier=keyid:always,issuer:always
  218. basicConstraints=critical, CA:TRUE
  219. keyUsage=critical, nonRepudiation, keyEncipherment
  220. # ca-ecc-cert extensions
  221. [ ca_ecc_cert ]
  222. subjectKeyIdentifier=hash
  223. authorityKeyIdentifier=keyid:always
  224. basicConstraints=critical, CA:TRUE
  225. keyUsage=critical, digitalSignature, keyCertSign, cRLSign
  226. # server-ecc extensions
  227. [ server_ecc ]
  228. subjectKeyIdentifier=hash
  229. authorityKeyIdentifier=keyid:always
  230. basicConstraints=critical, CA:FALSE
  231. keyUsage=critical, digitalSignature, keyEncipherment, keyAgreement
  232. extendedKeyUsage=serverAuth
  233. nsCertType=server
  234. # client-ecc extensions
  235. [ client_ecc ]
  236. subjectKeyIdentifier=hash
  237. authorityKeyIdentifier=keyid:always
  238. basicConstraints=critical, CA:FALSE
  239. keyUsage=critical, digitalSignature, keyEncipherment, keyAgreement
  240. extendedKeyUsage=clientAuth
  241. # test parsing URI
  242. [ uri ]
  243. subjectKeyIdentifier=hash
  244. authorityKeyIdentifier=keyid:always,issuer:always
  245. basicConstraints=CA:false
  246. subjectAltName=URI:https://www.wolfssl.com
  247. # test parsing relative URI
  248. [ relative_uri ]
  249. subjectKeyIdentifier=hash
  250. authorityKeyIdentifier=keyid:always,issuer:always
  251. basicConstraints=CA:false
  252. subjectAltName=URI:../relative/page.html
  253. # client cert ext
  254. [ client_cert_ext ]
  255. subjectKeyIdentifier=hash
  256. authorityKeyIdentifier=keyid:always,issuer:always
  257. basicConstraints=CA:true
  258. subjectAltName=DNS:example.com
  259. keyUsage=critical, digitalSignature, keyCertSign, cRLSign
  260. # test CRL distribution points
  261. [ crl_dist_points ]
  262. crlDistributionPoints=URI:http://www.wolfssl.com/crl.pem
  263. #tsa default
  264. [ tsa ]
  265. default_tsa = tsa_config1
  266. # These are used by the TSA reply generation only.
  267. [ tsa_config1 ]
  268. dir = ./demoCA # directory
  269. serial = $dir/tsaserial # (mandatory)
  270. crypto_device = builtin # engine
  271. signer_cert = $dir/tsacert.pem # certificate
  272. certs = $dir/cacert.pem # chain
  273. signer_key = $dir/private/tsakey.pem # (optional)
  274. default_policy = tsa_policy1 # Policy
  275. other_policies = tsa_policy2, tsa_policy3 # (optional)
  276. digests = md5, sha1 # (mandatory)
  277. accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
  278. clock_precision_digits = 0 # (optional)
  279. ordering = yes # timestamps?
  280. tsa_name = yes # include?
  281. ess_cert_id_chain = no # include chain?
  282. [fpki_ext]
  283. basicConstraints = CA:FALSE,pathlen:0
  284. subjectKeyIdentifier = hash
  285. authorityKeyIdentifier = keyid
  286. keyUsage = critical, digitalSignature
  287. extendedKeyUsage = critical, clientAuth, 1.3.6.1.4.1.311.20.2.2, 1.3.6.1.5.2.3.4, 1.3.6.1.5.5.7.3.21
  288. subjectAltName = @FASC_UUID_altname
  289. certificatePolicies = 2.16.840.1.101.3.2.1.3.13, 2.16.840.1.101.3.2.1.3.40, 2.16.840.1.101.3.2.1.3.41, 2.16.840.1.101.3.2.1.3.45
  290. subjectDirectoryAttributes = ASN1:SEQUENCE:SubjDirAttr
  291. policyConstraints = requireExplicitPolicy:0
  292. 2.16.840.1.101.3.6.10.1 = ASN1:SEQUENCE:PIVCertExt
  293. # using example UUID from RFC4122
  294. [FASC_UUID_altname]
  295. otherName.1 = 1.3.6.1.4.1.311.20.2.3;UTF8:facts@wolfssl.com
  296. otherName.2 = 2.16.840.1.101.3.6.6;FORMAT:HEX,OCT:D1:38:10:D8:28:AF:2C:10:84:35:15:A1:68:58:28:AF:02:10:86:A2:84:E7:39:C3:EB
  297. URI = urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6
  298. [SubjDirAttr]
  299. attribute = SEQUENCE:SDA_attr
  300. [SDA_attr]
  301. type = OID:1.3.6.1.5.5.7.9.4
  302. values = SET:SDA_coc
  303. [SDA_coc]
  304. value = PRINTABLESTRING:US
  305. [PIVCertExt]
  306. attribute = SEQUENCE:PCE_attr
  307. [PCE_attr]
  308. type = OID:2.16.840.1.101.3.6.9.1
  309. value = BOOLEAN:true