From ec09134d8aab3d84db28d6469789c5581d99fec9 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Fri, 28 Oct 2022 16:20:38 +0200 Subject: fix(ext/crypto): fix HMAC jwk import "use" check (#16465) --- cli/tests/unit/webcrypto_test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cli/tests') 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"], + ); +}); -- cgit v1.2.3