Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # prerequisite:
  2. # install step cli
  3. # from: https://github.com/smallstep/cli
  4. all: ca disjunct-ca intermediate leaf \
  5. pkcs12-nopass pkcs12-disjunct pkcs12-multibag pkcs12-withpass-1234
  6. clean:
  7. rm *.{pfx,crt,key,pem}
  8. ca:
  9. step certificate create root-ca \
  10. root-ca.crt root-ca.key \
  11. --profile root-ca --kty OKP --curve Ed25519 \
  12. --no-password --insecure -f
  13. disjunct-ca:
  14. step certificate create disjunct-root-ca \
  15. disjunct-root-ca.crt disjunct-root-ca.key \
  16. --profile root-ca --kty OKP --curve Ed25519 \
  17. --no-password --insecure -f
  18. intermediate:
  19. step certificate create intermediate-ca \
  20. intermediate-ca.crt intermediate-ca.key \
  21. --profile intermediate-ca \
  22. --ca ./root-ca.crt \
  23. --ca-key ./root-ca.key \
  24. --kty EC --curve P-256 \
  25. --no-password --insecure -f
  26. leaf:
  27. step certificate create foo \
  28. foo.crt foo.key --profile leaf \
  29. --ca ./intermediate-ca.crt \
  30. --ca-key ./intermediate-ca.key \
  31. --no-password --insecure -f
  32. pkcs12-nopass: ca intermediate leaf
  33. # deliberately in wrong order
  34. cat foo.crt root-ca.crt intermediate-ca.crt > chain.pem
  35. # create pkcs12
  36. openssl pkcs12 -export \
  37. -in chain.pem \
  38. -inkey foo.key \
  39. -out foo-nopass.pfx \
  40. -password pass:
  41. pkcs12-disjunct: ca intermediate disjunct-ca leaf
  42. cat root-ca.crt intermediate-ca.crt disjunct-root-ca.crt > disjunct-chain.pem
  43. openssl pkcs12 -export \
  44. -in foo.crt \
  45. -certfile disjunct-chain.pem \
  46. -inkey foo.key \
  47. -out foo-disjunct-nopass.pfx \
  48. -password pass:
  49. pkcs12-multibag: ca intermediate leaf
  50. # deliberately in wrong order, we're missing the leaf cert here
  51. cat root-ca.crt intermediate-ca.crt > intermediate-chain.pem
  52. openssl pkcs12 -export \
  53. -in foo.crt \
  54. -certfile intermediate-chain.pem \
  55. -inkey foo.key \
  56. -out foo-multibag-nopass.pfx \
  57. -password pass:
  58. pkcs12-withpass-1234: ca intermediate leaf
  59. # deliberately in the wrong order
  60. cat foo.crt root-ca.crt intermediate-ca.crt > chain.pem
  61. # create pkcs12
  62. openssl pkcs12 -export \
  63. -in chain.pem \
  64. -inkey foo.key \
  65. -out foo-withpass-1234.pfx \
  66. -password pass:1234