Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: LayoutTests/crypto/rsa-oaep-wrap-unwrap-aes.html

Issue 336173002: [webcrypto] Require importKey() for JWK to provide data as a Javascript object rather than a JSON a… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update additional tests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 </head> 6 </head>
7 <body> 7 <body>
8 <p id="description"></p> 8 <p id="description"></p>
9 <div id="console"></div> 9 <div id="console"></div>
10 10
(...skipping 21 matching lines...) Expand all
32 dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U 0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5 x-r9KwBZFC4FCG2hg_zE", 32 dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U 0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5 x-r9KwBZFC4FCG2hg_zE",
33 qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG 5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf 9-2QuKDoWeRdd7NsdxTk" 33 qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG 5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf 9-2QuKDoWeRdd7NsdxTk"
34 }; 34 };
35 var wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"}; 35 var wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
36 var extractable = true; 36 var extractable = true;
37 var nonExtractable = false; 37 var nonExtractable = false;
38 38
39 var importAlgorithm = {name: "rsa-oaep", hash: {name:"sha-1"}}; 39 var importAlgorithm = {name: "rsa-oaep", hash: {name:"sha-1"}};
40 40
41 debug("Importing RSA keys..."); 41 debug("Importing RSA keys...");
42 crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), importAlgorithm, extractable, ["wrapKey"]).then(function(result) { 42 crypto.subtle.importKey("jwk", publicKeyJSON, importAlgorithm, extractable, ["wr apKey"]).then(function(result) {
43 publicKey = result; 43 publicKey = result;
44 return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(priva teKeyJSON)), importAlgorithm, extractable, ["unwrapKey"]); 44 return crypto.subtle.importKey("jwk", privateKeyJSON, importAlgorithm, extra ctable, ["unwrapKey"]);
45 }).then(function(result) { 45 }).then(function(result) {
46 privateKey = result; 46 privateKey = result;
47 47
48 debug("Importing an AES key..."); 48 debug("Importing an AES key...");
49 aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c07 3b6108d72d9810a30914dff4"); 49 aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c07 3b6108d72d9810a30914dff4");
50 return crypto.subtle.importKey("raw", aesKeyData, {name:"aes-cbc"}, extracta ble, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]) 50 return crypto.subtle.importKey("raw", aesKeyData, {name:"aes-cbc"}, extracta ble, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
51 }).then(function(result) { 51 }).then(function(result) {
52 aesKey = result; 52 aesKey = result;
53 debug("Wrapping it..."); 53 debug("Wrapping it...");
54 54
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 debug("Exporting it..."); 94 debug("Exporting it...");
95 return crypto.subtle.exportKey("raw", unwrappedKey); 95 return crypto.subtle.exportKey("raw", unwrappedKey);
96 }).then(function(result) { 96 }).then(function(result) {
97 unwrappedKeyData = result; 97 unwrappedKeyData = result;
98 shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData) "); 98 shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData) ");
99 }).then(finishJSTest, failAndFinishJSTest); 99 }).then(finishJSTest, failAndFinishJSTest);
100 </script> 100 </script>
101 101
102 </body> 102 </body>
103 </html> 103 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/rsa-oaep-plaintext-length.html ('k') | LayoutTests/crypto/rsassa-pkcs1-v1_5-import-jwk.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698