| 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>
|
|
|