diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-03-14 06:53:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 14:53:50 +0100 |
commit | b00f076017ca82e1f5f29de0a58dfaea8cdddeb2 (patch) | |
tree | 35d9781e38a10766de006282e4c4a358c6b482b3 /tests/unit_node | |
parent | 9c348a0acd7d1bc288c2ce5b66016571b9603288 (diff) |
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`
Diffstat (limited to 'tests/unit_node')
-rw-r--r-- | tests/unit_node/crypto/crypto_sign_test.ts | 11 |
1 files changed, 11 insertions, 0 deletions
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"); + }, +}); |