| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| description("Test exporting a 192 bits AES-KW key with JWK format"); |
| debug("Generating a key..."); |
| crypto.subtle.generateKey({name: "aes-kw", length: 192}, extractable, ["unwrapKey", "wrapKey"]).then(function(key) { |
| debug("Exporting a key..."); |
| return crypto.subtle.exportKey("jwk", key); |
| }).then(function(result) { |
| shouldBe("key.kty", "'oct'"); |
| shouldBe("key.key_ops", "['unwrapKey', 'wrapKey']"); |
| shouldBe("key.alg", "'A192KW'"); |
| shouldBe("key.ext", "true"); |
| shouldBe("Base64URL.parse(key.k).byteLength", "24"); |
| <script src="../../resources/js-test-post.js"></script> |