diff options
Diffstat (limited to 'recipes-security/xmlsec1/xmlsec1/run-ptest')
-rwxr-xr-x | recipes-security/xmlsec1/xmlsec1/run-ptest | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/recipes-security/xmlsec1/xmlsec1/run-ptest b/recipes-security/xmlsec1/xmlsec1/run-ptest new file mode 100755 index 0000000..a203c38 --- /dev/null +++ b/recipes-security/xmlsec1/xmlsec1/run-ptest | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | check_return() { | ||
4 | if [ $? == 0 ]; then | ||
5 | echo -e "PASS: $1\n" | ||
6 | else | ||
7 | echo -e "FAIL: $1\n" | ||
8 | fi | ||
9 | } | ||
10 | |||
11 | echo "---------------------------------------------------" | ||
12 | echo "Signing a template file..." | ||
13 | ./sign1 sign1-tmpl.xml rsakey.pem > sign1-res.xml | ||
14 | ./verify1 sign1-res.xml rsapub.pem | ||
15 | check_return sign-tmpl | ||
16 | |||
17 | echo "---------------------------------------------------" | ||
18 | echo "Signing a dynamicaly created template..." | ||
19 | ./sign2 sign2-doc.xml rsakey.pem > sign2-res.xml | ||
20 | ./verify1 sign2-res.xml rsapub.pem | ||
21 | check_return sign-dynamic-templ | ||
22 | |||
23 | echo "---------------------------------------------------" | ||
24 | echo "Signing with X509 certificate..." | ||
25 | ./sign3 sign3-doc.xml rsakey.pem rsacert.pem > sign3-res.xml | ||
26 | ./verify3 sign3-res.xml ca2cert.pem cacert.pem | ||
27 | check_return sign-x509 | ||
28 | |||
29 | echo "---------------------------------------------------" | ||
30 | echo "Verifying a signature with a single key..." | ||
31 | ./verify1 sign1-res.xml rsapub.pem | ||
32 | ./verify1 sign2-res.xml rsapub.pem | ||
33 | check_return verify-single-key | ||
34 | |||
35 | echo "---------------------------------------------------" | ||
36 | echo "Verifying a signature with keys manager..." | ||
37 | ./verify2 sign1-res.xml rsapub.pem | ||
38 | ./verify2 sign2-res.xml rsapub.pem | ||
39 | check_return verify-keys-manager | ||
40 | |||
41 | echo "---------------------------------------------------" | ||
42 | echo "Verifying a signature with X509 certificates..." | ||
43 | ./verify3 sign3-res.xml ca2cert.pem cacert.pem | ||
44 | check_return verify-x509 | ||
45 | |||
46 | echo "---------------------------------------------------" | ||
47 | echo "Verifying a signature with additional restrictions..." | ||
48 | ./verify4 verify4-res.xml ca2cert.pem cacert.pem | ||
49 | check_return verify-res | ||
50 | |||
51 | echo "---------------------------------------------------" | ||
52 | echo "Encrypting data with a template file..." | ||
53 | ./encrypt1 encrypt1-tmpl.xml deskey.bin > encrypt1-res.xml | ||
54 | ./decrypt1 encrypt1-res.xml deskey.bin | ||
55 | check_return encrypt-tmpl | ||
56 | |||
57 | echo "---------------------------------------------------" | ||
58 | echo "Encrypting data with a dynamicaly created template..." | ||
59 | ./encrypt2 encrypt2-doc.xml deskey.bin > encrypt2-res.xml | ||
60 | ./decrypt1 encrypt2-res.xml deskey.bin | ||
61 | check_return encrypt-dynamic-tmpl | ||
62 | |||
63 | echo "---------------------------------------------------" | ||
64 | echo "Encrypting data with a session key..." | ||
65 | ./encrypt3 encrypt3-doc.xml rsakey.pem > encrypt3-res.xml | ||
66 | ./decrypt3 encrypt3-res.xml | ||
67 | check_return encrypt-session-key | ||
68 | |||
69 | echo "---------------------------------------------------" | ||
70 | echo "Decrypting data with a single key..." | ||
71 | ./decrypt1 encrypt1-res.xml deskey.bin | ||
72 | ./decrypt1 encrypt2-res.xml deskey.bin | ||
73 | check_return encrypt-single-key | ||
74 | |||
75 | echo "---------------------------------------------------" | ||
76 | echo "Decrypting data with keys manager..." | ||
77 | ./decrypt2 encrypt1-res.xml deskey.bin | ||
78 | ./decrypt2 encrypt2-res.xml deskey.bin | ||
79 | check_return encrypt-keys-manager | ||
80 | |||
81 | echo "---------------------------------------------------" | ||
82 | echo "Writing a custom keys manager..." | ||
83 | ./decrypt3 encrypt1-res.xml | ||
84 | ./decrypt3 encrypt2-res.xml | ||
85 | check_return write-keys-manager | ||