4 # Takes one argument, the Distinguished name
5 # Creates a single signed cert, cert.pem in the current directory
6 cat -<<EOF |openssl req -nodes -new -keyout key.pem -out key.req -days 9000 >/dev/null 2>&1
17 openssl x509 -in $CACERT -noout -next_serial -out serial >/dev/null 2>&1
18 touch database database.attr
19 cp /usr/lib/ssl/openssl.cnf config
20 perl -pi -e 's/(database|serial)\s*=.+/$1=$1/' config
21 openssl ca -config config -policy policy_anything -keyfile $CAKEY -cert $CACERT \
22 -out cert.pem -outdir . -notext -days 9000 -batch -infiles key.req > /dev/null 2>&1
23 rm -f database database.attr database.old database.attr.old config serial serial.old
28 if [ -n "$1" -a ! -e $1 ]; then
30 cat -<<EOF |openssl req -new -nodes -x509 -keyout $1.key -out $1.crt -days 9000 >/dev/null 2>&1