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

Unified Diff: LayoutTests/crypto/ecdsa-generate-key.html

Issue 707753002: WebCrypto: Add LayoutTests for ECDSA. (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
Index: LayoutTests/crypto/ecdsa-generate-key.html
diff --git a/LayoutTests/crypto/rsassa-pkcs1-v1_5-generate-key.html b/LayoutTests/crypto/ecdsa-generate-key.html
similarity index 56%
copy from LayoutTests/crypto/rsassa-pkcs1-v1_5-generate-key.html
copy to LayoutTests/crypto/ecdsa-generate-key.html
index d5b64d69f083a6d803ac3454fa3d03e60f378fbf..8bf2ff3db5d9514c705ee97553be32a4b8d04069 100644
--- a/LayoutTests/crypto/rsassa-pkcs1-v1_5-generate-key.html
+++ b/LayoutTests/crypto/ecdsa-generate-key.html
@@ -9,16 +9,13 @@
<div id="console"></div>
<script>
-description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5.");
+description("Test generating an EC key pair for ECDSA.");
jsTestIsAsync = true;
var algorithmKeyGen = {
- name: "RSASSA-PKCS1-v1_5",
- hash: {name: "sha-256"},
- // RsaKeyGenParams
- modulusLength: 512,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+ name: "ecdsa",
+ namedCurve: "P-256",
};
var extractable = true;
@@ -27,16 +24,12 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then
keyPair = result;
shouldBe("keyPair.toString()", "'[object Object]'");
shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-256'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "512");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("keyPair.publicKey.algorithm.name", "'ECDSA'");
+ shouldBe("keyPair.publicKey.algorithm.namedCurve", "'P-256'");
shouldBe("keyPair.publicKey.usages", '["verify"]');
shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-256'");
- shouldBe("keyPair.privateKey.algorithm.modulusLength", "512");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("keyPair.privateKey.algorithm.name", "'ECDSA'");
+ shouldBe("keyPair.privateKey.algorithm.namedCurve", "'P-256'");
shouldBe("keyPair.privateKey.usages", '["sign"]');
debug("\nTesting that custom attributes on keys survive garbage collection...");

Powered by Google App Engine
This is Rietveld 408576698