Skip to content

Instantly share code, notes, and snippets.

@dmarov
Created November 22, 2018 07:12
Show Gist options
  • Save dmarov/b0a968423a8ebbb98c4a71cf9ca22a15 to your computer and use it in GitHub Desktop.
Save dmarov/b0a968423a8ebbb98c4a71cf9ca22a15 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/zsh
# ./cert-gen.zsh key.pem req.pem certificate.pem
keyFile=$1;
reqFile=$2;
crtFile=$3;
# generate private key
# openssl genrsa -out $keyFile 2048
# generate certificate request
# openssl req -new -sha256 -key $keyFile -out $reqFile -config openssl.conf
# sign certificate request
openssl x509 -req -signkey $keyFile -keyform PEM -inform PEM -outform PEM -in $reqFile -out $crtFile -days 1000000
# openssl x509 -in certificate.pem -noout -text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment