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

Unified Diff: LayoutTests/crypto/ecdh-import-jwk.html

Issue 754563003: Add LayoutTests for WebCrypto's ECDH algorithm. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/crypto/ecdh-generate-key-expected.txt ('k') | LayoutTests/crypto/ecdh-import-jwk-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/ecdh-import-jwk.html
diff --git a/LayoutTests/crypto/ecdsa-import-jwk.html b/LayoutTests/crypto/ecdh-import-jwk.html
similarity index 77%
copy from LayoutTests/crypto/ecdsa-import-jwk.html
copy to LayoutTests/crypto/ecdh-import-jwk.html
index 76b53d185958d83c507bfa43e0ec79978cfb78a5..70af32665c9c47bac6a4199a1fb081d756c167a9 100644
--- a/LayoutTests/crypto/ecdsa-import-jwk.html
+++ b/LayoutTests/crypto/ecdh-import-jwk.html
@@ -9,7 +9,7 @@
<div id="console"></div>
<script>
-description("Test importing an EC public and private key for ECDSA.");
+description("Test importing an EC public and private key for ECDH.");
jsTestIsAsync = true;
@@ -31,21 +31,21 @@ var privateKeyJSON = {
};
debug("Importing a public key...");
-crypto.subtle.importKey("jwk", publicKeyJSON, {name: "ECDSA", namedCurve: "P-256"}, extractable, ["verify"]).then(function(result) {
+crypto.subtle.importKey("jwk", publicKeyJSON, {name: "ECDH", namedCurve: "P-256"}, extractable, []).then(function(result) {
publicKey = result;
shouldBe("publicKey.toString()", "'[object CryptoKey]'");
shouldBe("publicKey.type", "'public'");
- shouldBe("publicKey.usages", "['verify']");
- shouldBe("publicKey.algorithm.name", "'ECDSA'");
+ shouldBe("publicKey.usages", "[]");
+ shouldBe("publicKey.algorithm.name", "'ECDH'");
shouldBe("publicKey.algorithm.namedCurve", "'P-256'");
debug("\nImporting a private key...");
- return crypto.subtle.importKey("jwk", privateKeyJSON, {name: "ECDSA", namedCurve: "P-384"}, extractable, ["sign"]);
+ return crypto.subtle.importKey("jwk", privateKeyJSON, {name: "ECDH", namedCurve: "P-384"}, extractable, ["deriveBits"]);
}).then(function(result) {
privateKey = result;
shouldBe("privateKey.toString()", "'[object CryptoKey]'");
shouldBe("privateKey.type", "'private'");
- shouldBe("privateKey.usages", "['sign']");
- shouldBe("privateKey.algorithm.name", "'ECDSA'");
+ shouldBe("privateKey.usages", "['deriveBits']");
+ shouldBe("privateKey.algorithm.name", "'ECDH'");
shouldBe("privateKey.algorithm.namedCurve", "'P-384'");
}).then(finishJSTest, failAndFinishJSTest);
</script>
« no previous file with comments | « LayoutTests/crypto/ecdh-generate-key-expected.txt ('k') | LayoutTests/crypto/ecdh-import-jwk-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698