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

Unified Diff: LayoutTests/crypto/clone-rsaHashedKey-private.html

Issue 210693002: [webcrypto] Add structured clone tests for RSA private keys. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | LayoutTests/crypto/clone-rsaHashedKey-private-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/clone-rsaHashedKey-private.html
diff --git a/LayoutTests/crypto/clone-rsaHashedKey-public.html b/LayoutTests/crypto/clone-rsaHashedKey-private.html
similarity index 86%
copy from LayoutTests/crypto/clone-rsaHashedKey-public.html
copy to LayoutTests/crypto/clone-rsaHashedKey-private.html
index b9bfff888dac6bf02b73bcba097bc0dafc675bb0..950eab4694caa4edb374342eda6f82bca2ab5b60 100644
--- a/LayoutTests/crypto/clone-rsaHashedKey-public.html
+++ b/LayoutTests/crypto/clone-rsaHashedKey-private.html
@@ -10,7 +10,7 @@
<div id="console"></div>
<script>
-description("Tests structured cloning of RSA keys (with a hash)");
+description("Tests structured cloning of RSA private keys (with a hash)");
jsTestIsAsync = true;
@@ -25,32 +25,32 @@ var kPossibleKeyUsages = [[], ['sign'], ['verify'], ['sign', 'verify']];
var kPossibleHashAlgorithms = ['SHA-1', 'SHA-256', 'SHA-512'];
var kPossibleKeyData = [
- kKeyData.rsa2,
- kKeyData.rsa3
+ kKeyData.rsa1,
+ kKeyData.rsa4
];
function runTest(algorithmName, hashName, extractable, keyUsages, keyData)
{
- var importData = hexStringToUint8Array(keyData.spki);
+ var importData = hexStringToUint8Array(keyData.pkcs8);
var importAlgorithm = { name: algorithmName, hash: {name: hashName} };
var results = {};
- return crypto.subtle.importKey('spki', importData, importAlgorithm, extractable, keyUsages).then(function(importedKey) {
+ return crypto.subtle.importKey('pkcs8', 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 crypto.subtle.exportKey('pkcs8', clonedKey);
return null;
}).then(function(clonedKeyData) {
importedKey = results.importedKey;
clonedKey = results.clonedKey;
shouldEvaluateAs("importedKey.extraProperty", "hi");
- shouldEvaluateAs("importedKey.type", "public");
+ shouldEvaluateAs("importedKey.type", "private");
shouldEvaluateAs("importedKey.extractable", extractable);
shouldEvaluateAs("importedKey.algorithm.name", algorithmName);
shouldEvaluateAs("importedKey.algorithm.modulusLength", keyData.modulusLengthBits);
@@ -61,7 +61,7 @@ function runTest(algorithmName, hashName, extractable, keyUsages, keyData)
shouldBeTrue("importedKey != clonedKey");
shouldBeUndefined("clonedKey.extraProperty");
- shouldEvaluateAs("clonedKey.type", "public");
+ shouldEvaluateAs("clonedKey.type", "private");
shouldEvaluateAs("clonedKey.extractable", extractable);
shouldEvaluateAs("clonedKey.algorithm.name", algorithmName);
shouldEvaluateAs("clonedKey.algorithm.modulusLength", keyData.modulusLengthBits);
@@ -72,7 +72,7 @@ function runTest(algorithmName, hashName, extractable, keyUsages, keyData)
logSerializedKey(importedKey);
if (extractable)
- bytesShouldMatchHexString("Cloned key exported data", keyData.spki, clonedKeyData);
+ bytesShouldMatchHexString("Cloned key exported data", keyData.pkcs8, clonedKeyData);
debug("");
});
« no previous file with comments | « no previous file | LayoutTests/crypto/clone-rsaHashedKey-private-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698