| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| description("Test importing a non-extractable JWK HMAC key"); |
| k: "YWJjZGVmZ2gxMjM0NTY3OA", |
| var nonExtractable = false; |
| debug("Importing a key..."); |
| crypto.subtle.importKey("jwk", jwkKey, {name: "hmac", hash: "sha-1"}, nonExtractable, ["sign", "verify"]).then(function(result) { |
| shouldBe("key.type", "'secret'"); |
| shouldBe("key.extractable", "false"); |
| shouldBe("key.algorithm.name", "'HMAC'"); |
| shouldBe("key.algorithm.length", "128"); |
| shouldBe("key.algorithm.hash.name", "'SHA-1'"); |
| shouldBe("key.usages", "['sign', 'verify']"); |
| <script src="../../resources/js-test-post.js"></script> |