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

Side by Side Diff: LayoutTests/crypto/rsa-oaep-key-manipulation.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 jwkPublicKeyArray = result; 64 jwkPublicKeyArray = result;
65 jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray)); 65 jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray));
66 shouldBe("jwkPublicKey.alg", "'RSA-OAEP'"); 66 shouldBe("jwkPublicKey.alg", "'RSA-OAEP'");
67 shouldBe("jwkPublicKey.ext", "true"); 67 shouldBe("jwkPublicKey.ext", "true");
68 shouldBe("jwkPublicKey.key_ops", "['encrypt', 'wrapKey']"); 68 shouldBe("jwkPublicKey.key_ops", "['encrypt', 'wrapKey']");
69 shouldBe("jwkPublicKey.use", "undefined"); 69 shouldBe("jwkPublicKey.use", "undefined");
70 shouldBe("jwkPublicKey.kty", "'RSA'"); 70 shouldBe("jwkPublicKey.kty", "'RSA'");
71 shouldBe("bytesToHexString(Base64URL.parse(jwkPublicKey.e))", "'010001'"); 71 shouldBe("bytesToHexString(Base64URL.parse(jwkPublicKey.e))", "'010001'");
72 72
73 debug("\nImporting it back..."); 73 debug("\nImporting it back...");
74 return crypto.subtle.importKey("jwk", jwkPublicKeyArray, { name: "RSA-OAEP", hash: {name: "sha-1"} }, extractable, ["encrypt", "wrapKey"]); 74 return crypto.subtle.importKey("jwk", jwkPublicKey, { name: "RSA-OAEP", hash : {name: "sha-1"} }, extractable, ["encrypt", "wrapKey"]);
75 }).then(function(result) { 75 }).then(function(result) {
76 exportedPublicKey = result; 76 exportedPublicKey = result;
77 shouldBe("exportedPublicKey.type", "'public'"); 77 shouldBe("exportedPublicKey.type", "'public'");
78 shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'"); 78 shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'");
79 shouldBe("exportedPublicKey.algorithm.modulusLength", "2048"); 79 shouldBe("exportedPublicKey.algorithm.modulusLength", "2048");
80 shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'0 10001'"); 80 shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'0 10001'");
81 shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'"); 81 shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'");
82 shouldBe("exportedPublicKey.extractable", "true"); 82 shouldBe("exportedPublicKey.extractable", "true");
83 shouldBe("exportedPublicKey.usages", "['encrypt','wrapKey']"); 83 shouldBe("exportedPublicKey.usages", "['encrypt','wrapKey']");
84 84
85 }).then(finishJSTest, failAndFinishJSTest); 85 }).then(finishJSTest, failAndFinishJSTest);
86 86
87 </script> 87 </script>
88 88
89 </body> 89 </body>
90 </html> 90 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/rsa-indexeddb.html ('k') | LayoutTests/crypto/rsa-oaep-plaintext-length.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698