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 </head> | 7 </head> |
7 <body> | 8 <body> |
8 <p id="description"></p> | 9 <p id="description"></p> |
9 <div id="console"></div> | 10 <div id="console"></div> |
10 | 11 |
11 <script> | 12 <script> |
12 description("Tests cypto.subtle.exportKey."); | 13 description("Tests cypto.subtle.exportKey."); |
13 | 14 |
14 jsTestIsAsync = true; | 15 jsTestIsAsync = true; |
15 | 16 |
(...skipping 11 matching lines...) Expand all Loading... |
27 | 28 |
28 shouldBe("keys.aesCbcJustDecrypt.extractable", "false") | 29 shouldBe("keys.aesCbcJustDecrypt.extractable", "false") |
29 shouldRejectPromiseWithNull("crypto.subtle.exportKey('raw', keys.aesCbcJustD
ecrypt)"); | 30 shouldRejectPromiseWithNull("crypto.subtle.exportKey('raw', keys.aesCbcJustD
ecrypt)"); |
30 | 31 |
31 return crypto.subtle.exportKey('raw', keys.aesCbc); | 32 return crypto.subtle.exportKey('raw', keys.aesCbc); |
32 }).then(function(result) { | 33 }).then(function(result) { |
33 bytesShouldMatchHexString("Key bytes", "3136206279746573206f66206b657921", r
esult); | 34 bytesShouldMatchHexString("Key bytes", "3136206279746573206f66206b657921", r
esult); |
34 | 35 |
35 return crypto.subtle.exportKey('spki', keys.rsaSsaSha1Public); | 36 return crypto.subtle.exportKey('spki', keys.rsaSsaSha1Public); |
36 }).then(function(result) { | 37 }).then(function(result) { |
37 bytesShouldMatchHexString("Key bytes", kPublicKeySpkiDerHex, result); | 38 bytesShouldMatchHexString("Key bytes", kKeyData.rsa1.spki, result); |
38 })); | 39 })); |
39 | 40 |
40 completeTestWhenAllTasksDone(); | 41 completeTestWhenAllTasksDone(); |
41 | 42 |
42 </script> | 43 </script> |
43 | 44 |
44 </body> | 45 </body> |
45 </html> | 46 </html> |
OLD | NEW |