| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| description("Test importing a raw AES-GCM key with legnth 128"); |
| var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); |
| debug("Importing a key..."); |
| crypto.subtle.importKey("raw", rawKey, "aes-gcm", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) { |
| shouldBe("key.type", "'secret'"); |
| shouldBe("key.extractable", "true"); |
| shouldBe("key.algorithm.name", "'AES-GCM'"); |
| shouldBe("key.algorithm.length", "128"); |
| shouldBe("key.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']"); |
| <script src="../../resources/js-test-post.js"></script> |