34 lines
769 B
HTML
34 lines
769 B
HTML
<!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 exporting a 256 bits AES-GCM key with raw format");
|
|
|
|
jsTestIsAsync = true;
|
|
|
|
var extractable = true;
|
|
|
|
debug("Generating a key...");
|
|
crypto.subtle.generateKey({name: "aes-gcm", length: 256}, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(key) {
|
|
debug("Exporting a key...");
|
|
return crypto.subtle.exportKey("raw", key);
|
|
}).then(function(result) {
|
|
key = result;
|
|
|
|
shouldBe("key.byteLength", "32");
|
|
|
|
finishJSTest();
|
|
});
|
|
</script>
|
|
|
|
<script src="../../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|