testgen 830 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. T=testcert
  3. KEY=512
  4. CA=../certs/testca.pem
  5. /bin/rm -f $T.1 $T.2 $T.key
  6. if test "$OSTYPE" = msdosdjgpp; then
  7. PATH=../apps\;$PATH;
  8. else
  9. PATH=../apps:$PATH;
  10. fi
  11. export PATH
  12. echo "generating certificate request"
  13. echo "string to make the random number generator think it has entropy" >> ./.rnd
  14. if ../apps/openssl no-rsa; then
  15. req_new='-newkey dsa:../apps/dsa512.pem'
  16. else
  17. req_new='-new'
  18. echo "There should be a 2 sequences of .'s and some +'s."
  19. echo "There should not be more that at most 80 per line"
  20. fi
  21. echo "This could take some time."
  22. ../apps/openssl req -config test.cnf $req_new -out testreq.pem
  23. if [ $? != 0 ]; then
  24. echo problems creating request
  25. exit 1
  26. fi
  27. ../apps/openssl req -config test.cnf -verify -in testreq.pem -noout
  28. if [ $? != 0 ]; then
  29. echo signature on req is wrong
  30. exit 1
  31. fi
  32. exit 0