From 0775113f1158b3c1fff439028c316324fcac9750 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 1 May 2012 17:06:42 -0400 Subject: [PATCH] new script to generate PEM, PFX and CER files for a key. --- scripts/security/create_certificates.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/security/create_certificates.sh 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 + + + -- 2.34.1