deno
fd9def34 - fix(node): support ECDSA with secp256k1 in `node:crypto` (#32390)

Commit
163 days ago
fix(node): support ECDSA with secp256k1 in `node:crypto` (#32390) ## Summary - Adds secp256k1 ECDSA support to `node:crypto` key generation, signing, verification, and key import/export (DER, PEM, JWK) - Adds `Secp256k1` variant to `EcPrivateKey`/`EcPublicKey` enums using the existing `k256` crate - Enables `ecdh`, `jwk`, `pem` features on `k256` workspace dependency Closes #27523 ## Details The `k256` crate was already used for ECDH with secp256k1, but the ECDSA key generation/signing/verification paths only supported P-224, P-256, and P-384. This PR adds secp256k1 support across all EC code paths: - **Key generation**: `generateKeyPair('ec', { namedCurve: 'secp256k1' })` now works - **Signing/verification**: `sign()`, `verify()`, `createSign()`, `createVerify()` with secp256k1 keys - **Key import/export**: PKCS#8, SEC1, SPKI (DER/PEM), and JWK formats - **Key details**: Reports `namedCurve: "secp256k1"` in `asymmetricKeyDetails` - **X.509**: Parsing secp256k1 public keys from certificates - **DH**: `diffieHellman()` with secp256k1 KeyObject pairs 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Author
Parents
Loading