Skip to content

typings: add typing for crypto - #64122

Closed
panva wants to merge 1 commit into
nodejs:mainfrom
panva:internal-bindings-crypto
Closed

panva wants to merge 1 commit into
nodejs:mainfrom
panva:internal-bindings-crypto

Conversation

@panva

@panva panva commented Jun 25, 2026

Copy link
Copy Markdown
Member

Add typings for the internalBinding('crypto') surface used by the JS crypto, TLS, and WebCrypto implementation, and wire the binding into InternalBindingMap.

The declaration models the JS-consumed native surface, including mode-dependent CryptoJob behavior, WebCrypto promise jobs, CryptoKey/KeyObject slot tuples, key generation result shapes, sign/verify/MAC result types, cipher jobs, FIPS/root-certificate helpers, secureHeapUsed(), and timingSafeEqual().

This also adds JSDoc types for the internal WebCrypto job-promise helpers so Promise payloads such as generated CryptoKey values are preserved through jobPromise() and jobPromiseThen().

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
@panva
panva requested a review from anonrig June 25, 2026 08:43
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. typings Issues and PRs related to internal TypeScript declarations. labels Jun 25, 2026
@panva panva removed the needs-ci PRs that need a full CI run. label Jun 25, 2026

@aduh95 aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.