#!/bin/bash # $Id$ # Certificate Signing Request Generator # Cheap ass frontend because I can't for the life # of me remember how the fuck openssl works. # echo "New Certificate Request for Underwares.org" echo "Script Copyleft Alexandre Gauthier 2007-2008" echo "--------------------------------------------" echo -n "Certificate Name? [server]" read CERTNAME if [ -z "$CERTNAME" ] ; then CERTNAME="server" fi echo "Creating work tree..." if [ ! -d ./$CERTNAME ] ; then mkdir -p ./$CERTNAME/ fi echo "Creating certificate for $CERTNAME." echo "Please fill in the form." /usr/bin/openssl req -new -nodes -keyout $CERTNAME/$CERTNAME.key -out $CERTNAME/$CERTNAME.csr -days 730 if [ $? -ne 0 ] ; then echo "A problem occured. Please review the output." echo "Your certificate signing request was **NOT** generated." else echo "Your certificate request can be found in $CERTNAME/$CERTNAME.csr" echo "Use sign.sh to sign it with the local CA." fi