瀏覽代碼

update tests

tags/v0.8.2
AJ ONeal 10 月之前
父節點
當前提交
4e16f360ed
共有 2 個檔案被更改,包括 69 行新增5 行删除
  1. 1
    1
      fixtures/pub-rsa-2048.ssh.pub
  2. 68
    4
      test.sh

+ 1
- 1
fixtures/pub-rsa-2048.ssh.pub 查看文件

@@ -1 +1 @@
1
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCba21UHE+VbDTpmYYFZUOV+OQ8AngOCdjROsPC0KiEfMvEaEM3NQl58u6QL7G7QsErKViiNPm9OTFo6HF5JijfWzK7haHFuRMEsgI4VwIYyhvqlJDfw/wt0AiVvSmoMfEQn1p1aiaO4V/RJSE3Vw/uz2bxiT22uSkSqOyShyfYE6dMHnuoBkzr4jvSifT+INmbv6Nyo4+AAMCZtYeHLrsFeSTjLL9jMPjI4ZkVdlw2n3Xn9NbltF3/8Ao8dQfElqw+LIQWqU0oFHYNIP4ttfl5ObMKHaKSvBMyNruZR0El/ZsrcHLkAHRCLj07KRQJ81l5CUTPtQ02P1Eamz/nT4I3
1
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCba21UHE+VbDTpmYYFZUOV+OQ8AngOCdjROsPC0KiEfMvEaEM3NQl58u6QL7G7QsErKViiNPm9OTFo6HF5JijfWzK7haHFuRMEsgI4VwIYyhvqlJDfw/wt0AiVvSmoMfEQn1p1aiaO4V/RJSE3Vw/uz2bxiT22uSkSqOyShyfYE6dMHnuoBkzr4jvSifT+INmbv6Nyo4+AAMCZtYeHLrsFeSTjLL9jMPjI4ZkVdlw2n3Xn9NbltF3/8Ao8dQfElqw+LIQWqU0oFHYNIP4ttfl5ObMKHaKSvBMyNruZR0El/ZsrcHLkAHRCLj07KRQJ81l5CUTPtQ02P1Eamz/nT4I3 rsa@localhost

+ 68
- 4
test.sh 查看文件

@@ -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 ""

Loading…
取消
儲存