|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +echo "Generating private key for CA..." |
| 4 | +openssl ecparam -name prime256v1 -out open-ocpp_ca.param |
| 5 | +openssl ecparam -in open-ocpp_ca.param -genkey -noout -out open-ocpp_ca.key |
| 6 | +echo "Generating certificate for CA..." |
| 7 | +openssl req -new -sha256 -key open-ocpp_ca.key -extensions v3_ca -config open-ocpp_ca.cnf -out open-ocpp_ca.csr |
| 8 | +echo "Self-signing CA certificate..." |
| 9 | +openssl x509 -req -sha256 -days 3650 -in open-ocpp_ca.csr -extensions v3_ca -extfile open-ocpp_ca.cnf -signkey open-ocpp_ca.key -out open-ocpp_ca.crt |
| 10 | +echo "" |
| 11 | + |
| 12 | +echo "Generating private key for Central System..." |
| 13 | +openssl ecparam -name prime256v1 -out open-ocpp_central-system.param |
| 14 | +openssl ecparam -in open-ocpp_central-system.param -genkey -noout -out open-ocpp_central-system.key |
| 15 | +echo "Generating certificate request for Central System..." |
| 16 | +openssl req -new -sha256 -key open-ocpp_central-system.key -extensions v3_ca -config open-ocpp_central-system.cnf -out open-ocpp_central-system.csr |
| 17 | +echo "Signing Central System certificate with CA certificate..." |
| 18 | +openssl x509 -req -sha256 -days 3650 -in open-ocpp_central-system.csr -extensions v3_ca -extfile open-ocpp_central-system.cnf -CA open-ocpp_ca.crt -CAkey open-ocpp_ca.key -CAcreateserial -out open-ocpp_central-system.crt |
| 19 | +echo "Verify certificate chain..." |
| 20 | +openssl verify -verbose -CAfile open-ocpp_ca.crt open-ocpp_central-system.crt |
| 21 | +echo "" |
| 22 | + |
| 23 | +echo "Generating private key for Charge Point..." |
| 24 | +openssl ecparam -name prime256v1 -out open-ocpp_charge-point.param |
| 25 | +openssl ecparam -in open-ocpp_charge-point.param -genkey -noout -out open-ocpp_charge-point.key |
| 26 | +echo "Generating certificate request for Charge Point..." |
| 27 | +openssl req -new -sha256 -key open-ocpp_charge-point.key -extensions v3_ca -config open-ocpp_charge-point.cnf -out open-ocpp_charge-point.csr |
| 28 | +echo "Signing Charge Point certificate with CA certificate..." |
| 29 | +openssl x509 -req -sha256 -days 3650 -in open-ocpp_charge-point.csr -extensions v3_ca -extfile open-ocpp_charge-point.cnf -CA open-ocpp_ca.crt -CAkey open-ocpp_ca.key -CAcreateserial -out open-ocpp_charge-point.crt |
| 30 | +echo "Verify certificate chain..." |
| 31 | +openssl verify -verbose -CAfile open-ocpp_ca.crt open-ocpp_charge-point.crt |
| 32 | +echo "" |
0 commit comments