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

Side by Side Diff: LayoutTests/crypto/rsa-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
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 28 matching lines...) Expand all
39 return crypto.subtle.exportKey("", key); 39 return crypto.subtle.exportKey("", key);
40 }).then(failAndFinishJSTest, function(result) { 40 }).then(failAndFinishJSTest, function(result) {
41 logError(result); 41 logError(result);
42 return crypto.subtle.exportKey("foobar", key); 42 return crypto.subtle.exportKey("foobar", key);
43 }).then(failAndFinishJSTest, function(result) { 43 }).then(failAndFinishJSTest, function(result) {
44 logError(result); 44 logError(result);
45 45
46 debug("\nExporting the key as JWK..."); 46 debug("\nExporting the key as JWK...");
47 return crypto.subtle.exportKey("jwk", key); 47 return crypto.subtle.exportKey("jwk", key);
48 }).then(function(result) { 48 }).then(function(result) {
49 exportedJWK = JSON.parse(bytesToASCIIString(result)); 49 exportedJWK = result;
50 50
51 shouldBe("exportedJWK.kty", "'RSA'"); 51 shouldBe("exportedJWK.kty", "'RSA'");
52 shouldBe("exportedJWK.n", "publicKeyJSON.n"); 52 shouldBe("exportedJWK.n", "publicKeyJSON.n");
53 shouldBe("exportedJWK.e", "publicKeyJSON.e"); 53 shouldBe("exportedJWK.e", "publicKeyJSON.e");
54 shouldBe("exportedJWK.alg", "'RS256'"); 54 shouldBe("exportedJWK.alg", "'RS256'");
55 shouldBe("exportedJWK.ext", "true"); 55 shouldBe("exportedJWK.ext", "true");
56 shouldBe("exportedJWK.use", "undefined"); 56 shouldBe("exportedJWK.use", "undefined");
57 shouldBe("exportedJWK.key_ops", "['verify']"); 57 shouldBe("exportedJWK.key_ops", "['verify']");
58 }).then(finishJSTest, failAndFinishJSTest); 58 }).then(finishJSTest, failAndFinishJSTest);
59 </script> 59 </script>
60 60
61 </body> 61 </body>
62 </html> 62 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/jwk-export-use-values.html ('k') | LayoutTests/crypto/rsa-export-private-key.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698