2000-06-15 02:44:19 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
SH="/bin/sh"
|
2003-07-24 12:25:41 +04:00
|
|
|
if test "$OSTYPE" = msdosdjgpp; then
|
2005-11-25 06:02:45 +03:00
|
|
|
PATH="../apps\;$PATH"
|
2003-07-24 12:25:41 +04:00
|
|
|
else
|
2005-11-25 06:02:45 +03:00
|
|
|
PATH="../apps:$PATH"
|
2003-07-24 12:25:41 +04:00
|
|
|
fi
|
2000-06-15 02:44:19 +04:00
|
|
|
export SH PATH
|
|
|
|
|
|
|
|
SSLEAY_CONFIG="-config CAss.cnf"
|
|
|
|
export SSLEAY_CONFIG
|
|
|
|
|
2005-11-25 06:02:45 +03:00
|
|
|
OPENSSL="`pwd`/../util/opensslwrap.sh"
|
2005-03-25 22:05:51 +03:00
|
|
|
export OPENSSL
|
|
|
|
|
2000-06-15 02:44:19 +04: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
|
|
|
|
|
|
|
|
|
|
|
|
SSLEAY_CONFIG="-config ../apps/openssl.cnf"
|
|
|
|
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
|
|
|
|
|