|
@@ -1,6 +1,70 @@
|
1
|
1
|
#!/bin/bash
|
|
2
|
+set -e
|
2
|
3
|
|
3
|
|
-node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs1.pem
|
4
|
|
-node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs8.pem
|
5
|
|
-node bin/rasha.js ./fixtures/pub-rsa-2048.pkcs1.pem
|
6
|
|
-node bin/rasha.js ./fixtures/pub-rsa-2048.spki.pem
|
|
4
|
+echo ""
|
|
5
|
+echo ""
|
|
6
|
+echo "Testing PEM-to-JWK PKCS#1"
|
|
7
|
+echo ""
|
|
8
|
+#
|
|
9
|
+node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs1.pem > ./fixtures/privkey-rsa-2048.jwk.1.json
|
|
10
|
+diff ./fixtures/privkey-rsa-2048.jwk.json ./fixtures/privkey-rsa-2048.jwk.1.json
|
|
11
|
+#
|
|
12
|
+node bin/rasha.js ./fixtures/pub-rsa-2048.pkcs1.pem > ./fixtures/pub-rsa-2048.jwk.1.json
|
|
13
|
+diff ./fixtures/pub-rsa-2048.jwk.json ./fixtures/pub-rsa-2048.jwk.1.json
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+echo ""
|
|
17
|
+echo ""
|
|
18
|
+echo "Testing PEM-to-JWK PKCS#8"
|
|
19
|
+echo ""
|
|
20
|
+#
|
|
21
|
+node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs8.pem > ./fixtures/privkey-rsa-2048.jwk.1.json
|
|
22
|
+diff ./fixtures/privkey-rsa-2048.jwk.json ./fixtures/privkey-rsa-2048.jwk.1.json
|
|
23
|
+#
|
|
24
|
+node bin/rasha.js ./fixtures/pub-rsa-2048.spki.pem > ./fixtures/pub-rsa-2048.jwk.1.json
|
|
25
|
+diff ./fixtures/pub-rsa-2048.jwk.json ./fixtures/pub-rsa-2048.jwk.1.json
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+echo ""
|
|
29
|
+echo ""
|
|
30
|
+echo "Testing JWK-to-PEM PKCS#1"
|
|
31
|
+echo ""
|
|
32
|
+#
|
|
33
|
+node bin/rasha.js ./fixtures/privkey-rsa-2048.jwk.json pkcs1 > ./fixtures/privkey-rsa-2048.pkcs1.1.pem
|
|
34
|
+diff ./fixtures/privkey-rsa-2048.pkcs1.pem ./fixtures/privkey-rsa-2048.pkcs1.1.pem
|
|
35
|
+#
|
|
36
|
+node bin/rasha.js ./fixtures/pub-rsa-2048.jwk.json pkcs1 > ./fixtures/pub-rsa-2048.pkcs1.1.pem
|
|
37
|
+diff ./fixtures/pub-rsa-2048.pkcs1.pem ./fixtures/pub-rsa-2048.pkcs1.1.pem
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+#echo ""
|
|
41
|
+#echo ""
|
|
42
|
+#echo "Testing JWK-to-PEM PKCS#8"
|
|
43
|
+#echo ""
|
|
44
|
+#
|
|
45
|
+#node bin/rasha.js ./fixtures/privkey-rsa-2048.jwk.json pkcs8 > ./fixtures/privkey-rsa-2048.pkcs8.1.pem
|
|
46
|
+#diff ./fixtures/privkey-rsa-2048.pkcs8.pem ./fixtures/privkey-rsa-2048.pkcs8.1.pem
|
|
47
|
+#
|
|
48
|
+#node bin/rasha.js ./fixtures/pub-rsa-2048.jwk.json spki > ./fixtures/pub-rsa-2048.spki.1.pem
|
|
49
|
+#diff ./fixtures/pub-rsa-2048.pski.pem ./fixtures/pub-rsa-2048.spki.1.pem
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+echo ""
|
|
53
|
+echo ""
|
|
54
|
+echo "Testing JWK-to-SSH"
|
|
55
|
+echo ""
|
|
56
|
+#
|
|
57
|
+node bin/rasha.js ./fixtures/privkey-rsa-2048.jwk.json ssh > ./fixtures/pub-rsa-2048.ssh.1.pub
|
|
58
|
+diff ./fixtures/pub-rsa-2048.ssh.pub ./fixtures/pub-rsa-2048.ssh.1.pub
|
|
59
|
+#
|
|
60
|
+node bin/rasha.js ./fixtures/pub-rsa-2048.jwk.json ssh > ./fixtures/pub-rsa-2048.ssh.1.pub
|
|
61
|
+diff ./fixtures/pub-rsa-2048.ssh.pub ./fixtures/pub-rsa-2048.ssh.1.pub
|
|
62
|
+
|
|
63
|
+rm fixtures/*.1.*
|
|
64
|
+
|
|
65
|
+echo ""
|
|
66
|
+echo ""
|
|
67
|
+echo "PASSED:"
|
|
68
|
+echo "• All inputs produced valid outputs"
|
|
69
|
+echo "• All outputs matched known-good values"
|
|
70
|
+echo ""
|