Skip to content

Instantly share code, notes, and snippets.

@enukane
Created August 5, 2020 09:00
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 enukane/14416eeefd8fd4c1869cd3cf1cb5636d to your computer and use it in GitHub Desktop.
Save enukane/14416eeefd8fd4c1869cd3cf1cb5636d to your computer and use it in GitHub Desktop.
certificate generator
#!/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