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

Side by Side Diff: LayoutTests/crypto/aes-export-key.html

Issue 338993002: [webcrypto] exportKey() now returns dictionary when format='jwk' (CL 2 of 2). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and fix rsa-oaep-key-manipulation.html 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
« no previous file with comments | « no previous file | LayoutTests/crypto/hmac-export-key.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 debug("\nExporting the key as raw data..."); 62 debug("\nExporting the key as raw data...");
63 return crypto.subtle.exportKey("raw", key); 63 return crypto.subtle.exportKey("raw", key);
64 }).then(function(result) { 64 }).then(function(result) {
65 exportedData = result; 65 exportedData = result;
66 shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'8e73b0f7da0e645 2c810f32b809079e562f8ead2522c6b7b8e73b0f7da0e6452'"); 66 shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'8e73b0f7da0e645 2c810f32b809079e562f8ead2522c6b7b8e73b0f7da0e6452'");
67 67
68 debug("Exporting the key as JWK..."); 68 debug("Exporting the key as JWK...");
69 return crypto.subtle.exportKey("jwk", key); 69 return crypto.subtle.exportKey("jwk", key);
70 }).then(function(result) { 70 }).then(function(result) {
71 exportedJWK = JSON.parse(bytesToASCIIString(result)); 71 exportedJWK = result;
72 shouldBe("exportedJWK.kty", "'oct'"); 72 shouldBe("exportedJWK.kty", "'oct'");
73 shouldBe("exportedJWK.k", "'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7jnOw99oOZFI'"); 73 shouldBe("exportedJWK.k", "'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7jnOw99oOZFI'");
74 shouldBe("exportedJWK.alg", "'A256CBC'"); 74 shouldBe("exportedJWK.alg", "'A256CBC'");
75 shouldBe("exportedJWK.ext", "true"); 75 shouldBe("exportedJWK.ext", "true");
76 shouldBe("exportedJWK.use", "undefined"); 76 shouldBe("exportedJWK.use", "undefined");
77 shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKe y']"); 77 shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKe y']");
78 78
79 debug("\nImporting a key that's not extractable..."); 79 debug("\nImporting a key that's not extractable...");
80 return crypto.subtle.importKey("jwk", jwkKey, {name: "AES-CBC"}, nonExtracta ble, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']) 80 return crypto.subtle.importKey("jwk", jwkKey, {name: "AES-CBC"}, nonExtracta ble, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])
81 }).then(function(result) { 81 }).then(function(result) {
(...skipping 16 matching lines...) Expand all
98 }, function(result) { 98 }, function(result) {
99 testPassed("Rejected, as expected"); 99 testPassed("Rejected, as expected");
100 logError(result); 100 logError(result);
101 101
102 finishJSTest(); 102 finishJSTest();
103 }); 103 });
104 </script> 104 </script>
105 105
106 </body> 106 </body>
107 </html> 107 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/hmac-export-key.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698