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 raw HMAC key with SHA-1 and then export it in raw format");
16 var rawKey = hexStringToUint8Array("192ff1e96a1399322db620760a738793ab6dfaf26bd2b3889bd81fc9d82ea25d11bb1b4763c0a9259512298e162dab2e6f505c9fc376fda1179a2a4055dd67f6");
17 var extractable = true;
19 debug("Importing a key...");
20 crypto.subtle.importKey("raw", rawKey, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]).then(function(cryptoKey) {
21 debug("Exporting a key...");
22 return crypto.subtle.exportKey("raw", cryptoKey);
23 }).then(function(result) {
24 exportedRawKey = new Uint8Array(result);
26 shouldBe("exportedRawKey", "rawKey");
33 <script src="../../resources/js-test-post.js"></script>