summaryrefslogtreecommitdiff
path: root/cli/tests/unit/webcrypto_test.ts
diff options
context:
space:
mode:
authorFilip Skokan <panva.ip@gmail.com>2022-10-28 16:20:38 +0200
committerGitHub <noreply@github.com>2022-10-28 19:50:38 +0530
commitec09134d8aab3d84db28d6469789c5581d99fec9 (patch)
tree8336146ad6bb34328a46ec787e8508227b4013a9 /cli/tests/unit/webcrypto_test.ts
parente18950284f279cfa8ec090cb8a882dbd64e92d4a (diff)
fix(ext/crypto): fix HMAC jwk import "use" check (#16465)
Diffstat (limited to 'cli/tests/unit/webcrypto_test.ts')
-rw-r--r--cli/tests/unit/webcrypto_test.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts
index 10acc7940..86d9f38ab 100644
--- a/cli/tests/unit/webcrypto_test.ts
+++ b/cli/tests/unit/webcrypto_test.ts
@@ -1965,3 +1965,18 @@ Deno.test(async function testECspkiRoundTrip() {
const spki = await crypto.subtle.exportKey("spki", publicKey);
await crypto.subtle.importKey("spki", spki, alg, true, []);
});
+
+Deno.test(async function testHmacJwkImport() {
+ await crypto.subtle.importKey(
+ "jwk",
+ {
+ kty: "oct",
+ use: "sig",
+ alg: "HS256",
+ k: "hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg",
+ },
+ { name: "HMAC", hash: "SHA-256" },
+ false,
+ ["sign", "verify"],
+ );
+});