generate_certificates.sh 1.2 KB

123456789101112131415161718192021222324252627
  1. set -e
  2. echo "Please make sure the line RANDFILE = ... is commented out in your /etc/ssl/openssl.conf."
  3. echo "Generating the CA key"
  4. openssl genrsa -out dummy_ca.key 4096
  5. echo "Generating the CA cert"
  6. openssl req -x509 -new -subj "/C=NL/ST=Other/O=OpenLEADR Dummy CA/CN=dummy-ca.openleadr.org" -nodes -key dummy_ca.key -sha256 -days 3650 -out dummy_ca.crt
  7. echo "Generating the VTN key"
  8. openssl genrsa -out dummy_vtn.key 2048
  9. echo "Generating the VTN Certificate Signing Request"
  10. openssl req -new -sha256 -key dummy_vtn.key -subj "/C=NL/ST=Other/O=OpenLEADR Dummy VTN/CN=dummy-vtn.openleadr.org" -out dummy_vtn.csr
  11. echo "Signing the VTN CSR, generating the VTN certificate"
  12. openssl x509 -req -in dummy_vtn.csr -CA dummy_ca.crt -CAkey dummy_ca.key -CAcreateserial -out dummy_vtn.crt -days 3650 -sha256
  13. echo "Generating the VEN key"
  14. openssl genrsa -out dummy_ven.key 2048
  15. echo "Generating the VEN Certificate Signing Request"
  16. openssl req -new -sha256 -key dummy_ven.key -subj "/C=NL/ST=Other/O=OpenLEADR Dummy VEN/CN=dummy-ven.openleadr.org" -out dummy_ven.csr
  17. echo "Signing the VTN CSR, generating the VEN certificate"
  18. openssl x509 -req -in dummy_ven.csr -CA dummy_ca.crt -CAkey dummy_ca.key -CAcreateserial -out dummy_ven.crt -days 3650 -sha256