2
0

testca 752 B

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