testca 701 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. SH="/bin/sh"
  3. if test "$OSTYPE" = msdosdjgpp; then
  4. PATH=./apps\;../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. /bin/rm -fr demoCA
  12. $SH ../apps/CA.sh -newca <<EOF
  13. EOF
  14. if [ $? != 0 ]; then
  15. exit 1;
  16. fi
  17. SSLEAY_CONFIG="-config Uss.cnf"
  18. export SSLEAY_CONFIG
  19. $SH ../apps/CA.sh -newreq
  20. if [ $? != 0 ]; then
  21. exit 1;
  22. fi
  23. SSLEAY_CONFIG="-config ../apps/openssl.cnf"
  24. export SSLEAY_CONFIG
  25. $SH ../apps/CA.sh -sign <<EOF
  26. y
  27. y
  28. EOF
  29. if [ $? != 0 ]; then
  30. exit 1;
  31. fi
  32. $SH ../apps/CA.sh -verify newcert.pem
  33. if [ $? != 0 ]; then
  34. exit 1;
  35. fi
  36. /bin/rm -fr demoCA newcert.pem newreq.pem
  37. #usage: CA -newcert|-newreq|-newca|-sign|-verify