File: generate_certificates.sh

package info (click to toggle)
python-openleadr-python 0.5.34%2Bdfsg.1-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,496 kB
  • sloc: python: 6,942; xml: 663; makefile: 32; sh: 18
file content (27 lines) | stat: -rwxr-xr-x 1,238 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
set -e

echo "Please make sure the line RANDFILE = ... is commented out in your /etc/ssl/openssl.conf."

echo "Generating the CA key"
openssl genrsa -out dummy_ca.key 4096

echo "Generating the CA cert"
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

echo "Generating the VTN key"
openssl genrsa -out dummy_vtn.key 2048

echo "Generating the VTN Certificate Signing Request"
openssl req -new -sha256 -key dummy_vtn.key -subj "/C=NL/ST=Other/O=OpenLEADR Dummy VTN/CN=localhost" -out dummy_vtn.csr

echo "Signing the VTN CSR, generating the VTN certificate"
openssl x509 -req -in dummy_vtn.csr -CA dummy_ca.crt -CAkey dummy_ca.key -CAcreateserial -out dummy_vtn.crt -days 3650 -sha256

echo "Generating the VEN key"
openssl genrsa -out dummy_ven.key 2048

echo "Generating the VEN Certificate Signing Request"
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

echo "Signing the VTN CSR, generating the VEN certificate"
openssl x509 -req -in dummy_ven.csr -CA dummy_ca.crt -CAkey dummy_ca.key -CAcreateserial -out dummy_ven.crt -days 3650 -sha256