Index: LayoutTests/crypto/clone-rsaKey-private.html |
diff --git a/LayoutTests/crypto/clone-rsaKey-public.html b/LayoutTests/crypto/clone-rsaKey-private.html |
similarity index 85% |
copy from LayoutTests/crypto/clone-rsaKey-public.html |
copy to LayoutTests/crypto/clone-rsaKey-private.html |
index 79866f691ddc689082e1d752606fd7762b792850..a9400dad7fca07cbd6687759014b9a3a7db8791d 100644 |
--- a/LayoutTests/crypto/clone-rsaKey-public.html |
+++ b/LayoutTests/crypto/clone-rsaKey-private.html |
@@ -10,7 +10,7 @@ |
<div id="console"></div> |
<script> |
-description("Tests structured cloning of RSA keys (without a hash)"); |
+description("Tests structured cloning of RSA private keys (without a hash)"); |
jsTestIsAsync = true; |
@@ -24,32 +24,32 @@ var kPossibleExtractable = [true, false]; |
var kPossibleKeyUsages = [[], ['encrypt'], ['decrypt', 'wrapKey'], ['encrypt', 'wrapKey', 'unwrapKey']]; |
var kPossibleKeyData = [ |
- kKeyData.rsa2, |
- kKeyData.rsa3 |
+ kKeyData.rsa1, |
+ kKeyData.rsa4 |
]; |
function runTest(algorithmName, extractable, keyUsages, keyData) |
{ |
- var importData = hexStringToUint8Array(keyData.spki); |
+ var importData = hexStringToUint8Array(keyData.pkcs8); |
var importAlgorithm = { name: algorithmName }; |
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); |
@@ -60,7 +60,7 @@ function runTest(algorithmName, 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); |
@@ -71,7 +71,7 @@ function runTest(algorithmName, extractable, keyUsages, keyData) |
logSerializedKey(importedKey); |
if (extractable) |
- bytesShouldMatchHexString("Cloned key exported data", keyData.spki, clonedKeyData); |
+ bytesShouldMatchHexString("Cloned key exported data", keyData.pkcs8, clonedKeyData); |
debug(""); |
}); |