diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/webcrypto_test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts index c5f5dc6c2..38f183c11 100644 --- a/cli/tests/unit/webcrypto_test.ts +++ b/cli/tests/unit/webcrypto_test.ts @@ -1919,3 +1919,13 @@ Deno.test(async function testImportLeadingZeroesKey() { assert(key instanceof CryptoKey); assertEquals(key.type, "private"); }); + +// https://github.com/denoland/deno/issues/15523 +Deno.test(async function testECspkiRoundTrip() { + const alg = { name: "ECDH", namedCurve: "P-256" }; + const { publicKey } = await crypto.subtle.generateKey(alg, true, [ + "deriveBits", + ]); + const spki = await crypto.subtle.exportKey("spki", publicKey); + await crypto.subtle.importKey("spki", spki, alg, true, []); +}); |