blob: 93d9894b2c1f38236a4037943b47bd8318c08ba8 [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 JWK AES-KW key with legnth 192");
jsTestIsAsync = true;
var jwkKey = {
kty: "oct",
k: "A72FD48989ED7E92A3B3A080F74FA80B",
alg: "A192KW",
};
var extractable = true;
debug("Importing a key...");
crypto.subtle.importKey("jwk", jwkKey, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
key = result;
shouldBe("key.type", "'secret'");
shouldBe("key.extractable", "true");
shouldBe("key.algorithm.name", "'AES-KW'");
shouldBe("key.algorithm.length", "192");
shouldBe("key.usages", "['unwrapKey', 'wrapKey']");
finishJSTest();
});
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>