| 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 public keys (with a hash)"); | 13 description("Tests structured cloning of RSA public keys (with a hash)"); |
| 14 | 14 |
| 15 jsTestIsAsync = true; | 15 jsTestIsAsync = true; |
| 16 | 16 |
| 17 // Tests the 48 permutations of keys generated by: | 17 // Tests the 12 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'], ['verify'], ['sign', 'verify']]; | 24 var kPossibleKeyUsages = [[], ['verify']]; |
| 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.rsa2, | 28 kKeyData.rsa2, |
| 29 kKeyData.rsa3 | 29 kKeyData.rsa3 |
| 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.spki); | 34 var importData = hexStringToUint8Array(keyData.spki); |
| (...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 |