From: Chris Koeritz Date: Tue, 1 May 2012 21:06:42 +0000 (-0400) Subject: new script to generate PEM, PFX and CER files for a key. X-Git-Tag: 2.140.90~1362 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=0775113f1158b3c1fff439028c316324fcac9750;p=feisty_meow.git new script to generate PEM, PFX and CER files for a key. --- diff --git a/scripts/security/create_certificates.sh b/scripts/security/create_certificates.sh new file mode 100644 index 00000000..cc98ddb3 --- /dev/null +++ b/scripts/security/create_certificates.sh @@ -0,0 +1,22 @@ + +filename="$1"; shift +if [ -z "$filename" ]; then + echo This script needs a base portion for the certificate filename to create. + echo For example: + echo $0 DrakeKey + echo would create DrakeKey.pem and DrakeKey.pfx. + exit 1 +fi + +# create PEM file. +openssl req -x509 -nodes -days 3650 \ + -newkey rsa:1024 -keyout ${filename}.pem -out ${filename}.pem + +# export PFX file. +openssl pkcs12 -export -out ${filename}.pfx -in ${filename}.pem -name "Drake Container Certificate" + +# export the PFX to a certificate file. this can be given to other folks. +openssl x509 -inform pem -in ${filename}.pem -outform der -out ${filename}.cer + + +