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

Unified Diff: LayoutTests/crypto/clone-rsaKey-public.html

Issue 285823002: [webcrypto] Remove RSA-ES support (1 of 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix some usages Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/crypto/clone-rsaKey-public.html
diff --git a/LayoutTests/crypto/clone-rsaKey-public.html b/LayoutTests/crypto/clone-rsaKey-public.html
deleted file mode 100644
index 1ba43351f9eaa6aef5080a2dc408de9551a26a4c..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/clone-rsaKey-public.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../resources/js-test.js"></script>
-<script src="resources/common.js"></script>
-<script src="resources/keys.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Tests structured cloning of RSA public keys (without a hash)");
-
-jsTestIsAsync = true;
-
-// Tests the 16 permutations of keys generated by:
-// kPossibleAlgorithms x kPossibleExtractable x kPossibleKeyUsages x kPossibleKeyData
-//
-// For practical reasons these tests are not exhaustive.
-
-var kPossibleAlgorithms = ['RSAES-PKCS1-v1_5'];
-var kPossibleExtractable = [true, false];
-var kPossibleKeyUsages = [[], ['encrypt'], ['decrypt', 'wrapKey'], ['encrypt', 'wrapKey', 'unwrapKey']];
-
-var kPossibleKeyData = [
- kKeyData.rsa2,
- kKeyData.rsa3
-];
-
-function runTest(algorithmName, extractable, keyUsages, keyData)
-{
- var importData = hexStringToUint8Array(keyData.spki);
- var importAlgorithm = { name: algorithmName };
-
- var results = {};
-
- return crypto.subtle.importKey('spki', importData, importAlgorithm, extractable, keyUsages).then(function(importedKey) {
- results.importedKey = importedKey;
- importedKey.extraProperty = 'hi';
- return cloneKey(importedKey);
- }).then(function(clonedKey) {
- results.clonedKey = clonedKey;
- if (extractable)
- return crypto.subtle.exportKey('spki', clonedKey);
- return null;
- }).then(function(clonedKeyData) {
- importedKey = results.importedKey;
- clonedKey = results.clonedKey;
-
- shouldEvaluateAs("importedKey.extraProperty", "hi");
- shouldEvaluateAs("importedKey.type", "public");
- shouldEvaluateAs("importedKey.extractable", extractable);
- shouldEvaluateAs("importedKey.algorithm.name", algorithmName);
- shouldEvaluateAs("importedKey.algorithm.modulusLength", keyData.modulusLengthBits);
- bytesShouldMatchHexString("importedKey.algorithm.publicExponent", keyData.publicExponent, importedKey.algorithm.publicExponent);
- shouldBeUndefined("importedKey.algorithm.hash");
- shouldEvaluateAs("importedKey.usages.join(',')", keyUsages.join(","));
-
- shouldNotBe("importedKey", "clonedKey");
-
- shouldBeUndefined("clonedKey.extraProperty");
- shouldEvaluateAs("clonedKey.type", "public");
- shouldEvaluateAs("clonedKey.extractable", extractable);
- shouldEvaluateAs("clonedKey.algorithm.name", algorithmName);
- shouldEvaluateAs("clonedKey.algorithm.modulusLength", keyData.modulusLengthBits);
- bytesShouldMatchHexString("clonedKey.algorithm.publicExponent", keyData.publicExponent, clonedKey.algorithm.publicExponent);
- shouldBeUndefined("clonedKey.algorithm.hash");
- shouldEvaluateAs("clonedKey.usages.join(',')", keyUsages.join(","));
-
- logSerializedKey(importedKey);
-
- if (extractable)
- bytesShouldMatchHexString("Cloned key exported data", keyData.spki, clonedKeyData);
-
- debug("");
- });
-}
-
-var lastPromise = Promise.resolve(null);
-
-kPossibleAlgorithms.forEach(function(algorithmName) {
- kPossibleExtractable.forEach(function(extractable) {
- kPossibleKeyUsages.forEach(function(keyUsages) {
- kPossibleKeyData.forEach(function(keyData) {
- lastPromise = lastPromise.then(runTest.bind(null, algorithmName, extractable, keyUsages, keyData));
- });
- });
- });
-});
-
-lastPromise.then(finishJSTest, failAndFinishJSTest);
-
-</script>
-
-</body>
-</html>
« no previous file with comments | « LayoutTests/crypto/clone-rsaKey-private-expected.txt ('k') | LayoutTests/crypto/clone-rsaKey-public-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698