Skip to content

Instantly share code, notes, and snippets.

@petri
Forked from xynova/openssl-create-CA.sh
Created December 9, 2016 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petri/dc9bacecc43aae798dadb8fca2b358e0 to your computer and use it in GitHub Desktop.
Save petri/dc9bacecc43aae798dadb8fca2b358e0 to your computer and use it in GitHub Desktop.
Create Root CA certs with openssl
# Create the Root CA private key
## ref> https://www.openssl.org/docs/manmaster/apps/genrsa.html
openssl genrsa -out myRootCA.key 4096
# Generate the Root CA certificate signed with the private key
## ref> https://www.openssl.org/docs/manmaster/apps/req.html
openssl req -x509 -new -nodes -key myRootCA.key -days 3650 -out myRootCA.pem
# Country Name (2 letter code) [AU]:AU
# State or Province Name (full name) [Some-State]:NSW
# Locality Name (eg, city) []:Sydney
# Organization Name (eg, company) [Internet Widgits Pty Ltd]: MY-DEV-CA
# Organizational Unit Name (eg, section) []: dev
# Common Name (eg, YOUR name) []: my-dev-ca
# Email Address []: my@email.com
# Pacakge your public and private key in a pkcs12 encripted file (to install with certmgr on windows)
## ref> https://www.openssl.org/docs/manmaster/apps/pkcs12.html
openssl pkcs12 -export -inkey myRootCA.key -in myRootCA.pem -out myRootCA.pfx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment