1#!/bin/sh 2 3SH="/bin/sh" 4PATH=../apps:$PATH 5export SH PATH 6 7SSLEAY_CONFIG="-config CAss.cnf" 8export SSLEAY_CONFIG 9 10/bin/rm -fr demoCA 11$SH ../apps/CA.sh -newca <<EOF 12EOF 13 14if [ $? != 0 ]; then 15 exit 1; 16fi 17 18SSLEAY_CONFIG="-config Uss.cnf" 19export SSLEAY_CONFIG 20$SH ../apps/CA.sh -newreq 21if [ $? != 0 ]; then 22 exit 1; 23fi 24 25 26SSLEAY_CONFIG="-config ../apps/ssleay.cnf" 27export SSLEAY_CONFIG 28$SH ../apps/CA.sh -sign <<EOF 29y 30y 31EOF 32if [ $? != 0 ]; then 33 exit 1; 34fi 35 36 37$SH ../apps/CA.sh -verify newcert.pem 38if [ $? != 0 ]; then 39 exit 1; 40fi 41 42/bin/rm -fr demoCA newcert.pem newreq.pem 43#usage: CA -newcert|-newreq|-newca|-sign|-verify 44 45