setup.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. #! /bin/sh
  2. # Primary root: root-cert
  3. # root cert variants: CA:false, key2, DN2
  4. # trust variants: +serverAuth -serverAuth +clientAuth -clientAuth +anyEKU -anyEKU
  5. #
  6. ./mkcert.sh genroot "Root CA" root-key root-cert
  7. ./mkcert.sh genss "Root CA" root-key root-nonca
  8. ./mkcert.sh genroot "Root CA" root-key2 root-cert2
  9. ./mkcert.sh genroot "Root Cert 2" root-key root-name2
  10. #
  11. openssl x509 -in root-cert.pem -trustout \
  12. -addtrust serverAuth -out root+serverAuth.pem
  13. openssl x509 -in root-cert.pem -trustout \
  14. -addreject serverAuth -out root-serverAuth.pem
  15. openssl x509 -in root-cert.pem -trustout \
  16. -addtrust clientAuth -out root+clientAuth.pem
  17. openssl x509 -in root-cert.pem -trustout \
  18. -addreject clientAuth -out root-clientAuth.pem
  19. openssl x509 -in root-cert.pem -trustout \
  20. -addreject anyExtendedKeyUsage -out root-anyEKU.pem
  21. openssl x509 -in root-cert.pem -trustout \
  22. -addtrust anyExtendedKeyUsage -out root+anyEKU.pem
  23. openssl x509 -in root-cert2.pem -trustout \
  24. -addtrust serverAuth -out root2+serverAuth.pem
  25. openssl x509 -in root-cert2.pem -trustout \
  26. -addreject serverAuth -out root2-serverAuth.pem
  27. openssl x509 -in root-cert2.pem -trustout \
  28. -addtrust clientAuth -out root2+clientAuth.pem
  29. openssl x509 -in root-nonca.pem -trustout \
  30. -addtrust serverAuth -out nroot+serverAuth.pem
  31. openssl x509 -in root-nonca.pem -trustout \
  32. -addtrust anyExtendedKeyUsage -out nroot+anyEKU.pem
  33. # Root CA security level variants:
  34. # MD5 self-signature
  35. OPENSSL_SIGALG=md5 \
  36. ./mkcert.sh genroot "Root CA" root-key root-cert-md5
  37. # 768-bit key
  38. OPENSSL_KEYBITS=768 \
  39. ./mkcert.sh genroot "Root CA" root-key-768 root-cert-768
  40. # primary client-EKU root: croot-cert
  41. # trust variants: +serverAuth -serverAuth +clientAuth +anyEKU -anyEKU
  42. #
  43. ./mkcert.sh genroot "Root CA" root-key croot-cert clientAuth
  44. #
  45. openssl x509 -in croot-cert.pem -trustout \
  46. -addtrust serverAuth -out croot+serverAuth.pem
  47. openssl x509 -in croot-cert.pem -trustout \
  48. -addreject serverAuth -out croot-serverAuth.pem
  49. openssl x509 -in croot-cert.pem -trustout \
  50. -addtrust clientAuth -out croot+clientAuth.pem
  51. openssl x509 -in croot-cert.pem -trustout \
  52. -addreject clientAuth -out croot-clientAuth.pem
  53. openssl x509 -in croot-cert.pem -trustout \
  54. -addreject anyExtendedKeyUsage -out croot-anyEKU.pem
  55. openssl x509 -in croot-cert.pem -trustout \
  56. -addtrust anyExtendedKeyUsage -out croot+anyEKU.pem
  57. # primary server-EKU root: sroot-cert
  58. # trust variants: +serverAuth -serverAuth +clientAuth +anyEKU -anyEKU
  59. #
  60. ./mkcert.sh genroot "Root CA" root-key sroot-cert serverAuth
  61. #
  62. openssl x509 -in sroot-cert.pem -trustout \
  63. -addtrust serverAuth -out sroot+serverAuth.pem
  64. openssl x509 -in sroot-cert.pem -trustout \
  65. -addreject serverAuth -out sroot-serverAuth.pem
  66. openssl x509 -in sroot-cert.pem -trustout \
  67. -addtrust clientAuth -out sroot+clientAuth.pem
  68. openssl x509 -in sroot-cert.pem -trustout \
  69. -addreject clientAuth -out sroot-clientAuth.pem
  70. openssl x509 -in sroot-cert.pem -trustout \
  71. -addreject anyExtendedKeyUsage -out sroot-anyEKU.pem
  72. openssl x509 -in sroot-cert.pem -trustout \
  73. -addtrust anyExtendedKeyUsage -out sroot+anyEKU.pem
  74. # Primary intermediate ca: ca-cert
  75. # ca variants: CA:false, key2, DN2, issuer2, expired
  76. # trust variants: +serverAuth, -serverAuth, +clientAuth, -clientAuth, -anyEKU, +anyEKU
  77. #
  78. ./mkcert.sh genca "CA" ca-key ca-cert root-key root-cert
  79. ./mkcert.sh genee "CA" ca-key ca-nonca root-key root-cert
  80. ./mkcert.sh gen_nonbc_ca "CA" ca-key ca-nonbc root-key root-cert
  81. ./mkcert.sh genca "CA" ca-key2 ca-cert2 root-key root-cert
  82. ./mkcert.sh genca "CA2" ca-key ca-name2 root-key root-cert
  83. ./mkcert.sh genca "CA" ca-key ca-root2 root-key2 root-cert2
  84. DAYS=-1 ./mkcert.sh genca "CA" ca-key ca-expired root-key root-cert
  85. #
  86. openssl x509 -in ca-cert.pem -trustout \
  87. -addtrust serverAuth -out ca+serverAuth.pem
  88. openssl x509 -in ca-cert.pem -trustout \
  89. -addreject serverAuth -out ca-serverAuth.pem
  90. openssl x509 -in ca-cert.pem -trustout \
  91. -addtrust clientAuth -out ca+clientAuth.pem
  92. openssl x509 -in ca-cert.pem -trustout \
  93. -addreject clientAuth -out ca-clientAuth.pem
  94. openssl x509 -in ca-cert.pem -trustout \
  95. -addreject anyExtendedKeyUsage -out ca-anyEKU.pem
  96. openssl x509 -in ca-cert.pem -trustout \
  97. -addtrust anyExtendedKeyUsage -out ca+anyEKU.pem
  98. openssl x509 -in ca-nonca.pem -trustout \
  99. -addtrust serverAuth -out nca+serverAuth.pem
  100. openssl x509 -in ca-nonca.pem -trustout \
  101. -addtrust serverAuth -out nca+anyEKU.pem
  102. # Intermediate CA security variants:
  103. # MD5 issuer signature,
  104. OPENSSL_SIGALG=md5 \
  105. ./mkcert.sh genca "CA" ca-key ca-cert-md5 root-key root-cert
  106. openssl x509 -in ca-cert-md5.pem -trustout \
  107. -addtrust anyExtendedKeyUsage -out ca-cert-md5-any.pem
  108. # Issuer has 768-bit key
  109. ./mkcert.sh genca "CA" ca-key ca-cert-768i root-key-768 root-cert-768
  110. # CA has 768-bit key
  111. OPENSSL_KEYBITS=768 \
  112. ./mkcert.sh genca "CA" ca-key-768 ca-cert-768 root-key root-cert
  113. # EC cert with explicit curve
  114. ./mkcert.sh genca "CA" ca-key-ec-explicit ca-cert-ec-explicit root-key root-cert
  115. # EC cert with named curve
  116. ./mkcert.sh genca "CA" ca-key-ec-named ca-cert-ec-named root-key root-cert
  117. # client intermediate ca: cca-cert
  118. # trust variants: +serverAuth, -serverAuth, +clientAuth, -clientAuth
  119. #
  120. ./mkcert.sh genca "CA" ca-key cca-cert root-key root-cert clientAuth
  121. #
  122. openssl x509 -in cca-cert.pem -trustout \
  123. -addtrust serverAuth -out cca+serverAuth.pem
  124. openssl x509 -in cca-cert.pem -trustout \
  125. -addreject serverAuth -out cca-serverAuth.pem
  126. openssl x509 -in cca-cert.pem -trustout \
  127. -addtrust clientAuth -out cca+clientAuth.pem
  128. openssl x509 -in cca-cert.pem -trustout \
  129. -addtrust clientAuth -out cca-clientAuth.pem
  130. openssl x509 -in cca-cert.pem -trustout \
  131. -addreject anyExtendedKeyUsage -out cca-anyEKU.pem
  132. openssl x509 -in cca-cert.pem -trustout \
  133. -addtrust anyExtendedKeyUsage -out cca+anyEKU.pem
  134. # server intermediate ca: sca-cert
  135. # trust variants: +serverAuth, -serverAuth, +clientAuth, -clientAuth, -anyEKU, +anyEKU
  136. #
  137. ./mkcert.sh genca "CA" ca-key sca-cert root-key root-cert serverAuth
  138. #
  139. openssl x509 -in sca-cert.pem -trustout \
  140. -addtrust serverAuth -out sca+serverAuth.pem
  141. openssl x509 -in sca-cert.pem -trustout \
  142. -addreject serverAuth -out sca-serverAuth.pem
  143. openssl x509 -in sca-cert.pem -trustout \
  144. -addtrust clientAuth -out sca+clientAuth.pem
  145. openssl x509 -in sca-cert.pem -trustout \
  146. -addreject clientAuth -out sca-clientAuth.pem
  147. openssl x509 -in sca-cert.pem -trustout \
  148. -addreject anyExtendedKeyUsage -out sca-anyEKU.pem
  149. openssl x509 -in sca-cert.pem -trustout \
  150. -addtrust anyExtendedKeyUsage -out sca+anyEKU.pem
  151. # Primary leaf cert: ee-cert
  152. # ee variants: expired, issuer-key2, issuer-name2, bad-pathlen
  153. # trust variants: +serverAuth, -serverAuth, +clientAuth, -clientAuth
  154. # purpose variants: client
  155. #
  156. ./mkcert.sh genee server.example ee-key ee-cert ca-key ca-cert
  157. ./mkcert.sh genee server.example ee-key ee-expired ca-key ca-cert -days -1
  158. ./mkcert.sh genee server.example ee-key ee-cert2 ca-key2 ca-cert2
  159. ./mkcert.sh genee server.example ee-key ee-name2 ca-key ca-name2
  160. ./mkcert.sh genee -p clientAuth server.example ee-key ee-client ca-key ca-cert
  161. ./mkcert.sh genee server.example ee-key ee-pathlen ca-key ca-cert \
  162. -extfile <(echo "basicConstraints=CA:FALSE,pathlen:0")
  163. #
  164. openssl x509 -in ee-cert.pem -trustout \
  165. -addtrust serverAuth -out ee+serverAuth.pem
  166. openssl x509 -in ee-cert.pem -trustout \
  167. -addreject serverAuth -out ee-serverAuth.pem
  168. openssl x509 -in ee-client.pem -trustout \
  169. -addtrust clientAuth -out ee+clientAuth.pem
  170. openssl x509 -in ee-client.pem -trustout \
  171. -addreject clientAuth -out ee-clientAuth.pem
  172. # Leaf cert security level variants
  173. # MD5 issuer signature
  174. OPENSSL_SIGALG=md5 \
  175. ./mkcert.sh genee server.example ee-key ee-cert-md5 ca-key ca-cert
  176. # 768-bit issuer key
  177. ./mkcert.sh genee server.example ee-key ee-cert-768i ca-key-768 ca-cert-768
  178. # 768-bit leaf key
  179. OPENSSL_KEYBITS=768 \
  180. ./mkcert.sh genee server.example ee-key-768 ee-cert-768 ca-key ca-cert
  181. # EC cert with explicit curve signed by named curve ca
  182. ./mkcert.sh genee server.example ee-key-ec-explicit ee-cert-ec-explicit ca-key-ec-named ca-cert-ec-named
  183. # EC cert with named curve signed by explicit curve ca
  184. ./mkcert.sh genee server.example ee-key-ec-named-explicit \
  185. ee-cert-ec-named-explicit ca-key-ec-explicit ca-cert-ec-explicit
  186. # EC cert with named curve signed by named curve ca
  187. ./mkcert.sh genee server.example ee-key-ec-named-named \
  188. ee-cert-ec-named-named ca-key-ec-named ca-cert-ec-named
  189. # 1024-bit leaf key
  190. OPENSSL_KEYBITS=1024 \
  191. ./mkcert.sh genee server.example ee-key-1024 ee-cert-1024 ca-key ca-cert
  192. # 3072-bit leaf key
  193. OPENSSL_KEYBITS=3072 \
  194. ./mkcert.sh genee server.example ee-key-3072 ee-cert-3072 ca-key ca-cert
  195. # 4096-bit leaf key
  196. OPENSSL_KEYBITS=4096 \
  197. ./mkcert.sh genee server.example ee-key-4096 ee-cert-4096 ca-key ca-cert
  198. # 8192-bit leaf key
  199. OPENSSL_KEYBITS=8192 \
  200. ./mkcert.sh genee server.example ee-key-8192 ee-cert-8192 ca-key ca-cert
  201. # self-signed end-entity cert with explicit keyUsage not including KeyCertSign
  202. openssl req -new -x509 -key ee-key.pem -subj /CN=ee-self-signed -out ee-self-signed.pem -addext keyUsage=digitalSignature -days 36500
  203. # Proxy certificates, off of ee-client
  204. # Start with some good ones
  205. ./mkcert.sh req pc1-key "0.CN = server.example" "1.CN = proxy 1" | \
  206. ./mkcert.sh genpc pc1-key pc1-cert ee-key ee-client \
  207. "language = id-ppl-anyLanguage" "pathlen = 1" "policy = text:AB"
  208. ./mkcert.sh req pc2-key "0.CN = server.example" "1.CN = proxy 1" "2.CN = proxy 2" | \
  209. ./mkcert.sh genpc pc2-key pc2-cert pc1-key pc1-cert \
  210. "language = id-ppl-anyLanguage" "pathlen = 0" "policy = text:AB"
  211. # And now a couple of bad ones
  212. # pc3: incorrect CN
  213. ./mkcert.sh req bad-pc3-key "0.CN = server.example" "1.CN = proxy 3" | \
  214. ./mkcert.sh genpc bad-pc3-key bad-pc3-cert pc1-key pc1-cert \
  215. "language = id-ppl-anyLanguage" "pathlen = 0" "policy = text:AB"
  216. # pc4: incorrect pathlen
  217. ./mkcert.sh req bad-pc4-key "0.CN = server.example" "1.CN = proxy 1" "2.CN = proxy 4" | \
  218. ./mkcert.sh genpc bad-pc4-key bad-pc4-cert pc1-key pc1-cert \
  219. "language = id-ppl-anyLanguage" "pathlen = 1" "policy = text:AB"
  220. # pc5: no policy
  221. ./mkcert.sh req pc5-key "0.CN = server.example" "1.CN = proxy 1" "2.CN = proxy 5" | \
  222. ./mkcert.sh genpc pc5-key pc5-cert pc1-key pc1-cert \
  223. "language = id-ppl-anyLanguage" "pathlen = 0"
  224. # pc6: incorrect CN (made into a component of a multivalue RDN)
  225. ./mkcert.sh req bad-pc6-key "0.CN = server.example" "1.CN = proxy 1" "2.+CN = proxy 6" | \
  226. ./mkcert.sh genpc bad-pc6-key bad-pc6-cert pc1-key pc1-cert \
  227. "language = id-ppl-anyLanguage" "pathlen = 0" "policy = text:AB"
  228. # Name constraints test certificates.
  229. # NC CA1 only permits the host www.good.org and *.good.com email address
  230. # good@good.org and *@good.com and IP addresses 127.0.0.1 and
  231. # 192.168.0.0/16
  232. NC="permitted;DNS:www.good.org, permitted;DNS:good.com,"
  233. NC="$NC permitted;email:good@good.org, permitted;email:good.com,"
  234. NC="$NC permitted;IP:127.0.0.1/255.255.255.255, permitted;IP:192.168.0.0/255.255.0.0"
  235. NC=$NC ./mkcert.sh genca "Test NC CA 1" ncca1-key ncca1-cert root-key root-cert
  236. # NC CA2 allows anything apart from hosts www.bad.org and *.bad.com
  237. # and email addresses bad@bad.org and *@bad.com
  238. NC="excluded;DNS:www.bad.org, excluded;DNS:bad.com,"
  239. NC="$NC excluded;email:bad@bad.org, excluded;email:bad.com, "
  240. NC="$NC excluded;IP:10.0.0.0/255.0.0.0"
  241. NC=$NC ./mkcert.sh genca "Test NC CA 2" ncca2-key ncca2-cert root-key root-cert
  242. # Name constraints subordinate CA. Adds www.good.net (which should be
  243. # disallowed because parent CA doesn't permit it) adds ok.good.com
  244. # (which should be allowed because parent allows *.good.com
  245. # and now excludes bad.ok.good.com (allowed in permitted subtrees
  246. # but explicitly excluded).
  247. NC="permitted;DNS:www.good.net, permitted;DNS:ok.good.com, "
  248. NC="$NC excluded;DNS:bad.ok.good.com"
  249. NC=$NC ./mkcert.sh genca "Test NC sub CA" ncca3-key ncca3-cert \
  250. ncca1-key ncca1-cert
  251. # all subjectAltNames allowed by CA1. Some CNs are not!
  252. ./mkcert.sh req alt1-key "O = Good NC Test Certificate 1" \
  253. "1.CN=www.example.net" "2.CN=Joe Bloggs" | \
  254. ./mkcert.sh geneealt alt1-key alt1-cert ncca1-key ncca1-cert \
  255. "DNS.1 = www.good.org" "DNS.2 = any.good.com" \
  256. "email.1 = good@good.org" "email.2 = any@good.com" \
  257. "IP = 127.0.0.1" "IP = 192.168.0.1"
  258. # all DNS-like CNs allowed by CA1, no DNS SANs.
  259. ./mkcert.sh req goodcn1-key "O = Good NC Test Certificate 1" \
  260. "1.CN=www.good.org" "2.CN=any.good.com" \
  261. "3.CN=not..dns" "4.CN=not@dns" "5.CN=not-.dns" "6.CN=not.dns." | \
  262. ./mkcert.sh geneealt goodcn1-key goodcn1-cert ncca1-key ncca1-cert \
  263. "IP = 127.0.0.1" "IP = 192.168.0.1"
  264. # Some DNS-like CNs not permitted by CA1, no DNS SANs.
  265. ./mkcert.sh req badcn1-key "O = Good NC Test Certificate 1" \
  266. "1.CN=www.good.org" "3.CN=bad.net" | \
  267. ./mkcert.sh geneealt badcn1-key badcn1-cert ncca1-key ncca1-cert \
  268. "IP = 127.0.0.1" "IP = 192.168.0.1"
  269. # no subjectAltNames excluded by CA2.
  270. ./mkcert.sh req alt2-key "O = Good NC Test Certificate 2" | \
  271. ./mkcert.sh geneealt alt2-key alt2-cert ncca2-key ncca2-cert \
  272. "DNS.1 = www.anything.org" "DNS.2 = any.other.com" \
  273. "email.1 = other@bad.org" "email.2 = any@something.com"
  274. # hostname other.good.org which is not allowed by CA1.
  275. ./mkcert.sh req badalt1-key "O = Bad NC Test Certificate 1" | \
  276. ./mkcert.sh geneealt badalt1-key badalt1-cert ncca1-key ncca1-cert \
  277. "DNS.1 = other.good.org" "DNS.2 = any.good.com" \
  278. "email.1 = good@good.org" "email.2 = any@good.com"
  279. # any.bad.com is excluded by CA2.
  280. ./mkcert.sh req badalt2-key 'O = Bad NC Test Certificate 2' | \
  281. ./mkcert.sh geneealt badalt2-key badalt2-cert ncca2-key ncca2-cert \
  282. "DNS.1 = www.good.org" "DNS.2 = any.bad.com" \
  283. "email.1 = good@good.org" "email.2 = any@good.com"
  284. # other@good.org not permitted by CA1
  285. ./mkcert.sh req badalt3-key "O = Bad NC Test Certificate 3" | \
  286. ./mkcert.sh geneealt badalt3-key badalt1-cert ncca1-key ncca1-cert \
  287. "DNS.1 = www.good.org" "DNS.2 = any.good.com" \
  288. "email.1 = other@good.org" "email.2 = any@good.com"
  289. # all subject alt names OK but subject email address not allowed by CA1.
  290. ./mkcert.sh req badalt4-key 'O = Bad NC Test Certificate 4' \
  291. "emailAddress = any@other.com" | \
  292. ./mkcert.sh geneealt badalt4-key badalt4-cert ncca1-key ncca1-cert \
  293. "DNS.1 = www.good.org" "DNS.2 = any.good.com" \
  294. "email.1 = good@good.org" "email.2 = any@good.com"
  295. # IP address not allowed by CA1
  296. ./mkcert.sh req badalt5-key "O = Bad NC Test Certificate 5" | \
  297. ./mkcert.sh geneealt badalt5-key badalt5-cert ncca1-key ncca1-cert \
  298. "DNS.1 = www.good.org" "DNS.2 = any.good.com" \
  299. "email.1 = good@good.org" "email.2 = any@good.com" \
  300. "IP = 127.0.0.2"
  301. # No DNS-ID SANs and subject CN not allowed by CA1.
  302. ./mkcert.sh req badalt6-key "O = Bad NC Test Certificate 6" \
  303. "1.CN=other.good.org" "2.CN=Joe Bloggs" "3.CN=any.good.com" | \
  304. ./mkcert.sh geneealt badalt6-key badalt6-cert ncca1-key ncca1-cert \
  305. "email.1 = good@good.org" "email.2 = any@good.com" \
  306. "IP = 127.0.0.1" "IP = 192.168.0.1"
  307. # No DNS-ID SANS and subject CN not allowed by CA1, BMPSTRING
  308. REQMASK=MASK:0x800 ./mkcert.sh req badalt7-key "O = Bad NC Test Certificate 7" \
  309. "1.CN=other.good.org" "2.CN=Joe Bloggs" "3.CN=any.good.com" | \
  310. ./mkcert.sh geneealt badalt7-key badalt7-cert ncca1-key ncca1-cert \
  311. "email.1 = good@good.org" "email.2 = any@good.com" \
  312. "IP = 127.0.0.1" "IP = 192.168.0.1"
  313. # all subjectAltNames allowed by chain
  314. ./mkcert.sh req alt3-key "O = Good NC Test Certificate 3" \
  315. "1.CN=www.ok.good.com" "2.CN=Joe Bloggs" | \
  316. ./mkcert.sh geneealt alt3-key alt3-cert ncca3-key ncca3-cert \
  317. "DNS.1 = www.ok.good.com" \
  318. "email.1 = good@good.org" "email.2 = any@good.com" \
  319. "IP = 127.0.0.1" "IP = 192.168.0.1"
  320. # www.good.net allowed by parent CA but not parent of parent
  321. ./mkcert.sh req badalt8-key "O = Bad NC Test Certificate 8" \
  322. "1.CN=www.good.com" "2.CN=Joe Bloggs" | \
  323. ./mkcert.sh geneealt badalt8-key badalt8-cert ncca3-key ncca3-cert \
  324. "DNS.1 = www.ok.good.com" "DNS.2 = www.good.net" \
  325. "email.1 = good@good.org" "email.2 = any@good.com" \
  326. "IP = 127.0.0.1" "IP = 192.168.0.1"
  327. # other.good.com not allowed by parent CA but allowed by parent of parent
  328. ./mkcert.sh req badalt9-key "O = Bad NC Test Certificate 9" \
  329. "1.CN=www.good.com" "2.CN=Joe Bloggs" | \
  330. ./mkcert.sh geneealt badalt9-key badalt9-cert ncca3-key ncca3-cert \
  331. "DNS.1 = www.good.com" "DNS.2 = other.good.com" \
  332. "email.1 = good@good.org" "email.2 = any@good.com" \
  333. "IP = 127.0.0.1" "IP = 192.168.0.1"
  334. # www.bad.net excluded by parent CA.
  335. ./mkcert.sh req badalt10-key "O = Bad NC Test Certificate 10" \
  336. "1.CN=www.ok.good.com" "2.CN=Joe Bloggs" | \
  337. ./mkcert.sh geneealt badalt10-key badalt10-cert ncca3-key ncca3-cert \
  338. "DNS.1 = www.ok.good.com" "DNS.2 = bad.ok.good.com" \
  339. "email.1 = good@good.org" "email.2 = any@good.com" \
  340. "IP = 127.0.0.1" "IP = 192.168.0.1"
  341. # RSA-PSS signatures
  342. # SHA1
  343. ./mkcert.sh genee PSS-SHA1 ee-key ee-pss-sha1-cert ca-key ca-cert \
  344. -sha1 -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:digest
  345. # SHA256
  346. ./mkcert.sh genee PSS-SHA256 ee-key ee-pss-sha256-cert ca-key ca-cert \
  347. -sha256 -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:digest
  348. OPENSSL_KEYALG=ec OPENSSL_KEYBITS=brainpoolP256r1 ./mkcert.sh genee \
  349. "Server ECDSA brainpoolP256r1 cert" server-ecdsa-brainpoolP256r1-key \
  350. server-ecdsa-brainpoolP256r1-cert rootkey rootcert
  351. openssl req -new -noenc -subj "/CN=localhost" \
  352. -newkey rsa-pss -keyout server-pss-restrict-key.pem \
  353. -pkeyopt rsa_pss_keygen_md:sha256 -pkeyopt rsa_pss_keygen_saltlen:32 | \
  354. ./mkcert.sh geneenocsr "Server RSA-PSS restricted cert" \
  355. server-pss-restrict-cert rootkey rootcert
  356. # CT entry
  357. ./mkcert.sh genct server.example embeddedSCTs1-key embeddedSCTs1 embeddedSCTs1_issuer-key embeddedSCTs1_issuer ct-server-key
  358. OPENSSL_SIGALG=ED448 OPENSSL_KEYALG=ed448 ./mkcert.sh genroot "Root Ed448" \
  359. root-ed448-key root-ed448-cert
  360. OPENSSL_SIGALG=ED448 OPENSSL_KEYALG=ed448 ./mkcert.sh genee ed448 \
  361. server-ed448-key server-ed448-cert root-ed448-key root-ed448-cert
  362. # non-critical unknown extension
  363. ./mkcert.sh geneeextra server.example ee-key ee-cert-noncrit-unknown-ext ca-key ca-cert "1.2.3.4=DER:05:00"
  364. # critical unknown extension
  365. ./mkcert.sh geneeextra server.example ee-key ee-cert-crit-unknown-ext ca-key ca-cert "1.2.3.4=critical,DER:05:00"
  366. # critical id-pkix-ocsp-no-check extension
  367. ./mkcert.sh geneeextra server.example ee-key ee-cert-ocsp-nocheck ca-key ca-cert "1.3.6.1.5.5.7.48.1.5=critical,DER:05:00"