#
# Create the security certificate
#

CONTACT_NAME=`hostname`

PKG=SUNWsade
VARDIR=`pkgparam $PKG VARDIR`
KEYTOOLCMD=`pkgparam $PKG KEYTOOLCMD`

CERT_FILE=$VARDIR/$PKG/.keystore

if [ -f $CERT_FILE ] ; then
  rm -r $CERT_FILE
fi

# mark the certificate valid for 2 years (365*2) = 730

$KEYTOOLCMD -genkey -alias tomcat -keyalg RSA \
            -validity 730 -storepass changeit \
            -keypass changeit -keystore $CERT_FILE \
            -dname "cn=\"$CONTACT_NAME\", ou=unknown, O=unknown, L=unknown, ST=unknown, C=unknown" > /dev/null


