OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 <script src="resources/common.js"></script> | 5 <script src="resources/common.js"></script> |
6 <script src="resources/keys.js"></script> | 6 <script src="resources/keys.js"></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <p id="description"></p> | 9 <p id="description"></p> |
10 <div id="console"></div> | 10 <div id="console"></div> |
11 | 11 |
12 <script> | 12 <script> |
13 description("Tests structured cloning of RSA private keys (with a hash)"); | 13 description("Tests structured cloning of RSA private keys (with a hash)"); |
14 | 14 |
15 jsTestIsAsync = true; | 15 jsTestIsAsync = true; |
16 | 16 |
17 // Tests the 12 permutations of keys generated by: | 17 // Tests the 6 permutations of keys generated by: |
18 // kPossibleAlgorithms x kPossibleExtractable x kPossibleKeyUsages x kPossible
KeyData x kPossibleHashAlgorithms | 18 // kPossibleAlgorithms x kPossibleExtractable x kPossibleKeyUsages x kPossible
KeyData x kPossibleHashAlgorithms |
19 // | 19 // |
20 // For practical reasons these tests are not exhaustive. | 20 // For practical reasons these tests are not exhaustive. |
21 | 21 |
22 var kPossibleAlgorithms = ['RSASSA-PKCS1-v1_5']; | 22 var kPossibleAlgorithms = ['RSASSA-PKCS1-v1_5']; |
23 var kPossibleExtractable = [true, false]; | 23 var kPossibleExtractable = [true, false]; |
24 var kPossibleKeyUsages = [[], ['sign']]; | 24 var kPossibleKeyUsages = [['sign']]; |
25 var kPossibleHashAlgorithms = ['SHA-1', 'SHA-256', 'SHA-512']; | 25 var kPossibleHashAlgorithms = ['SHA-1', 'SHA-256', 'SHA-512']; |
26 | 26 |
27 var kPossibleKeyData = [ | 27 var kPossibleKeyData = [ |
28 kKeyData.rsa1, | 28 kKeyData.rsa1, |
29 kKeyData.rsa4 | 29 kKeyData.rsa4 |
30 ]; | 30 ]; |
31 | 31 |
32 function runTest(algorithmName, hashName, extractable, keyUsages, keyData) | 32 function runTest(algorithmName, hashName, extractable, keyUsages, keyData) |
33 { | 33 { |
34 var importData = hexStringToUint8Array(keyData.pkcs8); | 34 var importData = hexStringToUint8Array(keyData.pkcs8); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 }); | 91 }); |
92 }); | 92 }); |
93 }); | 93 }); |
94 | 94 |
95 lastPromise.then(finishJSTest, failAndFinishJSTest); | 95 lastPromise.then(finishJSTest, failAndFinishJSTest); |
96 | 96 |
97 </script> | 97 </script> |
98 | 98 |
99 </body> | 99 </body> |
100 </html> | 100 </html> |
OLD | NEW |