1998-12-21 10:52:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
SH="/bin/sh"
|
2002-06-13 20:40:49 +00:00
|
|
|
if test "$OSTYPE" = msdosdjgpp; then
|
|
|
|
PATH=./apps\;../apps\;$PATH
|
|
|
|
else
|
|
|
|
PATH=../apps:$PATH
|
|
|
|
fi
|
1998-12-21 10:52:47 +00:00
|
|
|
export SH PATH
|
|
|
|
|
|
|
|
SSLEAY_CONFIG="-config CAss.cnf"
|
|
|
|
export SSLEAY_CONFIG
|
|
|
|
|
2005-02-01 23:45:42 +00:00
|
|
|
OPENSSL="`pwd`/../util/shlib_wrap.sh openssl"
|
|
|
|
export OPENSSL
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
/bin/rm -fr demoCA
|
|
|
|
$SH ../apps/CA.sh -newca <<EOF
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
SSLEAY_CONFIG="-config Uss.cnf"
|
|
|
|
export SSLEAY_CONFIG
|
|
|
|
$SH ../apps/CA.sh -newreq
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
1999-01-02 19:01:41 +00:00
|
|
|
SSLEAY_CONFIG="-config ../apps/openssl.cnf"
|
1998-12-21 10:52:47 +00:00
|
|
|
export SSLEAY_CONFIG
|
|
|
|
$SH ../apps/CA.sh -sign <<EOF
|
|
|
|
y
|
|
|
|
y
|
|
|
|
EOF
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
$SH ../apps/CA.sh -verify newcert.pem
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
/bin/rm -fr demoCA newcert.pem newreq.pem
|
|
|
|
#usage: CA -newcert|-newreq|-newca|-sign|-verify
|
|
|
|
|