X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsecurity%2Fcreate_certificates.sh;fp=scripts%2Fsecurity%2Fcreate_certificates.sh;h=af8daaf957822bd61658e7ab49f87b10ba51faa5;hb=b33ab63436278c7de3c1dd6e0371d9e28788cfb8;hp=72100fd82b887d4be4632bd2cc64fd842dbf67da;hpb=6dba41ea5aea087aece3b5217c04afcff4a87472;p=feisty_meow.git diff --git a/scripts/security/create_certificates.sh b/scripts/security/create_certificates.sh index 72100fd8..af8daaf9 100644 --- a/scripts/security/create_certificates.sh +++ b/scripts/security/create_certificates.sh @@ -1,12 +1,12 @@ filename="$1"; shift -alias="$1"; shift -if [ -z "$filename" -o -z "$alias" ]; then - echo This script needs a base portion for the certificate filename to create - echo and the alias for the certificate. +cert_alias="$1"; shift +if [ -z "$filename" -o -z "$cert_alias" ]; then + echo "This script needs a base portion for the certificate filename to create" + echo "and the alias (or short name) for the certificate." echo For example: echo -e "\t$(basename $0 .sh) DrakeKey \"DrakeContainer\"" - echo would create DrakeKey.pem and DrakeKey.pfx with an alias of DrakeContainer. + echo would create DrakeKey.pem and DrakeKey.pfx with a cert alias of DrakeContainer. exit 1 fi @@ -15,7 +15,7 @@ openssl req -x509 -nodes -days 3650 \ -newkey rsa:1024 -keyout ${filename}.pem -out ${filename}.pem # export the PEM to a PFX file. -openssl pkcs12 -export -out ${filename}.pfx -in ${filename}.pem -name "$alias" +openssl pkcs12 -export -out ${filename}.pfx -in ${filename}.pem -name "$cert_alias" # export the PEM to a DER certificate file. openssl x509 -inform pem -in ${filename}.pem -outform der -out ${filename}.cer