#!/bin/sh
#
# (c) 2003 Xelerance Corporation
# Ken Bantoft <ken@xelerance.com>
# Because I never remember all of these options.

# $1 = hostname of box, without .mdsp.com

DOMAIN=freeswan.org

# Generate Request
openssl req -newkey rsa:1024 -keyout $1.$DOMAIN.key -out $1.$DOMAIN.pem -config ./openssl.cnf

# Sign the cert
openssl ca -in $1.$DOMAIN.pem -out $1.$DOMAIN.cert  -notext -config ./openssl.cnf 

mkdir $1.$DOMAIN
mv $1.$DOMAIN.key $1.$DOMAIN/
mv $1.$DOMAIN.pem $1.$DOMAIN/
mv $1.$DOMAIN.cert $1.$DOMAIN/

