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(""); |
}); |