root-ca.cnf 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #
  2. # OpenSSL configuration for the Root Certification Authority.
  3. #
  4. #
  5. # This definition doesn't work if HOME isn't defined.
  6. CA_HOME = .
  7. RANDFILE = $ENV::CA_HOME/private/.rnd
  8. #
  9. # Default Certification Authority
  10. [ ca ]
  11. default_ca = root_ca
  12. #
  13. # Root Certification Authority
  14. [ root_ca ]
  15. dir = $ENV::CA_HOME
  16. certs = $dir/certs
  17. serial = $dir/root-ca.serial
  18. database = $dir/root-ca.index
  19. new_certs_dir = $dir/newcerts
  20. certificate = $dir/root-ca.cert.pem
  21. private_key = $dir/private/root-ca.key.pem
  22. default_days = 1826 # Five years
  23. crl = $dir/root-ca.crl
  24. crl_dir = $dir/crl
  25. crlnumber = $dir/root-ca.crlnum
  26. name_opt = multiline, align
  27. cert_opt = no_pubkey
  28. copy_extensions = copy
  29. crl_extensions = crl_ext
  30. default_crl_days = 180
  31. default_md = sha256
  32. preserve = no
  33. email_in_dn = no
  34. policy = policy
  35. unique_subject = no
  36. #
  37. # Distinguished Name Policy for CAs
  38. [ policy ]
  39. countryName = optional
  40. stateOrProvinceName = optional
  41. localityName = optional
  42. organizationName = supplied
  43. organizationalUnitName = optional
  44. commonName = supplied
  45. #
  46. # Root CA Request Options
  47. [ req ]
  48. default_bits = 4096
  49. default_keyfile = private/root-ca.key.pem
  50. encrypt_key = yes
  51. default_md = sha256
  52. string_mask = utf8only
  53. utf8 = yes
  54. prompt = no
  55. req_extensions = root-ca_req_ext
  56. distinguished_name = distinguished_name
  57. subjectAltName = @subject_alt_name
  58. #
  59. # Root CA Request Extensions
  60. [ root-ca_req_ext ]
  61. subjectKeyIdentifier = hash
  62. subjectAltName = @subject_alt_name
  63. #
  64. # Distinguished Name (DN)
  65. [ distinguished_name ]
  66. organizationName = example.net
  67. commonName = example.net Root Certification Authority
  68. #
  69. # Root CA Certificate Extensions
  70. [ root-ca_ext ]
  71. basicConstraints = critical, CA:true
  72. keyUsage = critical, keyCertSign, cRLSign
  73. nameConstraints = critical, @name_constraints
  74. subjectKeyIdentifier = hash
  75. subjectAltName = @subject_alt_name
  76. authorityKeyIdentifier = keyid:always
  77. issuerAltName = issuer:copy
  78. authorityInfoAccess = @auth_info_access
  79. crlDistributionPoints = crl_dist
  80. #
  81. # Intermediate CA Certificate Extensions
  82. [ intermed-ca_ext ]
  83. basicConstraints = critical, CA:true, pathlen:0
  84. keyUsage = critical, keyCertSign, cRLSign
  85. subjectKeyIdentifier = hash
  86. subjectAltName = @subject_alt_name
  87. authorityKeyIdentifier = keyid:always
  88. issuerAltName = issuer:copy
  89. authorityInfoAccess = @auth_info_access
  90. crlDistributionPoints = crl_dist
  91. #
  92. # CRL Certificate Extensions
  93. [ crl_ext ]
  94. authorityKeyIdentifier = keyid:always
  95. issuerAltName = issuer:copy
  96. #
  97. # Certificate Authorities Alternative Names
  98. [ subject_alt_name ]
  99. URI = http://ca.example.net/
  100. email = certmaster@example.net
  101. #
  102. # Name Constraints
  103. [ name_constraints ]
  104. permitted;DNS.1 = example.net
  105. permitted;DNS.2 = example.org
  106. permitted;DNS.3 = lan
  107. permitted;DNS.4 = onion
  108. permitted;email.1 = example.net
  109. permitted;email.2 = example.org
  110. #
  111. # Certificate download addresses for the root CA
  112. [ auth_info_access ]
  113. caIssuers;URI = ROOTCRT
  114. #
  115. # CRL Download address for the root CA
  116. [ crl_dist ]
  117. fullname = URI:ROOTCRL