Created
August 5, 2020 09:00
-
-
Save enukane/14416eeefd8fd4c1869cd3cf1cb5636d to your computer and use it in GitHub Desktop.
certificate generator
This file contains 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/sh -e | |
RSASECRET=rsa-secret.key | |
REQCSR=request.csr | |
CERT=certificate.crt | |
echo "STEP1: generate RSA secret key" | |
openssl genrsa -out $RSASECRET 1024 | |
echo "" | |
echo "> show RSA secret key ($RSASECRET)" | |
cat $RSASECRET | |
echo "" | |
echo "STEP2: generate CSR" | |
openssl req -new -x509 -days 3650 -key $RSASECRET -out $REQCSR | |
echo "" | |
echo "> show CSR ($REQCSR)" | |
cat $REQCSR | |
echo "" | |
echo "STEP3: generate certificate" | |
openssl x509 -in $REQCSR -out $CERT -days 3650 | |
echo "" | |
echo "> show certificate" | |
openssl x509 -in $CERT -text | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment