Created
January 23, 2021 06:03
-
-
Save sakamoto-poteko/a66c1a9745d26210a54b6e11cf81ecab to your computer and use it in GitHub Desktop.
OpenSSL generate root and intermediate CA (simple)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Root CA | |
echo 'Generating Root CA' | |
openssl ecparam -name secp384r1 -genkey -noout -out ca.key.pem | |
openssl req -x509 -new -nodes -key ca.key.pem -sha512 -days 3650 -out ca.crt.pem | |
openssl pkcs12 -inkey ca.key.pem -in ca.crt.pem -export -out ca.pfx | |
# Intermediate CA | |
echo 'Generating Intermediate CA' | |
openssl ecparam -name secp384r1 -genkey -noout -out int.key.pem | |
openssl req -new -key int.key.pem -out int.csr.pem | |
openssl x509 -req -days 360 -in int.csr.pem -CA ca.crt.pem -CAkey ca.key.pem -CAcreateserial -out int.crt.pem -sha512 | |
openssl pkcs12 -inkey int.key.pem -in int.crt.pem -export -out int.pfx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment