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

Side by Side Diff: LayoutTests/crypto/rsa-export-private-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 20 matching lines...) Expand all
31 "kid":"2011-04-29" 31 "kid":"2011-04-29"
32 } 32 }
33 33
34 debug("\nImporting a JWK key..."); 34 debug("\nImporting a JWK key...");
35 crypto.subtle.importKey("jwk", privateKeyJSON, {name: "RSASSA-PKCS1-v1_5", hash: {name: "sha-256"}}, extractable, ['sign']).then(function(result) { 35 crypto.subtle.importKey("jwk", privateKeyJSON, {name: "RSASSA-PKCS1-v1_5", hash: {name: "sha-256"}}, extractable, ['sign']).then(function(result) {
36 key = result; 36 key = result;
37 37
38 debug("\nExporting the key as JWK..."); 38 debug("\nExporting the key as JWK...");
39 return crypto.subtle.exportKey("jwk", key); 39 return crypto.subtle.exportKey("jwk", key);
40 }).then(function(result) { 40 }).then(function(result) {
41 exportedJWK = JSON.parse(bytesToASCIIString(result)); 41 exportedJWK = result;
42 42
43 shouldBe("exportedJWK.kty", "'RSA'"); 43 shouldBe("exportedJWK.kty", "'RSA'");
44 shouldBe("exportedJWK.n", "privateKeyJSON.n"); 44 shouldBe("exportedJWK.n", "privateKeyJSON.n");
45 shouldBe("exportedJWK.e", "privateKeyJSON.e"); 45 shouldBe("exportedJWK.e", "privateKeyJSON.e");
46 shouldBe("exportedJWK.d", "privateKeyJSON.d"); 46 shouldBe("exportedJWK.d", "privateKeyJSON.d");
47 shouldBe("exportedJWK.p", "privateKeyJSON.p"); 47 shouldBe("exportedJWK.p", "privateKeyJSON.p");
48 shouldBe("exportedJWK.q", "privateKeyJSON.q"); 48 shouldBe("exportedJWK.q", "privateKeyJSON.q");
49 shouldBe("exportedJWK.dp", "privateKeyJSON.dp"); 49 shouldBe("exportedJWK.dp", "privateKeyJSON.dp");
50 shouldBe("exportedJWK.dq", "privateKeyJSON.dq"); 50 shouldBe("exportedJWK.dq", "privateKeyJSON.dq");
51 shouldBe("exportedJWK.qi", "privateKeyJSON.qi"); 51 shouldBe("exportedJWK.qi", "privateKeyJSON.qi");
52 shouldBe("exportedJWK.oth", "privateKeyJSON.oth"); 52 shouldBe("exportedJWK.oth", "privateKeyJSON.oth");
53 shouldBe("exportedJWK.alg", "privateKeyJSON.alg"); 53 shouldBe("exportedJWK.alg", "privateKeyJSON.alg");
54 shouldBe("exportedJWK.ext", "true"); 54 shouldBe("exportedJWK.ext", "true");
55 shouldBe("exportedJWK.key_ops", "['sign']"); 55 shouldBe("exportedJWK.key_ops", "['sign']");
56 shouldBe("exportedJWK.use", "undefined"); 56 shouldBe("exportedJWK.use", "undefined");
57 }).then(finishJSTest, failAndFinishJSTest); 57 }).then(finishJSTest, failAndFinishJSTest);
58 58
59 </script> 59 </script>
60 60
61 </body> 61 </body>
62 </html> 62 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/rsa-export-key.html ('k') | LayoutTests/crypto/rsa-oaep-key-manipulation.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698