summaryrefslogtreecommitdiff
path: root/regress/lib/libssl/testrsa.sh
blob: 75e205a975eef7cef41a0eeb0a146701d66b8d21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

#Test RSA certificate generation of openssl

echo 
echo RSA paramters test - NOTE THAT THIS WILL ONLY WORK IF YOU HAVE
echo compiled libssl with the src-patent tree, currently living in 
echo ~beck/src-patent.tar.gz on cvs. 
echo
echo This will *not* work with what\'s in the tree, rsa is not in that.
echo
sleep 3
 
cd $1

# Generate RSA private key
openssl genrsa -out rsakey.pem
if [ $? != 0 ]; then
        exit 1;
fi


# Denerate an RSA certificate
openssl req -config $2/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem
if [ $? != 0 ]; then
        exit 1;
fi


# Now check the certificate
openssl x509 -text -in rsacert.pem
if [ $? != 0 ]; then
        exit 1;
fi

exit 0