4 <script src="../../resources/js-test-pre.js"></script>
5 <script src="../resources/common.js"></script>
8 <p id="description"></p>
9 <div id="console"></div>
12 description("Test importing a JWK HMAC key with SHA-1 and then export it in raw format");
18 k: "vgJ5AXWT3Fm2w_zZCRF4UVwo53rIhwqLm6b9Tq4m1c53dr94eqPlxt99yb9RCjCFDa2C56K448xe4V964xFucg",
20 key_ops: ["sign", "verify"],
23 var extractable = true;
25 debug("Importing a key...");
26 crypto.subtle.importKey("jwk", jwkKey, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]).then(function(cryptoKey) {
27 debug("Exporting a key...");
28 return crypto.subtle.exportKey("raw", cryptoKey);
29 }).then(function(result) {
30 exportedRawKey = new Uint8Array(result);
32 shouldBe("Base64URL.stringify(exportedRawKey)", "jwkKey.k");
39 <script src="../../resources/js-test-post.js"></script>