From b00f076017ca82e1f5f29de0a58dfaea8cdddeb2 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 14 Mar 2024 06:53:50 -0700 Subject: fix(ext/node): Support private EC key signing (#22914) Fixes https://github.com/denoland/deno/issues/18972 Support for web-push VAPID keys & jws signing - Fixes EC keygen to return raw private key and uncompressed public key point. - Support for `EC PRIVATE KEY` --- tests/unit_node/crypto/crypto_sign_test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/unit_node/crypto/crypto_sign_test.ts') diff --git a/tests/unit_node/crypto/crypto_sign_test.ts b/tests/unit_node/crypto/crypto_sign_test.ts index be459bf52..2ca0af943 100644 --- a/tests/unit_node/crypto/crypto_sign_test.ts +++ b/tests/unit_node/crypto/crypto_sign_test.ts @@ -127,3 +127,14 @@ Deno.test({ } }, }); + +Deno.test({ + name: "crypto.createSign|sign - EC PRIVATE KEY", + fn() { + const pem = `-----BEGIN EC PRIVATE KEY----- +MDECAQEEIIThPSZ00CNW1UD5Ju9mhplv6SSs3T5objYjlx11gHW9oAoGCCqGSM49 +AwEH +-----END EC PRIVATE KEY-----`; + createSign("SHA256").update("test").sign(pem, "base64"); + }, +}); -- cgit v1.2.3