Does someone have a good script to generate x509 certificates, because I
have
troubles whith mine:


#!/bin/sh

if [ x$1 = x ]; then
  echo -e "\nUsage: $0 <certname>\n"
  exit;
fi;
if [ ! -e /etc/ssl/demoCA/cacert.pem ]; then
  echo "Creating new CA. <Enter>"
  read $dummy
  cd /etc/ssl
  /usr/lib/ssl/misc/CA.sh -newca
fi;
if [ ! -e /etc/ssl/demoCA/newca.pem ]; then
  echo "Creating certificate with 1024 days validity. <Enter>"
  read $dummy
  openssl x509 -out /etc/ssl/demoCA/newca.pem -days 1024 -in
/etc/ssl/demoCA/cacert.pem -signkey /etc/ssl/demoCA/private/cakey.pem
fi;

cd /etc/ssl
/usr/lib/ssl/misc/CA.sh -newreq
/usr/lib/ssl/misc/CA.sh -sign
openssl pkcs12 -export -in newcert.pem -inkey newreq.pem -certfile
demoCA/newca.pem -out $1_key.p12
mv newcert.pem $1_cert.pem
mv newreq.pem $1_key.pem


Thanks.

Laurent.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to