| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| description("Test signing with HMAC SHA-384 using an imported key"); |
| var text = asciiToUint8Array("Hello, World!"); |
| var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); |
| var expectedSignature = "5cfc6cba3135c99cb426d5d59bd33c5e212aac082f5ba57a1f70def2b3e987e3f3078be80f142221b6a8e23768dd994f"; |
| crypto.subtle.importKey("raw", rawKey, hmacImportParams, extractable, ["sign", "verify"]).then(function(key) { |
| return crypto.subtle.sign("hmac", key, text); |
| }).then(function(result) { |
| shouldBe("bytesToHexString(signature)", "expectedSignature"); |
| <script src="../../resources/js-test-post.js"></script> |