From: Mark Spencer Date: Tue, 25 Dec 2001 23:27:38 +0000 (+0000) Subject: Version 0.1.10 from FTP X-Git-Tag: 0.1.10~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c27ef7f85c82b5ed48eddb4b50b2c39bf5854b27;p=thirdparty%2Fasterisk.git Version 0.1.10 from FTP git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/astgenkey b/astgenkey new file mode 100755 index 0000000000..31873e88d2 --- /dev/null +++ b/astgenkey @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Usage: astgenkey [ -q ] [keyname] +# +if [ "$1" = "-q" ]; then + QUIET='y' + KEY=$2 +else + KEY=$1 +fi + +if [ "$QUIET" != 'y' ]; then + echo "" + echo "This script generates an RSA private and public key pair" + echo "in PEM format for use by Asterisk. You will be asked to" + echo "enter a passcode for your key multiple times. Please" + echo "enter the same code each time. The resulting files will" + echo "need to be moved to /var/lib/asterisk/keys if you want" + echo "to use them, and any private keys (.key files) will" + echo "need to be initialized at runtime either by running" + echo "Asterisk with the '-i' option, or with the 'init keys'" + echo "command once Asterisk is running." + echo "" + echo "Press ENTER to continue or ^C to cancel." + read BLAH +fi + +while [ "$KEY" = "" ]; do + echo -n "Enter key name: " + read KEY +done + +rm -f ${KEY}.key ${KEY}.pub + +echo "Generating SSL key '$KEY': " +openssl genrsa -out ${KEY}.key -des3 1024 +openssl rsa -in ${KEY}.key -pubout -out ${KEY}.pub + +if [ -f "${KEY}.key" ] && [ -f "${KEY}.pub" ]; then + if [ "$QUIET" != 'y' ]; then + echo "Key creation successful." + echo "Public key: ${KEY}.pub" + echo "Private key: ${KEY}.key" + fi +else + echo "Unknown error creating keys." +fi diff --git a/contrib/scripts/astgenkey b/contrib/scripts/astgenkey new file mode 100755 index 0000000000..31873e88d2 --- /dev/null +++ b/contrib/scripts/astgenkey @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Usage: astgenkey [ -q ] [keyname] +# +if [ "$1" = "-q" ]; then + QUIET='y' + KEY=$2 +else + KEY=$1 +fi + +if [ "$QUIET" != 'y' ]; then + echo "" + echo "This script generates an RSA private and public key pair" + echo "in PEM format for use by Asterisk. You will be asked to" + echo "enter a passcode for your key multiple times. Please" + echo "enter the same code each time. The resulting files will" + echo "need to be moved to /var/lib/asterisk/keys if you want" + echo "to use them, and any private keys (.key files) will" + echo "need to be initialized at runtime either by running" + echo "Asterisk with the '-i' option, or with the 'init keys'" + echo "command once Asterisk is running." + echo "" + echo "Press ENTER to continue or ^C to cancel." + read BLAH +fi + +while [ "$KEY" = "" ]; do + echo -n "Enter key name: " + read KEY +done + +rm -f ${KEY}.key ${KEY}.pub + +echo "Generating SSL key '$KEY': " +openssl genrsa -out ${KEY}.key -des3 1024 +openssl rsa -in ${KEY}.key -pubout -out ${KEY}.pub + +if [ -f "${KEY}.key" ] && [ -f "${KEY}.pub" ]; then + if [ "$QUIET" != 'y' ]; then + echo "Key creation successful." + echo "Public key: ${KEY}.pub" + echo "Private key: ${KEY}.key" + fi +else + echo "Unknown error creating keys." +fi