summaryrefslogtreecommitdiff
path: root/cli/tests/unit/webcrypto_test.ts
diff options
context:
space:
mode:
authorFilip Skokan <panva.ip@gmail.com>2022-10-04 13:39:41 +0200
committerGitHub <noreply@github.com>2022-10-04 17:09:41 +0530
commitaa710aac98885356cfb5bdfd237d2be8265ed2e6 (patch)
tree83788f2d678482fe3de8bae89bd014432ecdf83e /cli/tests/unit/webcrypto_test.ts
parentfd08b13dff9743926c0f6045ca0c7958d55048da (diff)
fix(ext/crypto): ecdh spki key import/export roundtrip (#16152)
Diffstat (limited to 'cli/tests/unit/webcrypto_test.ts')
-rw-r--r--cli/tests/unit/webcrypto_test.ts10
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, []);
+});