Last active
March 8, 2019 03:53
-
-
Save sepfy/abc76642f8641dad295de3de57f1b416 to your computer and use it in GitHub Desktop.
x.509 with OpenSSL
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
# Generate root CA | |
openssl req -newkey rsa:2048 -nodes -keyout root-key.pem -x509 -days 365 -out root-ca.pem | |
# Generate leaf CSR | |
openssl req -new -newkey rsa:2048 -nodes -keyout leaf-key.pem -out leaf-csr.pem | |
# Generate leaf CA | |
openssl x509 -req -days 3650 -in leaf-csr.pem \ | |
-CA root-ca.pem -CAkey root-key.pem \ | |
-CAcreateserial -out leaf-ca.pem | |
# Read pem | |
openssl x509 -in cert.pem -text -noout | |
# Read key | |
openssl rsa -in mykey.key -text -noout | |
# Read CSR | |
openssl req -noout -text -in my.csr | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment