blob: 11c574fc94287cbecbf7f3cb09eae73c14d2e7b4 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="../resources/common.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test importing a raw AES-CBC key with legnth 192");
jsTestIsAsync = true;
var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMrgJB55WL4");
var extractable = true;
debug("Importing a key...");
crypto.subtle.importKey("raw", rawKey, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
key = result;
shouldBe("key.type", "'secret'");
shouldBe("key.extractable", "true");
shouldBe("key.algorithm.name", "'AES-CBC'");
shouldBe("key.algorithm.length", "192");
shouldBe("key.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']");
finishJSTest();
});
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>