blob: b109cfe271f329919b1f0cb3521ddb63da6f957d [file] [log] [blame]
Ralf S. Engelschalld02b48c1998-12-21 10:52:47 +00001#!/bin/sh
2
3SH="/bin/sh"
Richard Levitte451dc182002-06-13 20:42:35 +00004if test "$OSTYPE" = msdosdjgpp; then
Andy Polyakov62d27932005-02-01 23:48:37 +00005 PATH="../apps\;$PATH"
Richard Levitte451dc182002-06-13 20:42:35 +00006else
Andy Polyakov62d27932005-02-01 23:48:37 +00007 PATH="../apps:$PATH"
Richard Levitte451dc182002-06-13 20:42:35 +00008fi
Ralf S. Engelschalld02b48c1998-12-21 10:52:47 +00009export SH PATH
10
11SSLEAY_CONFIG="-config CAss.cnf"
12export SSLEAY_CONFIG
13
Andy Polyakov62d27932005-02-01 23:48:37 +000014OPENSSL="`pwd`/../util/opensslwrap.sh"
15export OPENSSL
16
Ralf S. Engelschalld02b48c1998-12-21 10:52:47 +000017/bin/rm -fr demoCA
18$SH ../apps/CA.sh -newca <<EOF
19EOF
20
21if [ $? != 0 ]; then
22 exit 1;
23fi
24
25SSLEAY_CONFIG="-config Uss.cnf"
26export SSLEAY_CONFIG
27$SH ../apps/CA.sh -newreq
28if [ $? != 0 ]; then
29 exit 1;
30fi
31
32
Ben Laurie288370e1999-01-02 19:01:41 +000033SSLEAY_CONFIG="-config ../apps/openssl.cnf"
Ralf S. Engelschalld02b48c1998-12-21 10:52:47 +000034export SSLEAY_CONFIG
35$SH ../apps/CA.sh -sign <<EOF
36y
37y
38EOF
39if [ $? != 0 ]; then
40 exit 1;
41fi
42
43
44$SH ../apps/CA.sh -verify newcert.pem
45if [ $? != 0 ]; then
46 exit 1;
47fi
48
49/bin/rm -fr demoCA newcert.pem newreq.pem
50#usage: CA -newcert|-newreq|-newca|-sign|-verify
51