@psnext/slingcli 3.0.20260827-1 → 3.3.20260911-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-PBNSMEG7.js → chunk-VDBOM5UG.js} +9 -9
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +25 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +76 -30
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +106 -22
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +155 -32
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +65 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-utils.js +217 -27
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +43 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/errors/index.js +20 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +11 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +11 -10
- package/node_modules/@smithy/core/dist-es/submodules/errors/errors.js +18 -0
- package/node_modules/@smithy/core/dist-es/submodules/errors/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
- package/node_modules/@smithy/core/dist-types/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/errors.d.ts +5 -0
- package/node_modules/@smithy/core/errors.js +5 -0
- package/node_modules/@smithy/core/package.json +11 -2
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -1
- package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +2 -1
- package/node_modules/@smithy/fetch-http-handler/package.json +3 -3
- package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +14 -0
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/node/assert/strict.d.ts +56 -13
- package/node_modules/@types/node/assert.d.ts +190 -189
- package/node_modules/@types/node/async_hooks.d.ts +43 -151
- package/node_modules/@types/node/buffer.buffer.d.ts +13 -12
- package/node_modules/@types/node/buffer.d.ts +237 -102
- package/node_modules/@types/node/child_process.d.ts +154 -39
- package/node_modules/@types/node/cluster.d.ts +384 -238
- package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/node_modules/@types/node/console.d.ts +404 -45
- package/node_modules/@types/node/constants.d.ts +10 -3
- package/node_modules/@types/node/crypto.d.ts +1600 -1007
- package/node_modules/@types/node/dgram.d.ts +81 -133
- package/node_modules/@types/node/diagnostics_channel.d.ts +59 -277
- package/node_modules/@types/node/dns/promises.d.ts +15 -9
- package/node_modules/@types/node/dns.d.ts +183 -136
- package/node_modules/@types/node/domain.d.ts +32 -12
- package/node_modules/@types/node/events.d.ts +696 -728
- package/node_modules/@types/node/fs/promises.d.ts +85 -256
- package/node_modules/@types/node/fs.d.ts +525 -865
- package/node_modules/@types/node/globals.d.ts +34 -12
- package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
- package/node_modules/@types/node/http.d.ts +311 -432
- package/node_modules/@types/node/http2.d.ts +891 -545
- package/node_modules/@types/node/https.d.ts +243 -64
- package/node_modules/@types/node/index.d.ts +7 -25
- package/node_modules/@types/node/inspector.d.ts +58 -70
- package/node_modules/@types/node/inspector.generated.d.ts +411 -765
- package/node_modules/@types/node/module.d.ts +219 -54
- package/node_modules/@types/node/net.d.ts +222 -208
- package/node_modules/@types/node/os.d.ts +49 -41
- package/node_modules/@types/node/package.json +3 -13
- package/node_modules/@types/node/path.d.ts +141 -119
- package/node_modules/@types/node/perf_hooks.d.ts +673 -310
- package/node_modules/@types/node/process.d.ts +205 -389
- package/node_modules/@types/node/punycode.d.ts +31 -3
- package/node_modules/@types/node/querystring.d.ts +16 -3
- package/node_modules/@types/node/readline/promises.d.ts +6 -3
- package/node_modules/@types/node/readline.d.ts +152 -66
- package/node_modules/@types/node/repl.d.ts +109 -101
- package/node_modules/@types/node/sea.d.ts +116 -1
- package/node_modules/@types/node/sqlite.d.ts +68 -486
- package/node_modules/@types/node/stream/consumers.d.ts +15 -91
- package/node_modules/@types/node/stream/promises.d.ts +15 -136
- package/node_modules/@types/node/stream/web.d.ts +456 -179
- package/node_modules/@types/node/stream.d.ts +491 -603
- package/node_modules/@types/node/string_decoder.d.ts +43 -3
- package/node_modules/@types/node/test.d.ts +292 -513
- package/node_modules/@types/node/timers/promises.d.ts +18 -3
- package/node_modules/@types/node/timers.d.ts +141 -3
- package/node_modules/@types/node/tls.d.ts +242 -140
- package/node_modules/@types/node/trace_events.d.ts +97 -3
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +8 -7
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
- package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
- package/node_modules/@types/node/tty.d.ts +43 -61
- package/node_modules/@types/node/url.d.ts +584 -156
- package/node_modules/@types/node/util.d.ts +1110 -181
- package/node_modules/@types/node/v8.d.ts +36 -175
- package/node_modules/@types/node/vm.d.ts +209 -292
- package/node_modules/@types/node/wasi.d.ts +74 -24
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
- package/node_modules/@types/node/web-globals/domexception.d.ts +0 -15
- package/node_modules/@types/node/web-globals/events.d.ts +0 -9
- package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
- package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
- package/node_modules/@types/node/web-globals/streams.d.ts +0 -93
- package/node_modules/@types/node/worker_threads.d.ts +407 -257
- package/node_modules/@types/node/zlib.d.ts +165 -7
- package/node_modules/express-rate-limit/dist/index.cjs +6 -3
- package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
- package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
- package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
- package/node_modules/express-rate-limit/dist/index.mjs +6 -3
- package/node_modules/express-rate-limit/{license.md → license} +7 -6
- package/node_modules/express-rate-limit/package.json +5 -5
- package/node_modules/express-rate-limit/readme.md +1 -0
- package/node_modules/fast-uri/index.js +20 -5
- package/node_modules/fast-uri/lib/utils.js +8 -1
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +58 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +34 -0
- package/node_modules/hono/dist/cjs/client/client.js +4 -4
- package/node_modules/hono/dist/cjs/hono-base.js +7 -6
- package/node_modules/hono/dist/cjs/jsx/base.js +18 -1
- package/node_modules/hono/dist/cjs/jsx/components.js +25 -26
- package/node_modules/hono/dist/cjs/jsx/context.js +5 -5
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +2 -2
- package/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
- package/node_modules/hono/dist/client/client.js +4 -4
- package/node_modules/hono/dist/hono-base.js +7 -6
- package/node_modules/hono/dist/jsx/base.js +15 -1
- package/node_modules/hono/dist/jsx/components.js +26 -27
- package/node_modules/hono/dist/jsx/context.js +6 -6
- package/node_modules/hono/dist/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +3 -3
- package/node_modules/hono/dist/jsx/streaming.js +5 -6
- package/node_modules/hono/dist/types/context.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/base.d.ts +3 -0
- package/node_modules/hono/package.json +2 -2
- package/node_modules/ip-address/README.md +92 -82
- package/node_modules/ip-address/dist/common.d.ts +20 -0
- package/node_modules/ip-address/dist/common.js +36 -0
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
- package/node_modules/ip-address/dist/ipv4.js +75 -0
- package/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
- package/node_modules/ip-address/dist/ipv6.js +120 -30
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
- package/node_modules/ip-address/dist/v4/constants.js +40 -1
- package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
- package/node_modules/ip-address/dist/v6/constants.js +47 -1
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/jose/dist/types/index.d.ts +1 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +12 -25
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +18 -32
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +12 -25
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +24 -50
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +15 -30
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +29 -52
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +5 -8
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +7 -9
- package/node_modules/jose/dist/types/jwks/local.d.ts +10 -13
- package/node_modules/jose/dist/types/jwks/remote.d.ts +29 -41
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +8 -13
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +14 -26
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +10 -19
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +14 -26
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +19 -33
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +17 -32
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +20 -27
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +30 -35
- package/node_modules/jose/dist/types/jwt/sign.d.ts +8 -13
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +10 -19
- package/node_modules/jose/dist/types/jwt/verify.d.ts +19 -22
- package/node_modules/jose/dist/types/key/export.d.ts +10 -10
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +15 -22
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +12 -19
- package/node_modules/jose/dist/types/key/import.d.ts +25 -31
- package/node_modules/jose/dist/types/types.d.ts +184 -319
- package/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +5 -7
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +6 -5
- package/node_modules/jose/dist/types/util/errors.d.ts +50 -88
- package/node_modules/jose/dist/webapi/index.js +70 -32
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +6 -8
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +25 -48
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -14
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +34 -64
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +100 -172
- package/node_modules/jose/dist/webapi/jwk/embedded.js +29 -32
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +51 -70
- package/node_modules/jose/dist/webapi/jwks/local.js +53 -64
- package/node_modules/jose/dist/webapi/jwks/remote.js +88 -136
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +19 -21
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +22 -31
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +11 -24
- package/node_modules/jose/dist/webapi/jws/general/sign.js +55 -73
- package/node_modules/jose/dist/webapi/jws/general/verify.js +43 -69
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +12 -20
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +43 -70
- package/node_modules/jose/dist/webapi/jwt/sign.js +17 -16
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +31 -40
- package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
- package/node_modules/jose/dist/webapi/key/export.js +32 -41
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -49
- package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -40
- package/node_modules/jose/dist/webapi/key/import.js +48 -56
- package/node_modules/jose/dist/webapi/lib/asn1.js +128 -169
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +72 -41
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +75 -119
- package/node_modules/jose/dist/webapi/lib/deflate.js +35 -47
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +102 -93
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +178 -234
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +71 -138
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +43 -82
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +78 -131
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +123 -209
- package/node_modules/jose/dist/webapi/lib/key.js +147 -139
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
- package/node_modules/jose/dist/webapi/lib/key_management.js +169 -235
- package/node_modules/jose/dist/webapi/lib/validate.js +122 -0
- package/node_modules/jose/dist/webapi/util/base64url.js +14 -37
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
- package/node_modules/jose/dist/webapi/util/errors.js +94 -84
- package/node_modules/jose/package.json +17 -81
- package/node_modules/protobufjs/dist/light/protobuf.js +59 -6
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +22 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +59 -6
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/protobufjs/src/decoder.js +32 -3
- package/node_modules/protobufjs/src/reader.js +20 -0
- package/node_modules/protobufjs/src/wrappers.js +5 -1
- package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
- package/node_modules/qs/CHANGELOG.md +15 -0
- package/node_modules/qs/README.md +19 -1
- package/node_modules/qs/dist/qs.js +21 -21
- package/node_modules/qs/eslint.config.mjs +1 -1
- package/node_modules/qs/lib/parse.js +3 -4
- package/node_modules/qs/lib/stringify.js +23 -8
- package/node_modules/qs/lib/utils.js +10 -3
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +192 -3
- package/node_modules/qs/test/stringify.js +317 -0
- package/node_modules/qs/test/utils.js +12 -0
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici-types/agent.d.ts +13 -12
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +12 -13
- package/node_modules/undici-types/client.d.ts +34 -55
- package/node_modules/undici-types/connector.d.ts +2 -4
- package/node_modules/undici-types/cookies.d.ts +0 -2
- package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
- package/node_modules/undici-types/dispatcher.d.ts +137 -134
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
- package/node_modules/undici-types/errors.d.ts +54 -82
- package/node_modules/undici-types/eventsource.d.ts +4 -9
- package/node_modules/undici-types/fetch.d.ts +24 -46
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +7 -7
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/handlers.d.ts +9 -8
- package/node_modules/undici-types/header.d.ts +1 -162
- package/node_modules/undici-types/index.d.ts +47 -69
- package/node_modules/undici-types/interceptors.d.ts +9 -72
- package/node_modules/undici-types/mock-agent.d.ts +18 -36
- package/node_modules/undici-types/mock-client.d.ts +4 -6
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
- package/node_modules/undici-types/mock-pool.d.ts +4 -6
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +4 -0
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +14 -14
- package/node_modules/undici-types/proxy-agent.d.ts +6 -7
- package/node_modules/undici-types/readable.d.ts +16 -19
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +10 -19
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/webidl.d.ts +30 -148
- package/node_modules/undici-types/websocket.d.ts +10 -48
- package/node_modules/zod/README.md +27 -0
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +21 -2
- package/node_modules/zod/index.d.cts +1 -2
- package/node_modules/zod/index.d.ts +1 -2
- package/node_modules/zod/index.js +5 -2
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +20 -8
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +5 -2
- package/node_modules/zod/src/v3/ZodError.ts +22 -12
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
- package/node_modules/zod/src/v3/types.ts +5 -5
- package/node_modules/zod/src/v4/classic/compat.ts +26 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +59 -44
- package/node_modules/zod/src/v4/classic/external.ts +14 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +10 -4
- package/node_modules/zod/src/v4/classic/schemas.ts +652 -371
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +185 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +994 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +297 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +225 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +152 -5
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1758 -202
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +73 -13
- package/node_modules/zod/src/v4/core/checks.ts +58 -145
- package/node_modules/zod/src/v4/core/compile.ts +2302 -0
- package/node_modules/zod/src/v4/core/core.ts +98 -19
- package/node_modules/zod/src/v4/core/doc.ts +17 -9
- package/node_modules/zod/src/v4/core/errors.ts +113 -25
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +468 -146
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +334 -0
- package/node_modules/zod/src/v4/core/parse.ts +164 -50
- package/node_modules/zod/src/v4/core/regexes.ts +38 -15
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +1073 -538
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +1859 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +284 -49
- package/node_modules/zod/src/v4/core/util.ts +458 -157
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +204 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +4 -0
- package/node_modules/zod/src/v4/locales/az.ts +4 -0
- package/node_modules/zod/src/v4/locales/be.ts +11 -0
- package/node_modules/zod/src/v4/locales/bg.ts +4 -0
- package/node_modules/zod/src/v4/locales/bn.ts +122 -0
- package/node_modules/zod/src/v4/locales/ca.ts +4 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +139 -0
- package/node_modules/zod/src/v4/locales/cs.ts +4 -0
- package/node_modules/zod/src/v4/locales/da.ts +6 -2
- package/node_modules/zod/src/v4/locales/de.ts +4 -0
- package/node_modules/zod/src/v4/locales/el.ts +2 -0
- package/node_modules/zod/src/v4/locales/en.ts +16 -4
- package/node_modules/zod/src/v4/locales/eo.ts +4 -0
- package/node_modules/zod/src/v4/locales/es.ts +3 -0
- package/node_modules/zod/src/v4/locales/fa.ts +4 -0
- package/node_modules/zod/src/v4/locales/fi.ts +4 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +4 -0
- package/node_modules/zod/src/v4/locales/fr.ts +20 -14
- package/node_modules/zod/src/v4/locales/gu.ts +122 -0
- package/node_modules/zod/src/v4/locales/he.ts +7 -1
- package/node_modules/zod/src/v4/locales/hi.ts +125 -0
- package/node_modules/zod/src/v4/locales/hr.ts +3 -0
- package/node_modules/zod/src/v4/locales/hu.ts +4 -0
- package/node_modules/zod/src/v4/locales/hy.ts +10 -0
- package/node_modules/zod/src/v4/locales/id.ts +4 -0
- package/node_modules/zod/src/v4/locales/index.ts +11 -0
- package/node_modules/zod/src/v4/locales/is.ts +4 -0
- package/node_modules/zod/src/v4/locales/it.ts +4 -0
- package/node_modules/zod/src/v4/locales/ja.ts +4 -0
- package/node_modules/zod/src/v4/locales/ka.ts +4 -0
- package/node_modules/zod/src/v4/locales/km.ts +4 -0
- package/node_modules/zod/src/v4/locales/kn.ts +125 -0
- package/node_modules/zod/src/v4/locales/ko.ts +4 -0
- package/node_modules/zod/src/v4/locales/lt.ts +3 -0
- package/node_modules/zod/src/v4/locales/mk.ts +4 -0
- package/node_modules/zod/src/v4/locales/ms.ts +4 -0
- package/node_modules/zod/src/v4/locales/ne.ts +127 -0
- package/node_modules/zod/src/v4/locales/nl.ts +4 -0
- package/node_modules/zod/src/v4/locales/nn.ts +120 -0
- package/node_modules/zod/src/v4/locales/no.ts +6 -2
- package/node_modules/zod/src/v4/locales/ota.ts +4 -0
- package/node_modules/zod/src/v4/locales/pl.ts +4 -0
- package/node_modules/zod/src/v4/locales/ps.ts +4 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +160 -0
- package/node_modules/zod/src/v4/locales/pt.ts +100 -58
- package/node_modules/zod/src/v4/locales/ro.ts +2 -0
- package/node_modules/zod/src/v4/locales/ru.ts +11 -0
- package/node_modules/zod/src/v4/locales/sk.ts +122 -0
- package/node_modules/zod/src/v4/locales/sl.ts +4 -0
- package/node_modules/zod/src/v4/locales/sv.ts +6 -2
- package/node_modules/zod/src/v4/locales/ta.ts +4 -0
- package/node_modules/zod/src/v4/locales/tg.ts +134 -0
- package/node_modules/zod/src/v4/locales/th.ts +4 -0
- package/node_modules/zod/src/v4/locales/tk.ts +112 -0
- package/node_modules/zod/src/v4/locales/tr.ts +4 -0
- package/node_modules/zod/src/v4/locales/uk.ts +4 -0
- package/node_modules/zod/src/v4/locales/ur.ts +4 -0
- package/node_modules/zod/src/v4/locales/uz.ts +2 -0
- package/node_modules/zod/src/v4/locales/vi.ts +4 -0
- package/node_modules/zod/src/v4/locales/yo.ts +4 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +4 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +4 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +12 -1
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/parse.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +174 -59
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +102 -5
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +37 -0
- package/node_modules/zod/v3/ZodError.cjs +41 -12
- package/node_modules/zod/v3/ZodError.d.cts +1 -1
- package/node_modules/zod/v3/ZodError.d.ts +1 -1
- package/node_modules/zod/v3/ZodError.js +22 -12
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +26 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.d.cts +9 -11
- package/node_modules/zod/v4/classic/compat.d.ts +9 -11
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +62 -34
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +43 -34
- package/node_modules/zod/v4/classic/external.cjs +51 -27
- package/node_modules/zod/v4/classic/external.d.cts +5 -2
- package/node_modules/zod/v4/classic/external.d.ts +5 -2
- package/node_modules/zod/v4/classic/external.js +5 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +21 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +30 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/parse.cjs +23 -1
- package/node_modules/zod/v4/classic/parse.d.cts +17 -4
- package/node_modules/zod/v4/classic/parse.d.ts +17 -4
- package/node_modules/zod/v4/classic/parse.js +1 -0
- package/node_modules/zod/v4/classic/schemas.cjs +591 -422
- package/node_modules/zod/v4/classic/schemas.d.cts +70 -19
- package/node_modules/zod/v4/classic/schemas.d.ts +70 -19
- package/node_modules/zod/v4/classic/schemas.js +564 -420
- package/node_modules/zod/v4/core/api.cjs +58 -4
- package/node_modules/zod/v4/core/api.d.cts +16 -10
- package/node_modules/zod/v4/core/api.d.ts +16 -10
- package/node_modules/zod/v4/core/api.js +36 -4
- package/node_modules/zod/v4/core/checks.cjs +56 -127
- package/node_modules/zod/v4/core/checks.d.cts +13 -13
- package/node_modules/zod/v4/core/checks.d.ts +13 -13
- package/node_modules/zod/v4/core/checks.js +37 -127
- package/node_modules/zod/v4/core/compile.cjs +1913 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1863 -0
- package/node_modules/zod/v4/core/core.cjs +100 -18
- package/node_modules/zod/v4/core/core.d.cts +16 -4
- package/node_modules/zod/v4/core/core.d.ts +16 -4
- package/node_modules/zod/v4/core/core.js +82 -19
- package/node_modules/zod/v4/core/doc.cjs +31 -9
- package/node_modules/zod/v4/core/doc.d.cts +3 -1
- package/node_modules/zod/v4/core/doc.d.ts +3 -1
- package/node_modules/zod/v4/core/doc.js +12 -9
- package/node_modules/zod/v4/core/errors.cjs +126 -25
- package/node_modules/zod/v4/core/errors.d.cts +4 -0
- package/node_modules/zod/v4/core/errors.d.ts +4 -0
- package/node_modules/zod/v4/core/errors.js +107 -25
- package/node_modules/zod/v4/core/index.cjs +24 -1
- package/node_modules/zod/v4/core/index.d.cts +3 -0
- package/node_modules/zod/v4/core/index.d.ts +3 -0
- package/node_modules/zod/v4/core/index.js +3 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +470 -149
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +427 -150
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
- package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
- package/node_modules/zod/v4/core/memoizer.cjs +363 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +314 -0
- package/node_modules/zod/v4/core/parse.cjs +148 -46
- package/node_modules/zod/v4/core/parse.d.cts +14 -11
- package/node_modules/zod/v4/core/parse.d.ts +14 -11
- package/node_modules/zod/v4/core/parse.js +127 -45
- package/node_modules/zod/v4/core/regexes.cjs +52 -17
- package/node_modules/zod/v4/core/regexes.d.cts +4 -0
- package/node_modules/zod/v4/core/regexes.d.ts +4 -0
- package/node_modules/zod/v4/core/regexes.js +30 -15
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +826 -387
- package/node_modules/zod/v4/core/schemas.d.cts +140 -36
- package/node_modules/zod/v4/core/schemas.d.ts +140 -36
- package/node_modules/zod/v4/core/schemas.js +796 -387
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +270 -45
- package/node_modules/zod/v4/core/to-json-schema.d.cts +48 -5
- package/node_modules/zod/v4/core/to-json-schema.d.ts +48 -5
- package/node_modules/zod/v4/core/to-json-schema.js +248 -45
- package/node_modules/zod/v4/core/util.cjs +376 -157
- package/node_modules/zod/v4/core/util.d.cts +79 -1
- package/node_modules/zod/v4/core/util.d.ts +79 -1
- package/node_modules/zod/v4/core/util.js +345 -156
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +226 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +181 -0
- package/node_modules/zod/v4/index.cjs +34 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +4 -0
- package/node_modules/zod/v4/locales/ar.js +4 -0
- package/node_modules/zod/v4/locales/az.cjs +4 -0
- package/node_modules/zod/v4/locales/az.js +4 -0
- package/node_modules/zod/v4/locales/be.cjs +11 -0
- package/node_modules/zod/v4/locales/be.js +11 -0
- package/node_modules/zod/v4/locales/bg.cjs +4 -0
- package/node_modules/zod/v4/locales/bg.js +4 -0
- package/node_modules/zod/v4/locales/bn.cjs +139 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +112 -0
- package/node_modules/zod/v4/locales/ca.cjs +4 -0
- package/node_modules/zod/v4/locales/ca.js +4 -0
- package/node_modules/zod/v4/locales/ckb.cjs +159 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +132 -0
- package/node_modules/zod/v4/locales/cs.cjs +4 -0
- package/node_modules/zod/v4/locales/cs.js +4 -0
- package/node_modules/zod/v4/locales/da.cjs +6 -2
- package/node_modules/zod/v4/locales/da.js +6 -2
- package/node_modules/zod/v4/locales/de.cjs +4 -0
- package/node_modules/zod/v4/locales/de.js +4 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +15 -4
- package/node_modules/zod/v4/locales/en.js +15 -4
- package/node_modules/zod/v4/locales/eo.cjs +4 -0
- package/node_modules/zod/v4/locales/eo.js +4 -0
- package/node_modules/zod/v4/locales/es.cjs +3 -0
- package/node_modules/zod/v4/locales/es.js +3 -0
- package/node_modules/zod/v4/locales/fa.cjs +4 -0
- package/node_modules/zod/v4/locales/fa.js +4 -0
- package/node_modules/zod/v4/locales/fi.cjs +4 -0
- package/node_modules/zod/v4/locales/fi.js +4 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +4 -0
- package/node_modules/zod/v4/locales/fr.cjs +17 -14
- package/node_modules/zod/v4/locales/fr.js +17 -14
- package/node_modules/zod/v4/locales/gu.cjs +139 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +112 -0
- package/node_modules/zod/v4/locales/he.cjs +6 -0
- package/node_modules/zod/v4/locales/he.js +6 -0
- package/node_modules/zod/v4/locales/hi.cjs +137 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +110 -0
- package/node_modules/zod/v4/locales/hr.cjs +3 -0
- package/node_modules/zod/v4/locales/hr.js +3 -0
- package/node_modules/zod/v4/locales/hu.cjs +4 -0
- package/node_modules/zod/v4/locales/hu.js +4 -0
- package/node_modules/zod/v4/locales/hy.cjs +10 -0
- package/node_modules/zod/v4/locales/hy.js +10 -0
- package/node_modules/zod/v4/locales/id.cjs +4 -0
- package/node_modules/zod/v4/locales/id.js +4 -0
- package/node_modules/zod/v4/locales/index.cjs +43 -2
- package/node_modules/zod/v4/locales/index.d.cts +11 -0
- package/node_modules/zod/v4/locales/index.d.ts +11 -0
- package/node_modules/zod/v4/locales/index.js +11 -0
- package/node_modules/zod/v4/locales/is.cjs +4 -0
- package/node_modules/zod/v4/locales/is.js +4 -0
- package/node_modules/zod/v4/locales/it.cjs +4 -0
- package/node_modules/zod/v4/locales/it.js +4 -0
- package/node_modules/zod/v4/locales/ja.cjs +4 -0
- package/node_modules/zod/v4/locales/ja.js +4 -0
- package/node_modules/zod/v4/locales/ka.cjs +4 -0
- package/node_modules/zod/v4/locales/ka.js +4 -0
- package/node_modules/zod/v4/locales/km.cjs +4 -0
- package/node_modules/zod/v4/locales/km.js +4 -0
- package/node_modules/zod/v4/locales/kn.cjs +142 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +115 -0
- package/node_modules/zod/v4/locales/ko.cjs +4 -0
- package/node_modules/zod/v4/locales/ko.js +4 -0
- package/node_modules/zod/v4/locales/lt.cjs +3 -0
- package/node_modules/zod/v4/locales/lt.js +3 -0
- package/node_modules/zod/v4/locales/mk.cjs +4 -0
- package/node_modules/zod/v4/locales/mk.js +4 -0
- package/node_modules/zod/v4/locales/ms.cjs +4 -0
- package/node_modules/zod/v4/locales/ms.js +4 -0
- package/node_modules/zod/v4/locales/ne.cjs +137 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +110 -0
- package/node_modules/zod/v4/locales/nl.cjs +4 -0
- package/node_modules/zod/v4/locales/nl.js +4 -0
- package/node_modules/zod/v4/locales/nn.cjs +139 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +112 -0
- package/node_modules/zod/v4/locales/no.cjs +6 -2
- package/node_modules/zod/v4/locales/no.js +6 -2
- package/node_modules/zod/v4/locales/ota.cjs +4 -0
- package/node_modules/zod/v4/locales/ota.js +4 -0
- package/node_modules/zod/v4/locales/pl.cjs +4 -0
- package/node_modules/zod/v4/locales/pl.js +4 -0
- package/node_modules/zod/v4/locales/ps.cjs +4 -0
- package/node_modules/zod/v4/locales/ps.js +4 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +169 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +142 -0
- package/node_modules/zod/v4/locales/pt.cjs +88 -55
- package/node_modules/zod/v4/locales/pt.js +88 -55
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +11 -0
- package/node_modules/zod/v4/locales/ru.js +11 -0
- package/node_modules/zod/v4/locales/sk.cjs +142 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +115 -0
- package/node_modules/zod/v4/locales/sl.cjs +4 -0
- package/node_modules/zod/v4/locales/sl.js +4 -0
- package/node_modules/zod/v4/locales/sv.cjs +6 -2
- package/node_modules/zod/v4/locales/sv.js +6 -2
- package/node_modules/zod/v4/locales/ta.cjs +4 -0
- package/node_modules/zod/v4/locales/ta.js +4 -0
- package/node_modules/zod/v4/locales/tg.cjs +143 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +116 -0
- package/node_modules/zod/v4/locales/th.cjs +4 -0
- package/node_modules/zod/v4/locales/th.js +4 -0
- package/node_modules/zod/v4/locales/tk.cjs +133 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +106 -0
- package/node_modules/zod/v4/locales/tr.cjs +4 -0
- package/node_modules/zod/v4/locales/tr.js +4 -0
- package/node_modules/zod/v4/locales/uk.cjs +4 -0
- package/node_modules/zod/v4/locales/uk.js +4 -0
- package/node_modules/zod/v4/locales/ur.cjs +4 -0
- package/node_modules/zod/v4/locales/ur.js +4 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +4 -0
- package/node_modules/zod/v4/locales/vi.js +4 -0
- package/node_modules/zod/v4/locales/yo.cjs +4 -0
- package/node_modules/zod/v4/locales/yo.js +4 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +4 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +4 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +33 -1
- package/node_modules/zod/v4/mini/external.d.cts +5 -2
- package/node_modules/zod/v4/mini/external.d.ts +5 -2
- package/node_modules/zod/v4/mini/external.js +3 -1
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +22 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +115 -49
- package/node_modules/zod/v4/mini/schemas.d.cts +52 -14
- package/node_modules/zod/v4/mini/schemas.d.ts +52 -14
- package/node_modules/zod/v4/mini/schemas.js +90 -47
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/package.json +3 -2
- package/skills/context-management/SKILL.md +258 -0
- package/skills/figma-implement-design/SKILL.md +258 -0
- package/skills/orchestrator/SKILL.md +82 -0
- package/skills/s-help/SKILL.md +42 -0
- package/skills/s-help/resources/README.md +23 -0
- package/skills/s-help/resources/commands.json +78 -0
- package/skills/s-help/resources/s-acm.md +26 -0
- package/skills/s-help/resources/s-bash-mode.md +23 -0
- package/skills/s-help/resources/s-bash-reset.md +23 -0
- package/skills/s-help/resources/s-context.md +25 -0
- package/skills/s-help/resources/s-filechanges-accept.md +25 -0
- package/skills/s-help/resources/s-filechanges-decline.md +30 -0
- package/skills/s-help/resources/s-filechanges.md +38 -0
- package/skills/s-help/resources/s-footer.md +38 -0
- package/skills/s-help/resources/s-promptlib.md +28 -0
- package/skills/s-help/resources/s-skills-manager.md +31 -0
- package/skills/s-help/resources/s-stash-history.md +26 -0
- package/skills/screenshot/SKILL.md +267 -0
- package/skills/screenshot/scripts/ensure_macos_permissions.sh +54 -0
- package/skills/screenshot/scripts/macos_display_info.swift +22 -0
- package/skills/screenshot/scripts/macos_permissions.swift +40 -0
- package/skills/screenshot/scripts/macos_window_info.swift +126 -0
- package/skills/screenshot/scripts/take_screenshot.ps1 +163 -0
- package/skills/screenshot/scripts/take_screenshot.py +585 -0
- package/slingshot/index.js +232 -230
- package/node_modules/@types/node/ffi.d.ts +0 -486
- package/node_modules/@types/node/inspector/promises.d.ts +0 -35
- package/node_modules/@types/node/path/posix.d.ts +0 -8
- package/node_modules/@types/node/path/win32.d.ts +0 -8
- package/node_modules/@types/node/quic.d.ts +0 -2151
- package/node_modules/@types/node/stream/iter.d.ts +0 -452
- package/node_modules/@types/node/test/reporters.d.ts +0 -59
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
- package/node_modules/@types/node/ts5.7/index.d.ts +0 -118
- package/node_modules/@types/node/util/types.d.ts +0 -558
- package/node_modules/@types/node/vfs.d.ts +0 -210
- package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
- package/node_modules/@types/node/web-globals/console.d.ts +0 -9
- package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
- package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
- package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
- package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
- package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
- package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
- package/node_modules/@types/node/web-globals/url.d.ts +0 -24
- package/node_modules/@types/node/zlib/iter.d.ts +0 -131
- package/node_modules/jose/dist/webapi/lib/base64.js +0 -22
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -28
- package/node_modules/jose/dist/webapi/lib/helpers.js +0 -42
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -26
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -20
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -17
- package/node_modules/jose/dist/webapi/lib/key_options.js +0 -6
- package/node_modules/jose/dist/webapi/lib/options.js +0 -74
- package/node_modules/jose/dist/webapi/lib/signing.js +0 -26
- package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -33
- package/node_modules/undici-types/cache-interceptor.d.ts +0 -179
- package/node_modules/undici-types/client-stats.d.ts +0 -15
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
- package/node_modules/undici-types/h2c-client.d.ts +0 -73
- package/node_modules/undici-types/mock-call-history.d.ts +0 -111
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -39
- package/node_modules/undici-types/snapshot-agent.d.ts +0 -113
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
- package/node_modules/undici-types/utility.d.ts +0 -7
- package/node_modules/zod/src/v4/core/config.ts +0 -15
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The `node:crypto` module provides cryptographic functionality that includes a
|
|
3
|
+
* set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify
|
|
4
|
+
* functions.
|
|
5
|
+
*
|
|
6
|
+
* ```js
|
|
7
|
+
* const { createHmac } = await import('node:crypto');
|
|
8
|
+
*
|
|
9
|
+
* const secret = 'abcdefg';
|
|
10
|
+
* const hash = createHmac('sha256', secret)
|
|
11
|
+
* .update('I love cupcakes')
|
|
12
|
+
* .digest('hex');
|
|
13
|
+
* console.log(hash);
|
|
14
|
+
* // Prints:
|
|
15
|
+
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
|
16
|
+
* ```
|
|
17
|
+
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/crypto.js)
|
|
18
|
+
*/
|
|
19
|
+
declare module "crypto" {
|
|
2
20
|
import { NonSharedBuffer } from "node:buffer";
|
|
3
|
-
import
|
|
21
|
+
import * as stream from "node:stream";
|
|
4
22
|
import { PeerCertificate } from "node:tls";
|
|
5
23
|
/**
|
|
6
24
|
* SPKAC is a Certificate Signing Request mechanism originally implemented by
|
|
@@ -27,7 +45,7 @@ declare module "node:crypto" {
|
|
|
27
45
|
* @param encoding The `encoding` of the `spkac` string.
|
|
28
46
|
* @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
|
|
29
47
|
*/
|
|
30
|
-
static exportChallenge(spkac: BinaryLike
|
|
48
|
+
static exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
31
49
|
/**
|
|
32
50
|
* ```js
|
|
33
51
|
* const { Certificate } = await import('node:crypto');
|
|
@@ -40,7 +58,7 @@ declare module "node:crypto" {
|
|
|
40
58
|
* @param encoding The `encoding` of the `spkac` string.
|
|
41
59
|
* @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
|
|
42
60
|
*/
|
|
43
|
-
static exportPublicKey(spkac: BinaryLike, encoding?:
|
|
61
|
+
static exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
44
62
|
/**
|
|
45
63
|
* ```js
|
|
46
64
|
* import { Buffer } from 'node:buffer';
|
|
@@ -54,34 +72,122 @@ declare module "node:crypto" {
|
|
|
54
72
|
* @param encoding The `encoding` of the `spkac` string.
|
|
55
73
|
* @return `true` if the given `spkac` data structure is valid, `false` otherwise.
|
|
56
74
|
*/
|
|
57
|
-
static verifySpkac(spkac:
|
|
75
|
+
static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
58
76
|
/**
|
|
59
77
|
* @deprecated
|
|
60
|
-
* @param
|
|
78
|
+
* @param spkac
|
|
61
79
|
* @returns The challenge component of the `spkac` data structure,
|
|
62
80
|
* which includes a public key and a challenge.
|
|
63
81
|
*/
|
|
64
|
-
exportChallenge(spkac: BinaryLike
|
|
82
|
+
exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
65
83
|
/**
|
|
66
84
|
* @deprecated
|
|
85
|
+
* @param spkac
|
|
67
86
|
* @param encoding The encoding of the spkac string.
|
|
68
87
|
* @returns The public key component of the `spkac` data structure,
|
|
69
88
|
* which includes a public key and a challenge.
|
|
70
89
|
*/
|
|
71
|
-
exportPublicKey(spkac: BinaryLike, encoding?:
|
|
90
|
+
exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
72
91
|
/**
|
|
73
92
|
* @deprecated
|
|
74
|
-
* @param
|
|
93
|
+
* @param spkac
|
|
75
94
|
* @returns `true` if the given `spkac` data structure is valid,
|
|
76
95
|
* `false` otherwise.
|
|
77
96
|
*/
|
|
78
|
-
verifySpkac(spkac:
|
|
97
|
+
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
98
|
+
}
|
|
99
|
+
namespace constants {
|
|
100
|
+
// https://nodejs.org/dist/latest-v22.x/docs/api/crypto.html#crypto-constants
|
|
101
|
+
const OPENSSL_VERSION_NUMBER: number;
|
|
102
|
+
/** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
|
|
103
|
+
const SSL_OP_ALL: number;
|
|
104
|
+
/** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */
|
|
105
|
+
const SSL_OP_ALLOW_NO_DHE_KEX: number;
|
|
106
|
+
/** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
|
|
107
|
+
const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
|
|
108
|
+
/** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
|
|
109
|
+
const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
|
|
110
|
+
/** Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER. */
|
|
111
|
+
const SSL_OP_CISCO_ANYCONNECT: number;
|
|
112
|
+
/** Instructs OpenSSL to turn on cookie exchange. */
|
|
113
|
+
const SSL_OP_COOKIE_EXCHANGE: number;
|
|
114
|
+
/** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */
|
|
115
|
+
const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
|
|
116
|
+
/** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */
|
|
117
|
+
const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
|
|
118
|
+
/** Allows initial connection to servers that do not support RI. */
|
|
119
|
+
const SSL_OP_LEGACY_SERVER_CONNECT: number;
|
|
120
|
+
/** Instructs OpenSSL to disable support for SSL/TLS compression. */
|
|
121
|
+
const SSL_OP_NO_COMPRESSION: number;
|
|
122
|
+
/** Instructs OpenSSL to disable encrypt-then-MAC. */
|
|
123
|
+
const SSL_OP_NO_ENCRYPT_THEN_MAC: number;
|
|
124
|
+
const SSL_OP_NO_QUERY_MTU: number;
|
|
125
|
+
/** Instructs OpenSSL to disable renegotiation. */
|
|
126
|
+
const SSL_OP_NO_RENEGOTIATION: number;
|
|
127
|
+
/** Instructs OpenSSL to always start a new session when performing renegotiation. */
|
|
128
|
+
const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
|
|
129
|
+
/** Instructs OpenSSL to turn off SSL v2 */
|
|
130
|
+
const SSL_OP_NO_SSLv2: number;
|
|
131
|
+
/** Instructs OpenSSL to turn off SSL v3 */
|
|
132
|
+
const SSL_OP_NO_SSLv3: number;
|
|
133
|
+
/** Instructs OpenSSL to disable use of RFC4507bis tickets. */
|
|
134
|
+
const SSL_OP_NO_TICKET: number;
|
|
135
|
+
/** Instructs OpenSSL to turn off TLS v1 */
|
|
136
|
+
const SSL_OP_NO_TLSv1: number;
|
|
137
|
+
/** Instructs OpenSSL to turn off TLS v1.1 */
|
|
138
|
+
const SSL_OP_NO_TLSv1_1: number;
|
|
139
|
+
/** Instructs OpenSSL to turn off TLS v1.2 */
|
|
140
|
+
const SSL_OP_NO_TLSv1_2: number;
|
|
141
|
+
/** Instructs OpenSSL to turn off TLS v1.3 */
|
|
142
|
+
const SSL_OP_NO_TLSv1_3: number;
|
|
143
|
+
/** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */
|
|
144
|
+
const SSL_OP_PRIORITIZE_CHACHA: number;
|
|
145
|
+
/** Instructs OpenSSL to disable version rollback attack detection. */
|
|
146
|
+
const SSL_OP_TLS_ROLLBACK_BUG: number;
|
|
147
|
+
const ENGINE_METHOD_RSA: number;
|
|
148
|
+
const ENGINE_METHOD_DSA: number;
|
|
149
|
+
const ENGINE_METHOD_DH: number;
|
|
150
|
+
const ENGINE_METHOD_RAND: number;
|
|
151
|
+
const ENGINE_METHOD_EC: number;
|
|
152
|
+
const ENGINE_METHOD_CIPHERS: number;
|
|
153
|
+
const ENGINE_METHOD_DIGESTS: number;
|
|
154
|
+
const ENGINE_METHOD_PKEY_METHS: number;
|
|
155
|
+
const ENGINE_METHOD_PKEY_ASN1_METHS: number;
|
|
156
|
+
const ENGINE_METHOD_ALL: number;
|
|
157
|
+
const ENGINE_METHOD_NONE: number;
|
|
158
|
+
const DH_CHECK_P_NOT_SAFE_PRIME: number;
|
|
159
|
+
const DH_CHECK_P_NOT_PRIME: number;
|
|
160
|
+
const DH_UNABLE_TO_CHECK_GENERATOR: number;
|
|
161
|
+
const DH_NOT_SUITABLE_GENERATOR: number;
|
|
162
|
+
const RSA_PKCS1_PADDING: number;
|
|
163
|
+
const RSA_SSLV23_PADDING: number;
|
|
164
|
+
const RSA_NO_PADDING: number;
|
|
165
|
+
const RSA_PKCS1_OAEP_PADDING: number;
|
|
166
|
+
const RSA_X931_PADDING: number;
|
|
167
|
+
const RSA_PKCS1_PSS_PADDING: number;
|
|
168
|
+
/** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */
|
|
169
|
+
const RSA_PSS_SALTLEN_DIGEST: number;
|
|
170
|
+
/** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */
|
|
171
|
+
const RSA_PSS_SALTLEN_MAX_SIGN: number;
|
|
172
|
+
/** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */
|
|
173
|
+
const RSA_PSS_SALTLEN_AUTO: number;
|
|
174
|
+
const POINT_CONVERSION_COMPRESSED: number;
|
|
175
|
+
const POINT_CONVERSION_UNCOMPRESSED: number;
|
|
176
|
+
const POINT_CONVERSION_HYBRID: number;
|
|
177
|
+
/** Specifies the built-in default cipher list used by Node.js (colon-separated values). */
|
|
178
|
+
const defaultCoreCipherList: string;
|
|
179
|
+
/** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */
|
|
180
|
+
const defaultCipherList: string;
|
|
79
181
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
182
|
+
interface HashOptions extends stream.TransformOptions {
|
|
183
|
+
/**
|
|
184
|
+
* For XOF hash functions such as `shake256`, the
|
|
185
|
+
* outputLength option can be used to specify the desired output length in bytes.
|
|
186
|
+
*/
|
|
83
187
|
outputLength?: number | undefined;
|
|
84
188
|
}
|
|
189
|
+
/** @deprecated since v10.0.0 */
|
|
190
|
+
const fips: boolean;
|
|
85
191
|
/**
|
|
86
192
|
* Creates and returns a `Hash` object that can be used to generate hash digests
|
|
87
193
|
* using the given `algorithm`. Optional `options` argument controls stream
|
|
@@ -124,9 +230,6 @@ declare module "node:crypto" {
|
|
|
124
230
|
* @param options `stream.transform` options
|
|
125
231
|
*/
|
|
126
232
|
function createHash(algorithm: string, options?: HashOptions): Hash;
|
|
127
|
-
interface HmacOptions extends TransformOptions {
|
|
128
|
-
encoding?: BufferEncoding | undefined;
|
|
129
|
-
}
|
|
130
233
|
/**
|
|
131
234
|
* Creates and returns an `Hmac` object that uses the given `algorithm` and `key`.
|
|
132
235
|
* Optional `options` argument controls stream behavior.
|
|
@@ -171,7 +274,13 @@ declare module "node:crypto" {
|
|
|
171
274
|
* @since v0.1.94
|
|
172
275
|
* @param options `stream.transform` options
|
|
173
276
|
*/
|
|
174
|
-
function createHmac(algorithm: string, key:
|
|
277
|
+
function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
|
|
278
|
+
// https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
|
|
279
|
+
type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
|
|
280
|
+
type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1";
|
|
281
|
+
type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
|
|
282
|
+
type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
|
|
283
|
+
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
|
175
284
|
/**
|
|
176
285
|
* The `Hash` class is a utility for creating hash digests of data. It can be
|
|
177
286
|
* used in one of two ways:
|
|
@@ -236,7 +345,7 @@ declare module "node:crypto" {
|
|
|
236
345
|
* ```
|
|
237
346
|
* @since v0.1.92
|
|
238
347
|
*/
|
|
239
|
-
class Hash extends Transform {
|
|
348
|
+
class Hash extends stream.Transform {
|
|
240
349
|
private constructor();
|
|
241
350
|
/**
|
|
242
351
|
* Creates a new `Hash` object that contains a deep copy of the internal state
|
|
@@ -282,7 +391,8 @@ declare module "node:crypto" {
|
|
|
282
391
|
* @since v0.1.92
|
|
283
392
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
284
393
|
*/
|
|
285
|
-
update(data:
|
|
394
|
+
update(data: BinaryLike): Hash;
|
|
395
|
+
update(data: string, inputEncoding: Encoding): Hash;
|
|
286
396
|
/**
|
|
287
397
|
* Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method).
|
|
288
398
|
* If `encoding` is provided a string will be returned; otherwise
|
|
@@ -294,7 +404,7 @@ declare module "node:crypto" {
|
|
|
294
404
|
* @param encoding The `encoding` of the return value.
|
|
295
405
|
*/
|
|
296
406
|
digest(): NonSharedBuffer;
|
|
297
|
-
digest(encoding:
|
|
407
|
+
digest(encoding: BinaryToTextEncoding): string;
|
|
298
408
|
}
|
|
299
409
|
/**
|
|
300
410
|
* The `Hmac` class is a utility for creating cryptographic HMAC digests. It can
|
|
@@ -361,8 +471,9 @@ declare module "node:crypto" {
|
|
|
361
471
|
* // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
|
|
362
472
|
* ```
|
|
363
473
|
* @since v0.1.94
|
|
474
|
+
* @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances.
|
|
364
475
|
*/
|
|
365
|
-
class Hmac extends Transform {
|
|
476
|
+
class Hmac extends stream.Transform {
|
|
366
477
|
private constructor();
|
|
367
478
|
/**
|
|
368
479
|
* Updates the `Hmac` content with the given `data`, the encoding of which
|
|
@@ -374,7 +485,8 @@ declare module "node:crypto" {
|
|
|
374
485
|
* @since v0.1.94
|
|
375
486
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
376
487
|
*/
|
|
377
|
-
update(data:
|
|
488
|
+
update(data: BinaryLike): Hmac;
|
|
489
|
+
update(data: string, inputEncoding: Encoding): Hmac;
|
|
378
490
|
/**
|
|
379
491
|
* Calculates the HMAC digest of all of the data passed using `hmac.update()`.
|
|
380
492
|
* If `encoding` is
|
|
@@ -386,97 +498,62 @@ declare module "node:crypto" {
|
|
|
386
498
|
* @param encoding The `encoding` of the return value.
|
|
387
499
|
*/
|
|
388
500
|
digest(): NonSharedBuffer;
|
|
389
|
-
digest(encoding:
|
|
501
|
+
digest(encoding: BinaryToTextEncoding): string;
|
|
390
502
|
}
|
|
391
|
-
type KeyFormat = "pem" | "der" | "jwk" | "raw-public" | "raw-private" | "raw-seed";
|
|
392
503
|
type KeyObjectType = "secret" | "public" | "private";
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
| SymmetricKeyExportOptions
|
|
397
|
-
| PublicKeyExportOptions
|
|
398
|
-
| PrivateKeyExportOptions
|
|
399
|
-
| JwkKeyExportOptions
|
|
400
|
-
| RawPublicKeyExportOptions
|
|
401
|
-
| RawPrivateKeyExportOptions;
|
|
402
|
-
interface SymmetricKeyExportOptions {
|
|
403
|
-
format?: "buffer" | undefined;
|
|
404
|
-
}
|
|
405
|
-
interface PublicKeyExportOptions<T extends PublicKeyExportType = PublicKeyExportType> {
|
|
406
|
-
type: T;
|
|
407
|
-
format: "pem" | "der";
|
|
408
|
-
}
|
|
409
|
-
interface PrivateKeyExportOptions<T extends PrivateKeyExportType = PrivateKeyExportType> {
|
|
410
|
-
type: T;
|
|
411
|
-
format: "pem" | "der";
|
|
504
|
+
interface KeyExportOptions<T extends KeyFormat> {
|
|
505
|
+
type: "pkcs1" | "spki" | "pkcs8" | "sec1";
|
|
506
|
+
format: T;
|
|
412
507
|
cipher?: string | undefined;
|
|
413
|
-
passphrase?:
|
|
508
|
+
passphrase?: string | Buffer | undefined;
|
|
414
509
|
}
|
|
415
510
|
interface JwkKeyExportOptions {
|
|
416
511
|
format: "jwk";
|
|
417
512
|
}
|
|
418
|
-
interface
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
| PrivateKeyExportOptions<TPrivate>
|
|
435
|
-
| RawPrivateKeyExportOptions
|
|
436
|
-
| JwkKeyExportOptions
|
|
437
|
-
| undefined;
|
|
438
|
-
}
|
|
439
|
-
type KeyExportResult<T, Default> = T extends { format: infer F extends KeyFormat } ? {
|
|
440
|
-
"der": NonSharedBuffer;
|
|
441
|
-
"jwk": webcrypto.JsonWebKey;
|
|
442
|
-
"pem": string;
|
|
443
|
-
"raw-public": NonSharedBuffer;
|
|
444
|
-
"raw-private": NonSharedBuffer;
|
|
445
|
-
"raw-seed": NonSharedBuffer;
|
|
446
|
-
}[F]
|
|
447
|
-
: Default;
|
|
448
|
-
interface KeyPairExportResult<T extends KeyPairExportOptions> {
|
|
449
|
-
publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>;
|
|
450
|
-
privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>;
|
|
451
|
-
}
|
|
452
|
-
type KeyPairExportCallback<T extends KeyPairExportOptions = {}> = (
|
|
453
|
-
err: Error | null,
|
|
454
|
-
publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>,
|
|
455
|
-
privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>,
|
|
456
|
-
) => void;
|
|
457
|
-
type MLDSAKeyType = `ml-dsa-${44 | 65 | 87}`;
|
|
458
|
-
type MLKEMKeyType = `ml-kem-${1024 | 512 | 768}`;
|
|
459
|
-
type SLHDSAKeyType = `slh-dsa-${"sha2" | "shake"}-${128 | 192 | 256}${"f" | "s"}`;
|
|
460
|
-
type AsymmetricKeyType =
|
|
461
|
-
| "dh"
|
|
462
|
-
| "dsa"
|
|
463
|
-
| "ec"
|
|
464
|
-
| "ed25519"
|
|
465
|
-
| "ed448"
|
|
466
|
-
| MLDSAKeyType
|
|
467
|
-
| MLKEMKeyType
|
|
468
|
-
| "rsa-pss"
|
|
469
|
-
| "rsa"
|
|
470
|
-
| SLHDSAKeyType
|
|
471
|
-
| "x25519"
|
|
472
|
-
| "x448";
|
|
513
|
+
interface JsonWebKey {
|
|
514
|
+
crv?: string;
|
|
515
|
+
d?: string;
|
|
516
|
+
dp?: string;
|
|
517
|
+
dq?: string;
|
|
518
|
+
e?: string;
|
|
519
|
+
k?: string;
|
|
520
|
+
kty?: string;
|
|
521
|
+
n?: string;
|
|
522
|
+
p?: string;
|
|
523
|
+
q?: string;
|
|
524
|
+
qi?: string;
|
|
525
|
+
x?: string;
|
|
526
|
+
y?: string;
|
|
527
|
+
[key: string]: unknown;
|
|
528
|
+
}
|
|
473
529
|
interface AsymmetricKeyDetails {
|
|
530
|
+
/**
|
|
531
|
+
* Key size in bits (RSA, DSA).
|
|
532
|
+
*/
|
|
474
533
|
modulusLength?: number;
|
|
534
|
+
/**
|
|
535
|
+
* Public exponent (RSA).
|
|
536
|
+
*/
|
|
475
537
|
publicExponent?: bigint;
|
|
538
|
+
/**
|
|
539
|
+
* Name of the message digest (RSA-PSS).
|
|
540
|
+
*/
|
|
476
541
|
hashAlgorithm?: string;
|
|
542
|
+
/**
|
|
543
|
+
* Name of the message digest used by MGF1 (RSA-PSS).
|
|
544
|
+
*/
|
|
477
545
|
mgf1HashAlgorithm?: string;
|
|
546
|
+
/**
|
|
547
|
+
* Minimal salt length in bytes (RSA-PSS).
|
|
548
|
+
*/
|
|
478
549
|
saltLength?: number;
|
|
550
|
+
/**
|
|
551
|
+
* Size of q in bits (DSA).
|
|
552
|
+
*/
|
|
479
553
|
divisorLength?: number;
|
|
554
|
+
/**
|
|
555
|
+
* Name of the curve (EC).
|
|
556
|
+
*/
|
|
480
557
|
namedCurve?: string;
|
|
481
558
|
}
|
|
482
559
|
/**
|
|
@@ -495,11 +572,7 @@ declare module "node:crypto" {
|
|
|
495
572
|
class KeyObject {
|
|
496
573
|
private constructor();
|
|
497
574
|
/**
|
|
498
|
-
*
|
|
499
|
-
* does not retain any of the restrictions imposed by the Web Crypto API on the
|
|
500
|
-
* original `CryptoKey`, such as the allowed key usages, the algorithm or hash
|
|
501
|
-
* algorithm bindings, and the extractability flag. In particular, the underlying
|
|
502
|
-
* key material of the returned `KeyObject` can always be exported.
|
|
575
|
+
* Example: Converting a `CryptoKey` instance to a `KeyObject`:
|
|
503
576
|
*
|
|
504
577
|
* ```js
|
|
505
578
|
* const { KeyObject } = await import('node:crypto');
|
|
@@ -519,14 +592,24 @@ declare module "node:crypto" {
|
|
|
519
592
|
*/
|
|
520
593
|
static from(key: webcrypto.CryptoKey): KeyObject;
|
|
521
594
|
/**
|
|
522
|
-
* For asymmetric keys, this property represents the type of the key.
|
|
523
|
-
*
|
|
595
|
+
* For asymmetric keys, this property represents the type of the key. Supported key
|
|
596
|
+
* types are:
|
|
597
|
+
*
|
|
598
|
+
* * `'rsa'` (OID 1.2.840.113549.1.1.1)
|
|
599
|
+
* * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
|
|
600
|
+
* * `'dsa'` (OID 1.2.840.10040.4.1)
|
|
601
|
+
* * `'ec'` (OID 1.2.840.10045.2.1)
|
|
602
|
+
* * `'x25519'` (OID 1.3.101.110)
|
|
603
|
+
* * `'x448'` (OID 1.3.101.111)
|
|
604
|
+
* * `'ed25519'` (OID 1.3.101.112)
|
|
605
|
+
* * `'ed448'` (OID 1.3.101.113)
|
|
606
|
+
* * `'dh'` (OID 1.2.840.113549.1.3.1)
|
|
524
607
|
*
|
|
525
608
|
* This property is `undefined` for unrecognized `KeyObject` types and symmetric
|
|
526
609
|
* keys.
|
|
527
610
|
* @since v11.6.0
|
|
528
611
|
*/
|
|
529
|
-
asymmetricKeyType?:
|
|
612
|
+
asymmetricKeyType?: KeyType;
|
|
530
613
|
/**
|
|
531
614
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
532
615
|
* this object contains information about the key. None of the information obtained
|
|
@@ -542,21 +625,31 @@ declare module "node:crypto" {
|
|
|
542
625
|
*/
|
|
543
626
|
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
544
627
|
/**
|
|
628
|
+
* For symmetric keys, the following encoding options can be used:
|
|
629
|
+
*
|
|
630
|
+
* For public keys, the following encoding options can be used:
|
|
631
|
+
*
|
|
632
|
+
* For private keys, the following encoding options can be used:
|
|
633
|
+
*
|
|
545
634
|
* The result type depends on the selected encoding format, when PEM the
|
|
546
635
|
* result is a string, when DER it will be a buffer containing the data
|
|
547
|
-
* encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object.
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
636
|
+
* encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object.
|
|
637
|
+
*
|
|
638
|
+
* When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are
|
|
639
|
+
* ignored.
|
|
640
|
+
*
|
|
641
|
+
* PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of
|
|
642
|
+
* the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be
|
|
643
|
+
* encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for
|
|
644
|
+
* encrypted private keys. Since PKCS#8 defines its own
|
|
645
|
+
* encryption mechanism, PEM-level encryption is not supported when encrypting
|
|
646
|
+
* a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for
|
|
647
|
+
* PKCS#1 and SEC1 encryption.
|
|
557
648
|
* @since v11.6.0
|
|
558
649
|
*/
|
|
559
|
-
export
|
|
650
|
+
export(options: KeyExportOptions<"pem">): string | NonSharedBuffer;
|
|
651
|
+
export(options?: KeyExportOptions<"der">): NonSharedBuffer;
|
|
652
|
+
export(options?: JwkKeyExportOptions): JsonWebKey;
|
|
560
653
|
/**
|
|
561
654
|
* Returns `true` or `false` depending on whether the keys have exactly the same
|
|
562
655
|
* type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack).
|
|
@@ -594,18 +687,19 @@ declare module "node:crypto" {
|
|
|
594
687
|
type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
|
|
595
688
|
type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
|
|
596
689
|
type CipherChaCha20Poly1305Types = "chacha20-poly1305";
|
|
597
|
-
type BinaryLike = string |
|
|
598
|
-
type
|
|
599
|
-
interface CipherCCMOptions extends TransformOptions {
|
|
690
|
+
type BinaryLike = string | NodeJS.ArrayBufferView;
|
|
691
|
+
type CipherKey = BinaryLike | KeyObject;
|
|
692
|
+
interface CipherCCMOptions extends stream.TransformOptions {
|
|
600
693
|
authTagLength: number;
|
|
601
694
|
}
|
|
602
|
-
interface CipherGCMOptions extends TransformOptions {
|
|
695
|
+
interface CipherGCMOptions extends stream.TransformOptions {
|
|
603
696
|
authTagLength?: number | undefined;
|
|
604
697
|
}
|
|
605
|
-
interface CipherOCBOptions extends TransformOptions {
|
|
698
|
+
interface CipherOCBOptions extends stream.TransformOptions {
|
|
606
699
|
authTagLength: number;
|
|
607
700
|
}
|
|
608
|
-
interface CipherChaCha20Poly1305Options extends TransformOptions {
|
|
701
|
+
interface CipherChaCha20Poly1305Options extends stream.TransformOptions {
|
|
702
|
+
/** @default 16 */
|
|
609
703
|
authTagLength?: number | undefined;
|
|
610
704
|
}
|
|
611
705
|
/**
|
|
@@ -640,36 +734,36 @@ declare module "node:crypto" {
|
|
|
640
734
|
*/
|
|
641
735
|
function createCipheriv(
|
|
642
736
|
algorithm: CipherCCMTypes,
|
|
643
|
-
key:
|
|
737
|
+
key: CipherKey,
|
|
644
738
|
iv: BinaryLike,
|
|
645
739
|
options: CipherCCMOptions,
|
|
646
740
|
): CipherCCM;
|
|
647
741
|
function createCipheriv(
|
|
648
742
|
algorithm: CipherOCBTypes,
|
|
649
|
-
key:
|
|
743
|
+
key: CipherKey,
|
|
650
744
|
iv: BinaryLike,
|
|
651
745
|
options: CipherOCBOptions,
|
|
652
746
|
): CipherOCB;
|
|
653
747
|
function createCipheriv(
|
|
654
748
|
algorithm: CipherGCMTypes,
|
|
655
|
-
key:
|
|
749
|
+
key: CipherKey,
|
|
656
750
|
iv: BinaryLike,
|
|
657
751
|
options?: CipherGCMOptions,
|
|
658
752
|
): CipherGCM;
|
|
659
753
|
function createCipheriv(
|
|
660
754
|
algorithm: CipherChaCha20Poly1305Types,
|
|
661
|
-
key:
|
|
755
|
+
key: CipherKey,
|
|
662
756
|
iv: BinaryLike,
|
|
663
757
|
options?: CipherChaCha20Poly1305Options,
|
|
664
758
|
): CipherChaCha20Poly1305;
|
|
665
759
|
function createCipheriv(
|
|
666
760
|
algorithm: string,
|
|
667
|
-
key:
|
|
761
|
+
key: CipherKey,
|
|
668
762
|
iv: BinaryLike | null,
|
|
669
|
-
options?: TransformOptions,
|
|
670
|
-
):
|
|
763
|
+
options?: stream.TransformOptions,
|
|
764
|
+
): Cipher;
|
|
671
765
|
/**
|
|
672
|
-
* Instances of the `
|
|
766
|
+
* Instances of the `Cipher` class are used to encrypt data. The class can be
|
|
673
767
|
* used in one of two ways:
|
|
674
768
|
*
|
|
675
769
|
* * As a `stream` that is both readable and writable, where plain unencrypted
|
|
@@ -678,10 +772,10 @@ declare module "node:crypto" {
|
|
|
678
772
|
* the encrypted data.
|
|
679
773
|
*
|
|
680
774
|
* The {@link createCipheriv} method is
|
|
681
|
-
* used to create `
|
|
775
|
+
* used to create `Cipher` instances. `Cipher` objects are not to be created
|
|
682
776
|
* directly using the `new` keyword.
|
|
683
777
|
*
|
|
684
|
-
* Example: Using `
|
|
778
|
+
* Example: Using `Cipher` objects as streams:
|
|
685
779
|
*
|
|
686
780
|
* ```js
|
|
687
781
|
* const {
|
|
@@ -716,7 +810,7 @@ declare module "node:crypto" {
|
|
|
716
810
|
* });
|
|
717
811
|
* ```
|
|
718
812
|
*
|
|
719
|
-
* Example: Using `
|
|
813
|
+
* Example: Using `Cipher` and piped streams:
|
|
720
814
|
*
|
|
721
815
|
* ```js
|
|
722
816
|
* import {
|
|
@@ -787,7 +881,7 @@ declare module "node:crypto" {
|
|
|
787
881
|
* ```
|
|
788
882
|
* @since v0.1.94
|
|
789
883
|
*/
|
|
790
|
-
class
|
|
884
|
+
class Cipher extends stream.Transform {
|
|
791
885
|
private constructor();
|
|
792
886
|
/**
|
|
793
887
|
* Updates the cipher with `data`. If the `inputEncoding` argument is given,
|
|
@@ -803,14 +897,12 @@ declare module "node:crypto" {
|
|
|
803
897
|
* @param inputEncoding The `encoding` of the data.
|
|
804
898
|
* @param outputEncoding The `encoding` of the return value.
|
|
805
899
|
*/
|
|
806
|
-
update(data:
|
|
807
|
-
update(
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
outputEncoding: BufferEncoding,
|
|
811
|
-
): string;
|
|
900
|
+
update(data: BinaryLike): NonSharedBuffer;
|
|
901
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
902
|
+
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
903
|
+
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
812
904
|
/**
|
|
813
|
-
* Once the `cipher.final()` method has been called, the `
|
|
905
|
+
* Once the `cipher.final()` method has been called, the `Cipher` object can no
|
|
814
906
|
* longer be used to encrypt data. Attempts to call `cipher.final()` more than
|
|
815
907
|
* once will result in an error being thrown.
|
|
816
908
|
* @since v0.1.94
|
|
@@ -820,7 +912,7 @@ declare module "node:crypto" {
|
|
|
820
912
|
final(): NonSharedBuffer;
|
|
821
913
|
final(outputEncoding: BufferEncoding): string;
|
|
822
914
|
/**
|
|
823
|
-
* When using block encryption algorithms, the `
|
|
915
|
+
* When using block encryption algorithms, the `Cipher` class will automatically
|
|
824
916
|
* add padding to the input data to the appropriate block size. To disable the
|
|
825
917
|
* default padding call `cipher.setAutoPadding(false)`.
|
|
826
918
|
*
|
|
@@ -836,31 +928,50 @@ declare module "node:crypto" {
|
|
|
836
928
|
*/
|
|
837
929
|
setAutoPadding(autoPadding?: boolean): this;
|
|
838
930
|
}
|
|
839
|
-
interface
|
|
931
|
+
interface CipherCCM extends Cipher {
|
|
932
|
+
setAAD(
|
|
933
|
+
buffer: NodeJS.ArrayBufferView,
|
|
934
|
+
options: {
|
|
935
|
+
plaintextLength: number;
|
|
936
|
+
},
|
|
937
|
+
): this;
|
|
938
|
+
getAuthTag(): NonSharedBuffer;
|
|
939
|
+
}
|
|
940
|
+
interface CipherGCM extends Cipher {
|
|
941
|
+
setAAD(
|
|
942
|
+
buffer: NodeJS.ArrayBufferView,
|
|
943
|
+
options?: {
|
|
944
|
+
plaintextLength: number;
|
|
945
|
+
},
|
|
946
|
+
): this;
|
|
947
|
+
getAuthTag(): NonSharedBuffer;
|
|
948
|
+
}
|
|
949
|
+
interface CipherOCB extends Cipher {
|
|
950
|
+
setAAD(
|
|
951
|
+
buffer: NodeJS.ArrayBufferView,
|
|
952
|
+
options?: {
|
|
953
|
+
plaintextLength: number;
|
|
954
|
+
},
|
|
955
|
+
): this;
|
|
840
956
|
getAuthTag(): NonSharedBuffer;
|
|
841
|
-
setAAD(buffer: BinaryLike, options?: {
|
|
842
|
-
plaintextLength?: number | undefined;
|
|
843
|
-
encoding?: BufferEncoding | undefined;
|
|
844
|
-
}): this;
|
|
845
957
|
}
|
|
846
|
-
interface
|
|
847
|
-
setAAD(
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
958
|
+
interface CipherChaCha20Poly1305 extends Cipher {
|
|
959
|
+
setAAD(
|
|
960
|
+
buffer: NodeJS.ArrayBufferView,
|
|
961
|
+
options: {
|
|
962
|
+
plaintextLength: number;
|
|
963
|
+
},
|
|
964
|
+
): this;
|
|
965
|
+
getAuthTag(): NonSharedBuffer;
|
|
851
966
|
}
|
|
852
|
-
interface CipherGCM extends Cipheriv, CipherAEADMethods {}
|
|
853
|
-
interface CipherOCB extends Cipheriv, CipherAEADMethods {}
|
|
854
|
-
interface CipherChaCha20Poly1305 extends Cipheriv, CipherAEADMethods {}
|
|
855
967
|
/**
|
|
856
|
-
* Creates and returns a `
|
|
968
|
+
* Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
|
|
857
969
|
*
|
|
858
970
|
* The `options` argument controls stream behavior and is optional except when a
|
|
859
|
-
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the
|
|
860
|
-
* `authTagLength` option is required
|
|
861
|
-
*
|
|
862
|
-
* For
|
|
863
|
-
* bytes and must be set to a different value if a different length is used.
|
|
971
|
+
* cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the
|
|
972
|
+
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength` option is not required but can be used to restrict accepted authentication tags
|
|
973
|
+
* to those with the specified length.
|
|
974
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
864
975
|
*
|
|
865
976
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
866
977
|
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
@@ -884,36 +995,36 @@ declare module "node:crypto" {
|
|
|
884
995
|
*/
|
|
885
996
|
function createDecipheriv(
|
|
886
997
|
algorithm: CipherCCMTypes,
|
|
887
|
-
key:
|
|
998
|
+
key: CipherKey,
|
|
888
999
|
iv: BinaryLike,
|
|
889
1000
|
options: CipherCCMOptions,
|
|
890
1001
|
): DecipherCCM;
|
|
891
1002
|
function createDecipheriv(
|
|
892
1003
|
algorithm: CipherOCBTypes,
|
|
893
|
-
key:
|
|
1004
|
+
key: CipherKey,
|
|
894
1005
|
iv: BinaryLike,
|
|
895
1006
|
options: CipherOCBOptions,
|
|
896
1007
|
): DecipherOCB;
|
|
897
1008
|
function createDecipheriv(
|
|
898
1009
|
algorithm: CipherGCMTypes,
|
|
899
|
-
key:
|
|
1010
|
+
key: CipherKey,
|
|
900
1011
|
iv: BinaryLike,
|
|
901
1012
|
options?: CipherGCMOptions,
|
|
902
1013
|
): DecipherGCM;
|
|
903
1014
|
function createDecipheriv(
|
|
904
1015
|
algorithm: CipherChaCha20Poly1305Types,
|
|
905
|
-
key:
|
|
1016
|
+
key: CipherKey,
|
|
906
1017
|
iv: BinaryLike,
|
|
907
1018
|
options?: CipherChaCha20Poly1305Options,
|
|
908
1019
|
): DecipherChaCha20Poly1305;
|
|
909
1020
|
function createDecipheriv(
|
|
910
1021
|
algorithm: string,
|
|
911
|
-
key:
|
|
1022
|
+
key: CipherKey,
|
|
912
1023
|
iv: BinaryLike | null,
|
|
913
|
-
options?: TransformOptions,
|
|
914
|
-
):
|
|
1024
|
+
options?: stream.TransformOptions,
|
|
1025
|
+
): Decipher;
|
|
915
1026
|
/**
|
|
916
|
-
* Instances of the `
|
|
1027
|
+
* Instances of the `Decipher` class are used to decrypt data. The class can be
|
|
917
1028
|
* used in one of two ways:
|
|
918
1029
|
*
|
|
919
1030
|
* * As a `stream` that is both readable and writable, where plain encrypted
|
|
@@ -922,10 +1033,10 @@ declare module "node:crypto" {
|
|
|
922
1033
|
* produce the unencrypted data.
|
|
923
1034
|
*
|
|
924
1035
|
* The {@link createDecipheriv} method is
|
|
925
|
-
* used to create `
|
|
1036
|
+
* used to create `Decipher` instances. `Decipher` objects are not to be created
|
|
926
1037
|
* directly using the `new` keyword.
|
|
927
1038
|
*
|
|
928
|
-
* Example: Using `
|
|
1039
|
+
* Example: Using `Decipher` objects as streams:
|
|
929
1040
|
*
|
|
930
1041
|
* ```js
|
|
931
1042
|
* import { Buffer } from 'node:buffer';
|
|
@@ -964,7 +1075,7 @@ declare module "node:crypto" {
|
|
|
964
1075
|
* decipher.end();
|
|
965
1076
|
* ```
|
|
966
1077
|
*
|
|
967
|
-
* Example: Using `
|
|
1078
|
+
* Example: Using `Decipher` and piped streams:
|
|
968
1079
|
*
|
|
969
1080
|
* ```js
|
|
970
1081
|
* import {
|
|
@@ -1020,7 +1131,7 @@ declare module "node:crypto" {
|
|
|
1020
1131
|
* ```
|
|
1021
1132
|
* @since v0.1.94
|
|
1022
1133
|
*/
|
|
1023
|
-
class
|
|
1134
|
+
class Decipher extends stream.Transform {
|
|
1024
1135
|
private constructor();
|
|
1025
1136
|
/**
|
|
1026
1137
|
* Updates the decipher with `data`. If the `inputEncoding` argument is given,
|
|
@@ -1036,14 +1147,12 @@ declare module "node:crypto" {
|
|
|
1036
1147
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1037
1148
|
* @param outputEncoding The `encoding` of the return value.
|
|
1038
1149
|
*/
|
|
1039
|
-
update(data:
|
|
1040
|
-
update(
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
outputEncoding: BufferEncoding,
|
|
1044
|
-
): string;
|
|
1150
|
+
update(data: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
1151
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
1152
|
+
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
1153
|
+
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
1045
1154
|
/**
|
|
1046
|
-
* Once the `decipher.final()` method has been called, the `
|
|
1155
|
+
* Once the `decipher.final()` method has been called, the `Decipher` object can
|
|
1047
1156
|
* no longer be used to decrypt data. Attempts to call `decipher.final()` more
|
|
1048
1157
|
* than once will result in an error being thrown.
|
|
1049
1158
|
* @since v0.1.94
|
|
@@ -1066,59 +1175,54 @@ declare module "node:crypto" {
|
|
|
1066
1175
|
*/
|
|
1067
1176
|
setAutoPadding(auto_padding?: boolean): this;
|
|
1068
1177
|
}
|
|
1069
|
-
interface
|
|
1178
|
+
interface DecipherCCM extends Decipher {
|
|
1179
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
1180
|
+
setAAD(
|
|
1181
|
+
buffer: NodeJS.ArrayBufferView,
|
|
1182
|
+
options: {
|
|
1183
|
+
plaintextLength: number;
|
|
1184
|
+
},
|
|
1185
|
+
): this;
|
|
1186
|
+
}
|
|
1187
|
+
interface DecipherGCM extends Decipher {
|
|
1188
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
1189
|
+
setAAD(
|
|
1190
|
+
buffer: NodeJS.ArrayBufferView,
|
|
1191
|
+
options?: {
|
|
1192
|
+
plaintextLength: number;
|
|
1193
|
+
},
|
|
1194
|
+
): this;
|
|
1195
|
+
}
|
|
1196
|
+
interface DecipherOCB extends Decipher {
|
|
1197
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
1070
1198
|
setAAD(
|
|
1071
|
-
buffer:
|
|
1199
|
+
buffer: NodeJS.ArrayBufferView,
|
|
1072
1200
|
options?: {
|
|
1073
|
-
plaintextLength
|
|
1074
|
-
encoding?: BufferEncoding | undefined;
|
|
1201
|
+
plaintextLength: number;
|
|
1075
1202
|
},
|
|
1076
1203
|
): this;
|
|
1077
|
-
setAuthTag(buffer: BinaryLike, encoding?: BufferEncoding): this;
|
|
1078
1204
|
}
|
|
1079
|
-
interface
|
|
1205
|
+
interface DecipherChaCha20Poly1305 extends Decipher {
|
|
1206
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
1080
1207
|
setAAD(
|
|
1081
|
-
buffer:
|
|
1208
|
+
buffer: NodeJS.ArrayBufferView,
|
|
1082
1209
|
options: {
|
|
1083
1210
|
plaintextLength: number;
|
|
1084
|
-
encoding?: BufferEncoding | undefined;
|
|
1085
1211
|
},
|
|
1086
1212
|
): this;
|
|
1087
1213
|
}
|
|
1088
|
-
interface DecipherGCM extends Decipheriv, DecipherAEADMethods {}
|
|
1089
|
-
interface DecipherOCB extends Decipheriv, DecipherAEADMethods {}
|
|
1090
|
-
interface DecipherChaCha20Poly1305 extends Decipheriv, DecipherAEADMethods {}
|
|
1091
1214
|
interface PrivateKeyInput {
|
|
1092
|
-
key:
|
|
1093
|
-
format?:
|
|
1094
|
-
type?:
|
|
1095
|
-
passphrase?:
|
|
1096
|
-
encoding?:
|
|
1215
|
+
key: string | Buffer;
|
|
1216
|
+
format?: KeyFormat | undefined;
|
|
1217
|
+
type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
|
|
1218
|
+
passphrase?: string | Buffer | undefined;
|
|
1219
|
+
encoding?: string | undefined;
|
|
1097
1220
|
}
|
|
1098
1221
|
interface PublicKeyInput {
|
|
1099
|
-
key:
|
|
1100
|
-
format?:
|
|
1101
|
-
type?:
|
|
1102
|
-
encoding?:
|
|
1103
|
-
}
|
|
1104
|
-
interface RawPrivateKeyInput {
|
|
1105
|
-
key: ArrayBufferLike | NodeJS.ArrayBufferView;
|
|
1106
|
-
format: "raw-private" | "raw-seed";
|
|
1107
|
-
asymmetricKeyType: AsymmetricKeyType;
|
|
1108
|
-
namedCurve?: string | undefined;
|
|
1109
|
-
}
|
|
1110
|
-
interface RawPublicKeyInput {
|
|
1111
|
-
key: ArrayBufferLike | NodeJS.ArrayBufferView;
|
|
1112
|
-
format: "raw-public";
|
|
1113
|
-
asymmetricKeyType: AsymmetricKeyType;
|
|
1114
|
-
namedCurve?: string | undefined;
|
|
1115
|
-
}
|
|
1116
|
-
interface JsonWebKeyInput {
|
|
1117
|
-
key: webcrypto.JsonWebKey;
|
|
1118
|
-
format: "jwk";
|
|
1119
|
-
}
|
|
1120
|
-
interface SecretKeyOptions {
|
|
1121
|
-
length: number;
|
|
1222
|
+
key: string | Buffer;
|
|
1223
|
+
format?: KeyFormat | undefined;
|
|
1224
|
+
type?: "pkcs1" | "spki" | undefined;
|
|
1225
|
+
encoding?: string | undefined;
|
|
1122
1226
|
}
|
|
1123
1227
|
/**
|
|
1124
1228
|
* Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`.
|
|
@@ -1141,7 +1245,9 @@ declare module "node:crypto" {
|
|
|
1141
1245
|
*/
|
|
1142
1246
|
function generateKey(
|
|
1143
1247
|
type: "hmac" | "aes",
|
|
1144
|
-
options:
|
|
1248
|
+
options: {
|
|
1249
|
+
length: number;
|
|
1250
|
+
},
|
|
1145
1251
|
callback: (err: Error | null, key: KeyObject) => void,
|
|
1146
1252
|
): void;
|
|
1147
1253
|
/**
|
|
@@ -1161,7 +1267,16 @@ declare module "node:crypto" {
|
|
|
1161
1267
|
* @since v15.0.0
|
|
1162
1268
|
* @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
|
|
1163
1269
|
*/
|
|
1164
|
-
function generateKeySync(
|
|
1270
|
+
function generateKeySync(
|
|
1271
|
+
type: "hmac" | "aes",
|
|
1272
|
+
options: {
|
|
1273
|
+
length: number;
|
|
1274
|
+
},
|
|
1275
|
+
): KeyObject;
|
|
1276
|
+
interface JsonWebKeyInput {
|
|
1277
|
+
key: JsonWebKey;
|
|
1278
|
+
format: "jwk";
|
|
1279
|
+
}
|
|
1165
1280
|
/**
|
|
1166
1281
|
* Creates and returns a new key object containing a private key. If `key` is a
|
|
1167
1282
|
* string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above.
|
|
@@ -1170,7 +1285,7 @@ declare module "node:crypto" {
|
|
|
1170
1285
|
* of the passphrase is limited to 1024 bytes.
|
|
1171
1286
|
* @since v11.6.0
|
|
1172
1287
|
*/
|
|
1173
|
-
function createPrivateKey(key: PrivateKeyInput |
|
|
1288
|
+
function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
|
|
1174
1289
|
/**
|
|
1175
1290
|
* Creates and returns a new key object containing a public key. If `key` is a
|
|
1176
1291
|
* string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key;
|
|
@@ -1185,14 +1300,15 @@ declare module "node:crypto" {
|
|
|
1185
1300
|
* and it will be impossible to extract the private key from the returned object.
|
|
1186
1301
|
* @since v11.6.0
|
|
1187
1302
|
*/
|
|
1188
|
-
function createPublicKey(key: PublicKeyInput |
|
|
1303
|
+
function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
|
|
1189
1304
|
/**
|
|
1190
1305
|
* Creates and returns a new key object containing a secret key for symmetric
|
|
1191
1306
|
* encryption or `Hmac`.
|
|
1192
1307
|
* @since v11.6.0
|
|
1193
1308
|
* @param encoding The string encoding when `key` is a string.
|
|
1194
1309
|
*/
|
|
1195
|
-
function createSecretKey(key:
|
|
1310
|
+
function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
|
|
1311
|
+
function createSecretKey(key: string, encoding: BufferEncoding): KeyObject;
|
|
1196
1312
|
/**
|
|
1197
1313
|
* Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms.
|
|
1198
1314
|
* Optional `options` argument controls the `stream.Writable` behavior.
|
|
@@ -1205,26 +1321,27 @@ declare module "node:crypto" {
|
|
|
1205
1321
|
* @since v0.1.92
|
|
1206
1322
|
* @param options `stream.Writable` options
|
|
1207
1323
|
*/
|
|
1208
|
-
function createSign(algorithm: string, options?: WritableOptions): Sign;
|
|
1324
|
+
function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
|
|
1209
1325
|
type DSAEncoding = "der" | "ieee-p1363";
|
|
1210
1326
|
interface SigningOptions {
|
|
1327
|
+
/**
|
|
1328
|
+
* @see crypto.constants.RSA_PKCS1_PADDING
|
|
1329
|
+
*/
|
|
1211
1330
|
padding?: number | undefined;
|
|
1212
1331
|
saltLength?: number | undefined;
|
|
1213
1332
|
dsaEncoding?: DSAEncoding | undefined;
|
|
1214
|
-
context?: NodeJS.ArrayBufferView | undefined;
|
|
1215
1333
|
}
|
|
1216
1334
|
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
1217
|
-
interface SignRawPrivateKeyInput extends RawPrivateKeyInput, SigningOptions {}
|
|
1218
|
-
interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1219
1335
|
interface SignKeyObjectInput extends SigningOptions {
|
|
1220
1336
|
key: KeyObject;
|
|
1221
1337
|
}
|
|
1338
|
+
interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1222
1339
|
interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
|
|
1223
|
-
interface VerifyRawPublicKeyInput extends RawPublicKeyInput, SigningOptions {}
|
|
1224
|
-
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1225
1340
|
interface VerifyKeyObjectInput extends SigningOptions {
|
|
1226
1341
|
key: KeyObject;
|
|
1227
1342
|
}
|
|
1343
|
+
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1344
|
+
type KeyLike = string | Buffer | KeyObject;
|
|
1228
1345
|
/**
|
|
1229
1346
|
* The `Sign` class is a utility for generating signatures. It can be used in one
|
|
1230
1347
|
* of two ways:
|
|
@@ -1288,7 +1405,7 @@ declare module "node:crypto" {
|
|
|
1288
1405
|
* ```
|
|
1289
1406
|
* @since v0.1.92
|
|
1290
1407
|
*/
|
|
1291
|
-
class Sign extends Writable {
|
|
1408
|
+
class Sign extends stream.Writable {
|
|
1292
1409
|
private constructor();
|
|
1293
1410
|
/**
|
|
1294
1411
|
* Updates the `Sign` content with the given `data`, the encoding of which
|
|
@@ -1300,7 +1417,8 @@ declare module "node:crypto" {
|
|
|
1300
1417
|
* @since v0.1.92
|
|
1301
1418
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1302
1419
|
*/
|
|
1303
|
-
update(data:
|
|
1420
|
+
update(data: BinaryLike): this;
|
|
1421
|
+
update(data: string, inputEncoding: Encoding): this;
|
|
1304
1422
|
/**
|
|
1305
1423
|
* Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
|
|
1306
1424
|
*
|
|
@@ -1313,22 +1431,10 @@ declare module "node:crypto" {
|
|
|
1313
1431
|
* called. Multiple calls to `sign.sign()` will result in an error being thrown.
|
|
1314
1432
|
* @since v0.1.92
|
|
1315
1433
|
*/
|
|
1434
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
1316
1435
|
sign(
|
|
1317
|
-
privateKey:
|
|
1318
|
-
|
|
1319
|
-
| SignKeyObjectInput
|
|
1320
|
-
| SignPrivateKeyInput
|
|
1321
|
-
| SignRawPrivateKeyInput
|
|
1322
|
-
| SignJsonWebKeyInput,
|
|
1323
|
-
): NonSharedBuffer;
|
|
1324
|
-
sign(
|
|
1325
|
-
privateKey:
|
|
1326
|
-
| KeyLike
|
|
1327
|
-
| SignKeyObjectInput
|
|
1328
|
-
| SignPrivateKeyInput
|
|
1329
|
-
| SignRawPrivateKeyInput
|
|
1330
|
-
| SignJsonWebKeyInput,
|
|
1331
|
-
outputFormat: BufferEncoding,
|
|
1436
|
+
privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
1437
|
+
outputFormat: BinaryToTextEncoding,
|
|
1332
1438
|
): string;
|
|
1333
1439
|
}
|
|
1334
1440
|
/**
|
|
@@ -1344,7 +1450,7 @@ declare module "node:crypto" {
|
|
|
1344
1450
|
* @since v0.1.92
|
|
1345
1451
|
* @param options `stream.Writable` options
|
|
1346
1452
|
*/
|
|
1347
|
-
function createVerify(algorithm: string, options?: WritableOptions): Verify;
|
|
1453
|
+
function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
|
|
1348
1454
|
/**
|
|
1349
1455
|
* The `Verify` class is a utility for verifying signatures. It can be used in one
|
|
1350
1456
|
* of two ways:
|
|
@@ -1359,7 +1465,7 @@ declare module "node:crypto" {
|
|
|
1359
1465
|
* See `Sign` for examples.
|
|
1360
1466
|
* @since v0.1.92
|
|
1361
1467
|
*/
|
|
1362
|
-
class Verify extends Writable {
|
|
1468
|
+
class Verify extends stream.Writable {
|
|
1363
1469
|
private constructor();
|
|
1364
1470
|
/**
|
|
1365
1471
|
* Updates the `Verify` content with the given `data`, the encoding of which
|
|
@@ -1371,11 +1477,12 @@ declare module "node:crypto" {
|
|
|
1371
1477
|
* @since v0.1.92
|
|
1372
1478
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1373
1479
|
*/
|
|
1374
|
-
update(data:
|
|
1480
|
+
update(data: BinaryLike): Verify;
|
|
1481
|
+
update(data: string, inputEncoding: Encoding): Verify;
|
|
1375
1482
|
/**
|
|
1376
|
-
* Verifies the provided data using the given `
|
|
1483
|
+
* Verifies the provided data using the given `object` and `signature`.
|
|
1377
1484
|
*
|
|
1378
|
-
* If `
|
|
1485
|
+
* If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an
|
|
1379
1486
|
* object, the following additional properties can be passed:
|
|
1380
1487
|
*
|
|
1381
1488
|
* The `signature` argument is the previously calculated signature for the data, in
|
|
@@ -1392,14 +1499,13 @@ declare module "node:crypto" {
|
|
|
1392
1499
|
* @since v0.1.92
|
|
1393
1500
|
*/
|
|
1394
1501
|
verify(
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
signatureEncoding?: BufferEncoding,
|
|
1502
|
+
object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
1503
|
+
signature: NodeJS.ArrayBufferView,
|
|
1504
|
+
): boolean;
|
|
1505
|
+
verify(
|
|
1506
|
+
object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
1507
|
+
signature: string,
|
|
1508
|
+
signature_format?: BinaryToTextEncoding,
|
|
1403
1509
|
): boolean;
|
|
1404
1510
|
}
|
|
1405
1511
|
/**
|
|
@@ -1420,15 +1526,24 @@ declare module "node:crypto" {
|
|
|
1420
1526
|
*/
|
|
1421
1527
|
function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
|
|
1422
1528
|
function createDiffieHellman(
|
|
1423
|
-
prime:
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1529
|
+
prime: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
1530
|
+
generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
|
|
1531
|
+
): DiffieHellman;
|
|
1532
|
+
function createDiffieHellman(
|
|
1533
|
+
prime: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
1534
|
+
generator: string,
|
|
1535
|
+
generatorEncoding: BinaryToTextEncoding,
|
|
1536
|
+
): DiffieHellman;
|
|
1537
|
+
function createDiffieHellman(
|
|
1538
|
+
prime: string,
|
|
1539
|
+
primeEncoding: BinaryToTextEncoding,
|
|
1540
|
+
generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
|
|
1427
1541
|
): DiffieHellman;
|
|
1428
1542
|
function createDiffieHellman(
|
|
1429
|
-
prime:
|
|
1430
|
-
|
|
1431
|
-
|
|
1543
|
+
prime: string,
|
|
1544
|
+
primeEncoding: BinaryToTextEncoding,
|
|
1545
|
+
generator: string,
|
|
1546
|
+
generatorEncoding: BinaryToTextEncoding,
|
|
1432
1547
|
): DiffieHellman;
|
|
1433
1548
|
/**
|
|
1434
1549
|
* The `DiffieHellman` class is a utility for creating Diffie-Hellman key
|
|
@@ -1470,15 +1585,13 @@ declare module "node:crypto" {
|
|
|
1470
1585
|
* If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
|
1471
1586
|
*
|
|
1472
1587
|
* This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular,
|
|
1473
|
-
* once a private key has been generated or set, calling this function only
|
|
1474
|
-
*
|
|
1475
|
-
* determined by the private key, the result will be the same unless the private key
|
|
1476
|
-
* has been changed via `diffieHellman.setPrivateKey()`.
|
|
1588
|
+
* once a private key has been generated or set, calling this function only updates
|
|
1589
|
+
* the public key but does not generate a new private key.
|
|
1477
1590
|
* @since v0.5.0
|
|
1478
1591
|
* @param encoding The `encoding` of the return value.
|
|
1479
1592
|
*/
|
|
1480
1593
|
generateKeys(): NonSharedBuffer;
|
|
1481
|
-
generateKeys(encoding:
|
|
1594
|
+
generateKeys(encoding: BinaryToTextEncoding): string;
|
|
1482
1595
|
/**
|
|
1483
1596
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
1484
1597
|
* party's public key and returns the computed shared secret. The supplied
|
|
@@ -1493,13 +1606,24 @@ declare module "node:crypto" {
|
|
|
1493
1606
|
* @param outputEncoding The `encoding` of the return value.
|
|
1494
1607
|
*/
|
|
1495
1608
|
computeSecret(
|
|
1496
|
-
otherPublicKey:
|
|
1497
|
-
inputEncoding?:
|
|
1609
|
+
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1610
|
+
inputEncoding?: null,
|
|
1611
|
+
outputEncoding?: null,
|
|
1612
|
+
): NonSharedBuffer;
|
|
1613
|
+
computeSecret(
|
|
1614
|
+
otherPublicKey: string,
|
|
1615
|
+
inputEncoding: BinaryToTextEncoding,
|
|
1616
|
+
outputEncoding?: null,
|
|
1498
1617
|
): NonSharedBuffer;
|
|
1499
1618
|
computeSecret(
|
|
1500
|
-
otherPublicKey:
|
|
1501
|
-
inputEncoding:
|
|
1502
|
-
outputEncoding:
|
|
1619
|
+
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1620
|
+
inputEncoding: null,
|
|
1621
|
+
outputEncoding: BinaryToTextEncoding,
|
|
1622
|
+
): string;
|
|
1623
|
+
computeSecret(
|
|
1624
|
+
otherPublicKey: string,
|
|
1625
|
+
inputEncoding: BinaryToTextEncoding,
|
|
1626
|
+
outputEncoding: BinaryToTextEncoding,
|
|
1503
1627
|
): string;
|
|
1504
1628
|
/**
|
|
1505
1629
|
* Returns the Diffie-Hellman prime in the specified `encoding`.
|
|
@@ -1509,7 +1633,7 @@ declare module "node:crypto" {
|
|
|
1509
1633
|
* @param encoding The `encoding` of the return value.
|
|
1510
1634
|
*/
|
|
1511
1635
|
getPrime(): NonSharedBuffer;
|
|
1512
|
-
getPrime(encoding:
|
|
1636
|
+
getPrime(encoding: BinaryToTextEncoding): string;
|
|
1513
1637
|
/**
|
|
1514
1638
|
* Returns the Diffie-Hellman generator in the specified `encoding`.
|
|
1515
1639
|
* If `encoding` is provided a string is
|
|
@@ -1518,7 +1642,7 @@ declare module "node:crypto" {
|
|
|
1518
1642
|
* @param encoding The `encoding` of the return value.
|
|
1519
1643
|
*/
|
|
1520
1644
|
getGenerator(): NonSharedBuffer;
|
|
1521
|
-
getGenerator(encoding:
|
|
1645
|
+
getGenerator(encoding: BinaryToTextEncoding): string;
|
|
1522
1646
|
/**
|
|
1523
1647
|
* Returns the Diffie-Hellman public key in the specified `encoding`.
|
|
1524
1648
|
* If `encoding` is provided a
|
|
@@ -1527,7 +1651,7 @@ declare module "node:crypto" {
|
|
|
1527
1651
|
* @param encoding The `encoding` of the return value.
|
|
1528
1652
|
*/
|
|
1529
1653
|
getPublicKey(): NonSharedBuffer;
|
|
1530
|
-
getPublicKey(encoding:
|
|
1654
|
+
getPublicKey(encoding: BinaryToTextEncoding): string;
|
|
1531
1655
|
/**
|
|
1532
1656
|
* Returns the Diffie-Hellman private key in the specified `encoding`.
|
|
1533
1657
|
* If `encoding` is provided a
|
|
@@ -1536,7 +1660,7 @@ declare module "node:crypto" {
|
|
|
1536
1660
|
* @param encoding The `encoding` of the return value.
|
|
1537
1661
|
*/
|
|
1538
1662
|
getPrivateKey(): NonSharedBuffer;
|
|
1539
|
-
getPrivateKey(encoding:
|
|
1663
|
+
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
1540
1664
|
/**
|
|
1541
1665
|
* Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected
|
|
1542
1666
|
* to be a string. If no `encoding` is provided, `publicKey` is expected
|
|
@@ -1544,7 +1668,8 @@ declare module "node:crypto" {
|
|
|
1544
1668
|
* @since v0.5.0
|
|
1545
1669
|
* @param encoding The `encoding` of the `publicKey` string.
|
|
1546
1670
|
*/
|
|
1547
|
-
setPublicKey(publicKey:
|
|
1671
|
+
setPublicKey(publicKey: NodeJS.ArrayBufferView): void;
|
|
1672
|
+
setPublicKey(publicKey: string, encoding: BufferEncoding): void;
|
|
1548
1673
|
/**
|
|
1549
1674
|
* Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
|
|
1550
1675
|
* to be a string. If no `encoding` is provided, `privateKey` is expected
|
|
@@ -1555,7 +1680,8 @@ declare module "node:crypto" {
|
|
|
1555
1680
|
* @since v0.5.0
|
|
1556
1681
|
* @param encoding The `encoding` of the `privateKey` string.
|
|
1557
1682
|
*/
|
|
1558
|
-
setPrivateKey(privateKey:
|
|
1683
|
+
setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
|
|
1684
|
+
setPrivateKey(privateKey: string, encoding: BufferEncoding): void;
|
|
1559
1685
|
/**
|
|
1560
1686
|
* A bit field containing any warnings and/or errors resulting from a check
|
|
1561
1687
|
* performed during initialization of the `DiffieHellman` object.
|
|
@@ -1593,10 +1719,13 @@ declare module "node:crypto" {
|
|
|
1593
1719
|
* ```
|
|
1594
1720
|
* @since v0.7.5
|
|
1595
1721
|
*/
|
|
1596
|
-
|
|
1597
|
-
|
|
1722
|
+
const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
|
|
1723
|
+
interface DiffieHellmanGroupConstructor {
|
|
1724
|
+
new(name: string): DiffieHellmanGroup;
|
|
1725
|
+
(name: string): DiffieHellmanGroup;
|
|
1726
|
+
readonly prototype: DiffieHellmanGroup;
|
|
1598
1727
|
}
|
|
1599
|
-
|
|
1728
|
+
type DiffieHellmanGroup = Omit<DiffieHellman, "setPublicKey" | "setPrivateKey">;
|
|
1600
1729
|
/**
|
|
1601
1730
|
* Creates a predefined `DiffieHellmanGroup` key exchange object. The
|
|
1602
1731
|
* supported groups are listed in the documentation for `DiffieHellmanGroup`.
|
|
@@ -1810,8 +1939,9 @@ declare module "node:crypto" {
|
|
|
1810
1939
|
* console.log(`The dice rolled: ${n}`);
|
|
1811
1940
|
* ```
|
|
1812
1941
|
* @since v14.10.0, v12.19.0
|
|
1813
|
-
* @param min Start of random range (inclusive).
|
|
1942
|
+
* @param [min=0] Start of random range (inclusive).
|
|
1814
1943
|
* @param max End of random range (exclusive).
|
|
1944
|
+
* @param callback `function(err, n) {}`.
|
|
1815
1945
|
*/
|
|
1816
1946
|
function randomInt(max: number): number;
|
|
1817
1947
|
function randomInt(min: number, max: number): number;
|
|
@@ -1858,11 +1988,7 @@ declare module "node:crypto" {
|
|
|
1858
1988
|
* @param [size=buffer.length - offset]
|
|
1859
1989
|
* @return The object passed as `buffer` argument.
|
|
1860
1990
|
*/
|
|
1861
|
-
function randomFillSync<T extends
|
|
1862
|
-
buffer: T,
|
|
1863
|
-
offset?: number,
|
|
1864
|
-
size?: number,
|
|
1865
|
-
): T;
|
|
1991
|
+
function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
|
|
1866
1992
|
/**
|
|
1867
1993
|
* This function is similar to {@link randomBytes} but requires the first
|
|
1868
1994
|
* argument to be a `Buffer` that will be filled. It also
|
|
@@ -1938,16 +2064,16 @@ declare module "node:crypto" {
|
|
|
1938
2064
|
* @param [size=buffer.length - offset]
|
|
1939
2065
|
* @param callback `function(err, buf) {}`.
|
|
1940
2066
|
*/
|
|
1941
|
-
function randomFill<T extends
|
|
2067
|
+
function randomFill<T extends NodeJS.ArrayBufferView>(
|
|
1942
2068
|
buffer: T,
|
|
1943
2069
|
callback: (err: Error | null, buf: T) => void,
|
|
1944
2070
|
): void;
|
|
1945
|
-
function randomFill<T extends
|
|
2071
|
+
function randomFill<T extends NodeJS.ArrayBufferView>(
|
|
1946
2072
|
buffer: T,
|
|
1947
2073
|
offset: number,
|
|
1948
2074
|
callback: (err: Error | null, buf: T) => void,
|
|
1949
2075
|
): void;
|
|
1950
|
-
function randomFill<T extends
|
|
2076
|
+
function randomFill<T extends NodeJS.ArrayBufferView>(
|
|
1951
2077
|
buffer: T,
|
|
1952
2078
|
offset: number,
|
|
1953
2079
|
size: number,
|
|
@@ -2045,25 +2171,19 @@ declare module "node:crypto" {
|
|
|
2045
2171
|
keylen: number,
|
|
2046
2172
|
options?: ScryptOptions,
|
|
2047
2173
|
): NonSharedBuffer;
|
|
2048
|
-
interface
|
|
2174
|
+
interface RsaPublicKey {
|
|
2175
|
+
key: KeyLike;
|
|
2049
2176
|
padding?: number | undefined;
|
|
2050
|
-
encoding?: BufferEncoding | undefined;
|
|
2051
|
-
}
|
|
2052
|
-
interface PublicDecryptPrivateKeyInput extends PrivateKeyInput, PublicDecryptOptions {}
|
|
2053
|
-
interface PublicDecryptPublicKeyInput extends PublicKeyInput, PublicDecryptOptions {}
|
|
2054
|
-
interface PublicDecryptJsonWebKeyInput extends JsonWebKeyInput, PublicDecryptOptions {}
|
|
2055
|
-
interface PublicDecryptKeyObjectInput extends PublicDecryptOptions {
|
|
2056
|
-
key: KeyObject;
|
|
2057
2177
|
}
|
|
2058
|
-
interface
|
|
2178
|
+
interface RsaPrivateKey {
|
|
2179
|
+
key: KeyLike;
|
|
2180
|
+
passphrase?: string | undefined;
|
|
2181
|
+
/**
|
|
2182
|
+
* @default 'sha1'
|
|
2183
|
+
*/
|
|
2059
2184
|
oaepHash?: string | undefined;
|
|
2060
|
-
oaepLabel?:
|
|
2061
|
-
|
|
2062
|
-
interface PublicEncryptPrivateKeyInput extends PrivateKeyInput, PublicEncryptOptions {}
|
|
2063
|
-
interface PublicEncryptPublicKeyInput extends PublicKeyInput, PublicEncryptOptions {}
|
|
2064
|
-
interface PublicEncryptJsonWebKeyInput extends JsonWebKeyInput, PublicEncryptOptions {}
|
|
2065
|
-
interface PublicEncryptKeyObjectInput extends PublicEncryptOptions {
|
|
2066
|
-
key: KeyObject;
|
|
2185
|
+
oaepLabel?: NodeJS.TypedArray | undefined;
|
|
2186
|
+
padding?: number | undefined;
|
|
2067
2187
|
}
|
|
2068
2188
|
/**
|
|
2069
2189
|
* Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using
|
|
@@ -2077,13 +2197,8 @@ declare module "node:crypto" {
|
|
|
2077
2197
|
* @since v0.11.14
|
|
2078
2198
|
*/
|
|
2079
2199
|
function publicEncrypt(
|
|
2080
|
-
key:
|
|
2081
|
-
|
|
2082
|
-
| PublicEncryptKeyObjectInput
|
|
2083
|
-
| PublicEncryptPrivateKeyInput
|
|
2084
|
-
| PublicEncryptPublicKeyInput
|
|
2085
|
-
| PublicEncryptJsonWebKeyInput,
|
|
2086
|
-
buffer: BinaryLike,
|
|
2200
|
+
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2201
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2087
2202
|
): NonSharedBuffer;
|
|
2088
2203
|
/**
|
|
2089
2204
|
* Decrypts `buffer` with `key`.`buffer` was previously encrypted using
|
|
@@ -2097,13 +2212,8 @@ declare module "node:crypto" {
|
|
|
2097
2212
|
* @since v1.1.0
|
|
2098
2213
|
*/
|
|
2099
2214
|
function publicDecrypt(
|
|
2100
|
-
key:
|
|
2101
|
-
|
|
2102
|
-
| PublicDecryptKeyObjectInput
|
|
2103
|
-
| PublicDecryptPrivateKeyInput
|
|
2104
|
-
| PublicDecryptPublicKeyInput
|
|
2105
|
-
| PublicDecryptJsonWebKeyInput,
|
|
2106
|
-
buffer: BinaryLike,
|
|
2215
|
+
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2216
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2107
2217
|
): NonSharedBuffer;
|
|
2108
2218
|
/**
|
|
2109
2219
|
* Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
|
|
@@ -2114,12 +2224,8 @@ declare module "node:crypto" {
|
|
|
2114
2224
|
* @since v0.11.14
|
|
2115
2225
|
*/
|
|
2116
2226
|
function privateDecrypt(
|
|
2117
|
-
privateKey:
|
|
2118
|
-
|
|
2119
|
-
| PublicEncryptKeyObjectInput
|
|
2120
|
-
| PublicEncryptPrivateKeyInput
|
|
2121
|
-
| PublicEncryptJsonWebKeyInput,
|
|
2122
|
-
buffer: BinaryLike,
|
|
2227
|
+
privateKey: RsaPrivateKey | KeyLike,
|
|
2228
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2123
2229
|
): NonSharedBuffer;
|
|
2124
2230
|
/**
|
|
2125
2231
|
* Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
|
|
@@ -2130,12 +2236,8 @@ declare module "node:crypto" {
|
|
|
2130
2236
|
* @since v1.1.0
|
|
2131
2237
|
*/
|
|
2132
2238
|
function privateEncrypt(
|
|
2133
|
-
privateKey:
|
|
2134
|
-
|
|
2135
|
-
| PublicDecryptKeyObjectInput
|
|
2136
|
-
| PublicDecryptPrivateKeyInput
|
|
2137
|
-
| PublicDecryptJsonWebKeyInput,
|
|
2138
|
-
buffer: BinaryLike,
|
|
2239
|
+
privateKey: RsaPrivateKey | KeyLike,
|
|
2240
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2139
2241
|
): NonSharedBuffer;
|
|
2140
2242
|
/**
|
|
2141
2243
|
* ```js
|
|
@@ -2185,7 +2287,6 @@ declare module "node:crypto" {
|
|
|
2185
2287
|
* @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms.
|
|
2186
2288
|
*/
|
|
2187
2289
|
function getHashes(): string[];
|
|
2188
|
-
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
|
2189
2290
|
/**
|
|
2190
2291
|
* The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH)
|
|
2191
2292
|
* key exchanges.
|
|
@@ -2258,21 +2359,15 @@ declare module "node:crypto" {
|
|
|
2258
2359
|
* @since v10.0.0
|
|
2259
2360
|
* @param inputEncoding The `encoding` of the `key` string.
|
|
2260
2361
|
* @param outputEncoding The `encoding` of the return value.
|
|
2362
|
+
* @param [format='uncompressed']
|
|
2261
2363
|
*/
|
|
2262
2364
|
static convertKey(
|
|
2263
2365
|
key: BinaryLike,
|
|
2264
2366
|
curve: string,
|
|
2265
|
-
inputEncoding?:
|
|
2266
|
-
outputEncoding?:
|
|
2267
|
-
format?: "uncompressed" | "compressed" | "hybrid",
|
|
2268
|
-
): NonSharedBuffer;
|
|
2269
|
-
static convertKey(
|
|
2270
|
-
key: BinaryLike,
|
|
2271
|
-
curve: string,
|
|
2272
|
-
inputEncoding: BufferEncoding | null | undefined,
|
|
2273
|
-
outputEncoding: BufferEncoding,
|
|
2367
|
+
inputEncoding?: BinaryToTextEncoding,
|
|
2368
|
+
outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
|
|
2274
2369
|
format?: "uncompressed" | "compressed" | "hybrid",
|
|
2275
|
-
): string;
|
|
2370
|
+
): NonSharedBuffer | string;
|
|
2276
2371
|
/**
|
|
2277
2372
|
* Generates private and public EC Diffie-Hellman key values, and returns
|
|
2278
2373
|
* the public key in the specified `format` and `encoding`. This key should be
|
|
@@ -2285,8 +2380,8 @@ declare module "node:crypto" {
|
|
|
2285
2380
|
* @param encoding The `encoding` of the return value.
|
|
2286
2381
|
* @param [format='uncompressed']
|
|
2287
2382
|
*/
|
|
2288
|
-
generateKeys(
|
|
2289
|
-
generateKeys(encoding:
|
|
2383
|
+
generateKeys(): NonSharedBuffer;
|
|
2384
|
+
generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2290
2385
|
/**
|
|
2291
2386
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
2292
2387
|
* party's public key and returns the computed shared secret. The supplied
|
|
@@ -2304,11 +2399,13 @@ declare module "node:crypto" {
|
|
|
2304
2399
|
* @param inputEncoding The `encoding` of the `otherPublicKey` string.
|
|
2305
2400
|
* @param outputEncoding The `encoding` of the return value.
|
|
2306
2401
|
*/
|
|
2307
|
-
computeSecret(otherPublicKey:
|
|
2402
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
2403
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer;
|
|
2404
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
2308
2405
|
computeSecret(
|
|
2309
|
-
otherPublicKey:
|
|
2310
|
-
inputEncoding:
|
|
2311
|
-
outputEncoding:
|
|
2406
|
+
otherPublicKey: string,
|
|
2407
|
+
inputEncoding: BinaryToTextEncoding,
|
|
2408
|
+
outputEncoding: BinaryToTextEncoding,
|
|
2312
2409
|
): string;
|
|
2313
2410
|
/**
|
|
2314
2411
|
* If `encoding` is specified, a string is returned; otherwise a `Buffer` is
|
|
@@ -2318,7 +2415,7 @@ declare module "node:crypto" {
|
|
|
2318
2415
|
* @return The EC Diffie-Hellman in the specified `encoding`.
|
|
2319
2416
|
*/
|
|
2320
2417
|
getPrivateKey(): NonSharedBuffer;
|
|
2321
|
-
getPrivateKey(encoding:
|
|
2418
|
+
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
2322
2419
|
/**
|
|
2323
2420
|
* The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
|
|
2324
2421
|
*
|
|
@@ -2330,7 +2427,7 @@ declare module "node:crypto" {
|
|
|
2330
2427
|
* @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
|
|
2331
2428
|
*/
|
|
2332
2429
|
getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
|
|
2333
|
-
getPublicKey(encoding:
|
|
2430
|
+
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2334
2431
|
/**
|
|
2335
2432
|
* Sets the EC Diffie-Hellman private key.
|
|
2336
2433
|
* If `encoding` is provided, `privateKey` is expected
|
|
@@ -2342,7 +2439,8 @@ declare module "node:crypto" {
|
|
|
2342
2439
|
* @since v0.11.14
|
|
2343
2440
|
* @param encoding The `encoding` of the `privateKey` string.
|
|
2344
2441
|
*/
|
|
2345
|
-
setPrivateKey(privateKey:
|
|
2442
|
+
setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
|
|
2443
|
+
setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void;
|
|
2346
2444
|
}
|
|
2347
2445
|
/**
|
|
2348
2446
|
* Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
|
|
@@ -2377,45 +2475,193 @@ declare module "node:crypto" {
|
|
|
2377
2475
|
* not introduce timing vulnerabilities.
|
|
2378
2476
|
* @since v6.6.0
|
|
2379
2477
|
*/
|
|
2380
|
-
function timingSafeEqual(
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
generator?: number | undefined;
|
|
2388
|
-
groupName?: string | undefined;
|
|
2478
|
+
function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
|
|
2479
|
+
type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448";
|
|
2480
|
+
type KeyFormat = "pem" | "der" | "jwk";
|
|
2481
|
+
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
2482
|
+
format: T;
|
|
2483
|
+
cipher?: string | undefined;
|
|
2484
|
+
passphrase?: string | undefined;
|
|
2389
2485
|
}
|
|
2390
|
-
interface
|
|
2391
|
-
|
|
2392
|
-
|
|
2486
|
+
interface KeyPairKeyObjectResult {
|
|
2487
|
+
publicKey: KeyObject;
|
|
2488
|
+
privateKey: KeyObject;
|
|
2393
2489
|
}
|
|
2394
|
-
interface
|
|
2490
|
+
interface ED25519KeyPairKeyObjectOptions {}
|
|
2491
|
+
interface ED448KeyPairKeyObjectOptions {}
|
|
2492
|
+
interface X25519KeyPairKeyObjectOptions {}
|
|
2493
|
+
interface X448KeyPairKeyObjectOptions {}
|
|
2494
|
+
interface ECKeyPairKeyObjectOptions {
|
|
2495
|
+
/**
|
|
2496
|
+
* Name of the curve to use
|
|
2497
|
+
*/
|
|
2395
2498
|
namedCurve: string;
|
|
2499
|
+
/**
|
|
2500
|
+
* Must be `'named'` or `'explicit'`. Default: `'named'`.
|
|
2501
|
+
*/
|
|
2396
2502
|
paramEncoding?: "explicit" | "named" | undefined;
|
|
2397
2503
|
}
|
|
2398
|
-
interface
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2504
|
+
interface RSAKeyPairKeyObjectOptions {
|
|
2505
|
+
/**
|
|
2506
|
+
* Key size in bits
|
|
2507
|
+
*/
|
|
2508
|
+
modulusLength: number;
|
|
2509
|
+
/**
|
|
2510
|
+
* Public exponent
|
|
2511
|
+
* @default 0x10001
|
|
2512
|
+
*/
|
|
2513
|
+
publicExponent?: number | undefined;
|
|
2514
|
+
}
|
|
2515
|
+
interface RSAPSSKeyPairKeyObjectOptions {
|
|
2516
|
+
/**
|
|
2517
|
+
* Key size in bits
|
|
2518
|
+
*/
|
|
2403
2519
|
modulusLength: number;
|
|
2520
|
+
/**
|
|
2521
|
+
* Public exponent
|
|
2522
|
+
* @default 0x10001
|
|
2523
|
+
*/
|
|
2404
2524
|
publicExponent?: number | undefined;
|
|
2525
|
+
/**
|
|
2526
|
+
* Name of the message digest
|
|
2527
|
+
*/
|
|
2405
2528
|
hashAlgorithm?: string | undefined;
|
|
2529
|
+
/**
|
|
2530
|
+
* Name of the message digest used by MGF1
|
|
2531
|
+
*/
|
|
2406
2532
|
mgf1HashAlgorithm?: string | undefined;
|
|
2533
|
+
/**
|
|
2534
|
+
* Minimal salt length in bytes
|
|
2535
|
+
*/
|
|
2407
2536
|
saltLength?: string | undefined;
|
|
2408
2537
|
}
|
|
2409
|
-
interface
|
|
2538
|
+
interface DSAKeyPairKeyObjectOptions {
|
|
2539
|
+
/**
|
|
2540
|
+
* Key size in bits
|
|
2541
|
+
*/
|
|
2542
|
+
modulusLength: number;
|
|
2543
|
+
/**
|
|
2544
|
+
* Size of q in bits
|
|
2545
|
+
*/
|
|
2546
|
+
divisorLength: number;
|
|
2547
|
+
}
|
|
2548
|
+
interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2549
|
+
/**
|
|
2550
|
+
* Key size in bits
|
|
2551
|
+
*/
|
|
2410
2552
|
modulusLength: number;
|
|
2553
|
+
/**
|
|
2554
|
+
* Public exponent
|
|
2555
|
+
* @default 0x10001
|
|
2556
|
+
*/
|
|
2557
|
+
publicExponent?: number | undefined;
|
|
2558
|
+
publicKeyEncoding: {
|
|
2559
|
+
type: "pkcs1" | "spki";
|
|
2560
|
+
format: PubF;
|
|
2561
|
+
};
|
|
2562
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2563
|
+
type: "pkcs1" | "pkcs8";
|
|
2564
|
+
};
|
|
2565
|
+
}
|
|
2566
|
+
interface RSAPSSKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2567
|
+
/**
|
|
2568
|
+
* Key size in bits
|
|
2569
|
+
*/
|
|
2570
|
+
modulusLength: number;
|
|
2571
|
+
/**
|
|
2572
|
+
* Public exponent
|
|
2573
|
+
* @default 0x10001
|
|
2574
|
+
*/
|
|
2411
2575
|
publicExponent?: number | undefined;
|
|
2576
|
+
/**
|
|
2577
|
+
* Name of the message digest
|
|
2578
|
+
*/
|
|
2579
|
+
hashAlgorithm?: string | undefined;
|
|
2580
|
+
/**
|
|
2581
|
+
* Name of the message digest used by MGF1
|
|
2582
|
+
*/
|
|
2583
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2584
|
+
/**
|
|
2585
|
+
* Minimal salt length in bytes
|
|
2586
|
+
*/
|
|
2587
|
+
saltLength?: string | undefined;
|
|
2588
|
+
publicKeyEncoding: {
|
|
2589
|
+
type: "spki";
|
|
2590
|
+
format: PubF;
|
|
2591
|
+
};
|
|
2592
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2593
|
+
type: "pkcs8";
|
|
2594
|
+
};
|
|
2595
|
+
}
|
|
2596
|
+
interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2597
|
+
/**
|
|
2598
|
+
* Key size in bits
|
|
2599
|
+
*/
|
|
2600
|
+
modulusLength: number;
|
|
2601
|
+
/**
|
|
2602
|
+
* Size of q in bits
|
|
2603
|
+
*/
|
|
2604
|
+
divisorLength: number;
|
|
2605
|
+
publicKeyEncoding: {
|
|
2606
|
+
type: "spki";
|
|
2607
|
+
format: PubF;
|
|
2608
|
+
};
|
|
2609
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2610
|
+
type: "pkcs8";
|
|
2611
|
+
};
|
|
2612
|
+
}
|
|
2613
|
+
interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> extends ECKeyPairKeyObjectOptions {
|
|
2614
|
+
publicKeyEncoding: {
|
|
2615
|
+
type: "pkcs1" | "spki";
|
|
2616
|
+
format: PubF;
|
|
2617
|
+
};
|
|
2618
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2619
|
+
type: "sec1" | "pkcs8";
|
|
2620
|
+
};
|
|
2621
|
+
}
|
|
2622
|
+
interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2623
|
+
publicKeyEncoding: {
|
|
2624
|
+
type: "spki";
|
|
2625
|
+
format: PubF;
|
|
2626
|
+
};
|
|
2627
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2628
|
+
type: "pkcs8";
|
|
2629
|
+
};
|
|
2630
|
+
}
|
|
2631
|
+
interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2632
|
+
publicKeyEncoding: {
|
|
2633
|
+
type: "spki";
|
|
2634
|
+
format: PubF;
|
|
2635
|
+
};
|
|
2636
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2637
|
+
type: "pkcs8";
|
|
2638
|
+
};
|
|
2639
|
+
}
|
|
2640
|
+
interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2641
|
+
publicKeyEncoding: {
|
|
2642
|
+
type: "spki";
|
|
2643
|
+
format: PubF;
|
|
2644
|
+
};
|
|
2645
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2646
|
+
type: "pkcs8";
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2650
|
+
publicKeyEncoding: {
|
|
2651
|
+
type: "spki";
|
|
2652
|
+
format: PubF;
|
|
2653
|
+
};
|
|
2654
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2655
|
+
type: "pkcs8";
|
|
2656
|
+
};
|
|
2657
|
+
}
|
|
2658
|
+
interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
|
|
2659
|
+
publicKey: T1;
|
|
2660
|
+
privateKey: T2;
|
|
2412
2661
|
}
|
|
2413
|
-
interface SLHDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
|
|
2414
|
-
interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
|
|
2415
|
-
interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
|
|
2416
2662
|
/**
|
|
2417
|
-
* Generates a new asymmetric key pair of the given `type`.
|
|
2418
|
-
*
|
|
2663
|
+
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
2664
|
+
* Ed25519, Ed448, X25519, X448, and DH are currently supported.
|
|
2419
2665
|
*
|
|
2420
2666
|
* If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
|
|
2421
2667
|
* behaves as if `keyObject.export()` had been called on its result. Otherwise,
|
|
@@ -2452,61 +2698,148 @@ declare module "node:crypto" {
|
|
|
2452
2698
|
* When PEM encoding was selected, the respective key will be a string, otherwise
|
|
2453
2699
|
* it will be a buffer containing the data encoded as DER.
|
|
2454
2700
|
* @since v10.12.0
|
|
2455
|
-
* @param type
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
function generateKeyPairSync<T extends DHKeyPairOptions>(
|
|
2459
|
-
type: "dh",
|
|
2460
|
-
options: T,
|
|
2461
|
-
): KeyPairExportResult<T>;
|
|
2462
|
-
function generateKeyPairSync<T extends DSAKeyPairOptions>(
|
|
2463
|
-
type: "dsa",
|
|
2464
|
-
options: T,
|
|
2465
|
-
): KeyPairExportResult<T>;
|
|
2466
|
-
function generateKeyPairSync<T extends ECKeyPairOptions>(
|
|
2467
|
-
type: "ec",
|
|
2468
|
-
options: T,
|
|
2469
|
-
): KeyPairExportResult<T>;
|
|
2470
|
-
function generateKeyPairSync<T extends ED25519KeyPairOptions = {}>(
|
|
2471
|
-
type: "ed25519",
|
|
2472
|
-
options?: T,
|
|
2473
|
-
): KeyPairExportResult<T>;
|
|
2474
|
-
function generateKeyPairSync<T extends ED448KeyPairOptions = {}>(
|
|
2475
|
-
type: "ed448",
|
|
2476
|
-
options?: T,
|
|
2477
|
-
): KeyPairExportResult<T>;
|
|
2478
|
-
function generateKeyPairSync<T extends MLDSAKeyPairOptions = {}>(
|
|
2479
|
-
type: MLDSAKeyType,
|
|
2480
|
-
options?: T,
|
|
2481
|
-
): KeyPairExportResult<T>;
|
|
2482
|
-
function generateKeyPairSync<T extends MLKEMKeyPairOptions = {}>(
|
|
2483
|
-
type: MLKEMKeyType,
|
|
2484
|
-
options?: T,
|
|
2485
|
-
): KeyPairExportResult<T>;
|
|
2486
|
-
function generateKeyPairSync<T extends RSAPSSKeyPairOptions>(
|
|
2487
|
-
type: "rsa-pss",
|
|
2488
|
-
options: T,
|
|
2489
|
-
): KeyPairExportResult<T>;
|
|
2490
|
-
function generateKeyPairSync<T extends RSAKeyPairOptions>(
|
|
2701
|
+
* @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
|
|
2702
|
+
*/
|
|
2703
|
+
function generateKeyPairSync(
|
|
2491
2704
|
type: "rsa",
|
|
2492
|
-
options:
|
|
2493
|
-
):
|
|
2494
|
-
function generateKeyPairSync
|
|
2495
|
-
type:
|
|
2496
|
-
options
|
|
2497
|
-
):
|
|
2498
|
-
function generateKeyPairSync
|
|
2499
|
-
type: "
|
|
2500
|
-
options
|
|
2501
|
-
):
|
|
2502
|
-
function generateKeyPairSync
|
|
2503
|
-
type: "
|
|
2504
|
-
options
|
|
2505
|
-
):
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2705
|
+
options: RSAKeyPairOptions<"pem", "pem">,
|
|
2706
|
+
): KeyPairSyncResult<string, string>;
|
|
2707
|
+
function generateKeyPairSync(
|
|
2708
|
+
type: "rsa",
|
|
2709
|
+
options: RSAKeyPairOptions<"pem", "der">,
|
|
2710
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2711
|
+
function generateKeyPairSync(
|
|
2712
|
+
type: "rsa",
|
|
2713
|
+
options: RSAKeyPairOptions<"der", "pem">,
|
|
2714
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2715
|
+
function generateKeyPairSync(
|
|
2716
|
+
type: "rsa",
|
|
2717
|
+
options: RSAKeyPairOptions<"der", "der">,
|
|
2718
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2719
|
+
function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2720
|
+
function generateKeyPairSync(
|
|
2721
|
+
type: "rsa-pss",
|
|
2722
|
+
options: RSAPSSKeyPairOptions<"pem", "pem">,
|
|
2723
|
+
): KeyPairSyncResult<string, string>;
|
|
2724
|
+
function generateKeyPairSync(
|
|
2725
|
+
type: "rsa-pss",
|
|
2726
|
+
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2727
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2728
|
+
function generateKeyPairSync(
|
|
2729
|
+
type: "rsa-pss",
|
|
2730
|
+
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2731
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2732
|
+
function generateKeyPairSync(
|
|
2733
|
+
type: "rsa-pss",
|
|
2734
|
+
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2735
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2736
|
+
function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2737
|
+
function generateKeyPairSync(
|
|
2738
|
+
type: "dsa",
|
|
2739
|
+
options: DSAKeyPairOptions<"pem", "pem">,
|
|
2740
|
+
): KeyPairSyncResult<string, string>;
|
|
2741
|
+
function generateKeyPairSync(
|
|
2742
|
+
type: "dsa",
|
|
2743
|
+
options: DSAKeyPairOptions<"pem", "der">,
|
|
2744
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2745
|
+
function generateKeyPairSync(
|
|
2746
|
+
type: "dsa",
|
|
2747
|
+
options: DSAKeyPairOptions<"der", "pem">,
|
|
2748
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2749
|
+
function generateKeyPairSync(
|
|
2750
|
+
type: "dsa",
|
|
2751
|
+
options: DSAKeyPairOptions<"der", "der">,
|
|
2752
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2753
|
+
function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2754
|
+
function generateKeyPairSync(
|
|
2755
|
+
type: "ec",
|
|
2756
|
+
options: ECKeyPairOptions<"pem", "pem">,
|
|
2757
|
+
): KeyPairSyncResult<string, string>;
|
|
2758
|
+
function generateKeyPairSync(
|
|
2759
|
+
type: "ec",
|
|
2760
|
+
options: ECKeyPairOptions<"pem", "der">,
|
|
2761
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2762
|
+
function generateKeyPairSync(
|
|
2763
|
+
type: "ec",
|
|
2764
|
+
options: ECKeyPairOptions<"der", "pem">,
|
|
2765
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2766
|
+
function generateKeyPairSync(
|
|
2767
|
+
type: "ec",
|
|
2768
|
+
options: ECKeyPairOptions<"der", "der">,
|
|
2769
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2770
|
+
function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2771
|
+
function generateKeyPairSync(
|
|
2772
|
+
type: "ed25519",
|
|
2773
|
+
options: ED25519KeyPairOptions<"pem", "pem">,
|
|
2774
|
+
): KeyPairSyncResult<string, string>;
|
|
2775
|
+
function generateKeyPairSync(
|
|
2776
|
+
type: "ed25519",
|
|
2777
|
+
options: ED25519KeyPairOptions<"pem", "der">,
|
|
2778
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2779
|
+
function generateKeyPairSync(
|
|
2780
|
+
type: "ed25519",
|
|
2781
|
+
options: ED25519KeyPairOptions<"der", "pem">,
|
|
2782
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2783
|
+
function generateKeyPairSync(
|
|
2784
|
+
type: "ed25519",
|
|
2785
|
+
options: ED25519KeyPairOptions<"der", "der">,
|
|
2786
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2787
|
+
function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2788
|
+
function generateKeyPairSync(
|
|
2789
|
+
type: "ed448",
|
|
2790
|
+
options: ED448KeyPairOptions<"pem", "pem">,
|
|
2791
|
+
): KeyPairSyncResult<string, string>;
|
|
2792
|
+
function generateKeyPairSync(
|
|
2793
|
+
type: "ed448",
|
|
2794
|
+
options: ED448KeyPairOptions<"pem", "der">,
|
|
2795
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2796
|
+
function generateKeyPairSync(
|
|
2797
|
+
type: "ed448",
|
|
2798
|
+
options: ED448KeyPairOptions<"der", "pem">,
|
|
2799
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2800
|
+
function generateKeyPairSync(
|
|
2801
|
+
type: "ed448",
|
|
2802
|
+
options: ED448KeyPairOptions<"der", "der">,
|
|
2803
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2804
|
+
function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2805
|
+
function generateKeyPairSync(
|
|
2806
|
+
type: "x25519",
|
|
2807
|
+
options: X25519KeyPairOptions<"pem", "pem">,
|
|
2808
|
+
): KeyPairSyncResult<string, string>;
|
|
2809
|
+
function generateKeyPairSync(
|
|
2810
|
+
type: "x25519",
|
|
2811
|
+
options: X25519KeyPairOptions<"pem", "der">,
|
|
2812
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2813
|
+
function generateKeyPairSync(
|
|
2814
|
+
type: "x25519",
|
|
2815
|
+
options: X25519KeyPairOptions<"der", "pem">,
|
|
2816
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2817
|
+
function generateKeyPairSync(
|
|
2818
|
+
type: "x25519",
|
|
2819
|
+
options: X25519KeyPairOptions<"der", "der">,
|
|
2820
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2821
|
+
function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2822
|
+
function generateKeyPairSync(
|
|
2823
|
+
type: "x448",
|
|
2824
|
+
options: X448KeyPairOptions<"pem", "pem">,
|
|
2825
|
+
): KeyPairSyncResult<string, string>;
|
|
2826
|
+
function generateKeyPairSync(
|
|
2827
|
+
type: "x448",
|
|
2828
|
+
options: X448KeyPairOptions<"pem", "der">,
|
|
2829
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2830
|
+
function generateKeyPairSync(
|
|
2831
|
+
type: "x448",
|
|
2832
|
+
options: X448KeyPairOptions<"der", "pem">,
|
|
2833
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2834
|
+
function generateKeyPairSync(
|
|
2835
|
+
type: "x448",
|
|
2836
|
+
options: X448KeyPairOptions<"der", "der">,
|
|
2837
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2838
|
+
function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2839
|
+
/**
|
|
2840
|
+
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
2841
|
+
* Ed25519, Ed448, X25519, X448, and DH are currently supported.
|
|
2842
|
+
*
|
|
2510
2843
|
* If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
|
|
2511
2844
|
* behaves as if `keyObject.export()` had been called on its result. Otherwise,
|
|
2512
2845
|
* the respective part of the key is returned as a `KeyObject`.
|
|
@@ -2540,154 +2873,455 @@ declare module "node:crypto" {
|
|
|
2540
2873
|
* If this method is invoked as its `util.promisify()` ed version, it returns
|
|
2541
2874
|
* a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
|
|
2542
2875
|
* @since v10.12.0
|
|
2543
|
-
* @param type
|
|
2544
|
-
* supported [asymmetric key types](https://nodejs.org/docs/latest-v26.x/api/crypto.html#asymmetric-key-types).
|
|
2876
|
+
* @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
|
|
2545
2877
|
*/
|
|
2546
|
-
function generateKeyPair
|
|
2547
|
-
type: "
|
|
2548
|
-
options:
|
|
2549
|
-
callback:
|
|
2878
|
+
function generateKeyPair(
|
|
2879
|
+
type: "rsa",
|
|
2880
|
+
options: RSAKeyPairOptions<"pem", "pem">,
|
|
2881
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2882
|
+
): void;
|
|
2883
|
+
function generateKeyPair(
|
|
2884
|
+
type: "rsa",
|
|
2885
|
+
options: RSAKeyPairOptions<"pem", "der">,
|
|
2886
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2887
|
+
): void;
|
|
2888
|
+
function generateKeyPair(
|
|
2889
|
+
type: "rsa",
|
|
2890
|
+
options: RSAKeyPairOptions<"der", "pem">,
|
|
2891
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2892
|
+
): void;
|
|
2893
|
+
function generateKeyPair(
|
|
2894
|
+
type: "rsa",
|
|
2895
|
+
options: RSAKeyPairOptions<"der", "der">,
|
|
2896
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2897
|
+
): void;
|
|
2898
|
+
function generateKeyPair(
|
|
2899
|
+
type: "rsa",
|
|
2900
|
+
options: RSAKeyPairKeyObjectOptions,
|
|
2901
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
2902
|
+
): void;
|
|
2903
|
+
function generateKeyPair(
|
|
2904
|
+
type: "rsa-pss",
|
|
2905
|
+
options: RSAPSSKeyPairOptions<"pem", "pem">,
|
|
2906
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2907
|
+
): void;
|
|
2908
|
+
function generateKeyPair(
|
|
2909
|
+
type: "rsa-pss",
|
|
2910
|
+
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2911
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2912
|
+
): void;
|
|
2913
|
+
function generateKeyPair(
|
|
2914
|
+
type: "rsa-pss",
|
|
2915
|
+
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2916
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2917
|
+
): void;
|
|
2918
|
+
function generateKeyPair(
|
|
2919
|
+
type: "rsa-pss",
|
|
2920
|
+
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2921
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2922
|
+
): void;
|
|
2923
|
+
function generateKeyPair(
|
|
2924
|
+
type: "rsa-pss",
|
|
2925
|
+
options: RSAPSSKeyPairKeyObjectOptions,
|
|
2926
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
2927
|
+
): void;
|
|
2928
|
+
function generateKeyPair(
|
|
2929
|
+
type: "dsa",
|
|
2930
|
+
options: DSAKeyPairOptions<"pem", "pem">,
|
|
2931
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2550
2932
|
): void;
|
|
2551
|
-
function generateKeyPair
|
|
2933
|
+
function generateKeyPair(
|
|
2552
2934
|
type: "dsa",
|
|
2553
|
-
options:
|
|
2554
|
-
callback:
|
|
2935
|
+
options: DSAKeyPairOptions<"pem", "der">,
|
|
2936
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2555
2937
|
): void;
|
|
2556
|
-
function generateKeyPair
|
|
2938
|
+
function generateKeyPair(
|
|
2939
|
+
type: "dsa",
|
|
2940
|
+
options: DSAKeyPairOptions<"der", "pem">,
|
|
2941
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2942
|
+
): void;
|
|
2943
|
+
function generateKeyPair(
|
|
2944
|
+
type: "dsa",
|
|
2945
|
+
options: DSAKeyPairOptions<"der", "der">,
|
|
2946
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2947
|
+
): void;
|
|
2948
|
+
function generateKeyPair(
|
|
2949
|
+
type: "dsa",
|
|
2950
|
+
options: DSAKeyPairKeyObjectOptions,
|
|
2951
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
2952
|
+
): void;
|
|
2953
|
+
function generateKeyPair(
|
|
2557
2954
|
type: "ec",
|
|
2558
|
-
options:
|
|
2559
|
-
callback:
|
|
2955
|
+
options: ECKeyPairOptions<"pem", "pem">,
|
|
2956
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2957
|
+
): void;
|
|
2958
|
+
function generateKeyPair(
|
|
2959
|
+
type: "ec",
|
|
2960
|
+
options: ECKeyPairOptions<"pem", "der">,
|
|
2961
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2962
|
+
): void;
|
|
2963
|
+
function generateKeyPair(
|
|
2964
|
+
type: "ec",
|
|
2965
|
+
options: ECKeyPairOptions<"der", "pem">,
|
|
2966
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2967
|
+
): void;
|
|
2968
|
+
function generateKeyPair(
|
|
2969
|
+
type: "ec",
|
|
2970
|
+
options: ECKeyPairOptions<"der", "der">,
|
|
2971
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2972
|
+
): void;
|
|
2973
|
+
function generateKeyPair(
|
|
2974
|
+
type: "ec",
|
|
2975
|
+
options: ECKeyPairKeyObjectOptions,
|
|
2976
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
2560
2977
|
): void;
|
|
2561
2978
|
function generateKeyPair(
|
|
2562
2979
|
type: "ed25519",
|
|
2563
|
-
|
|
2980
|
+
options: ED25519KeyPairOptions<"pem", "pem">,
|
|
2981
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2564
2982
|
): void;
|
|
2565
|
-
function generateKeyPair
|
|
2983
|
+
function generateKeyPair(
|
|
2566
2984
|
type: "ed25519",
|
|
2567
|
-
options:
|
|
2568
|
-
callback:
|
|
2985
|
+
options: ED25519KeyPairOptions<"pem", "der">,
|
|
2986
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2569
2987
|
): void;
|
|
2570
2988
|
function generateKeyPair(
|
|
2571
|
-
type: "
|
|
2572
|
-
|
|
2989
|
+
type: "ed25519",
|
|
2990
|
+
options: ED25519KeyPairOptions<"der", "pem">,
|
|
2991
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2573
2992
|
): void;
|
|
2574
|
-
function generateKeyPair
|
|
2575
|
-
type: "
|
|
2576
|
-
options:
|
|
2577
|
-
callback:
|
|
2993
|
+
function generateKeyPair(
|
|
2994
|
+
type: "ed25519",
|
|
2995
|
+
options: ED25519KeyPairOptions<"der", "der">,
|
|
2996
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2578
2997
|
): void;
|
|
2579
2998
|
function generateKeyPair(
|
|
2580
|
-
type:
|
|
2581
|
-
|
|
2999
|
+
type: "ed25519",
|
|
3000
|
+
options: ED25519KeyPairKeyObjectOptions | undefined,
|
|
3001
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
2582
3002
|
): void;
|
|
2583
|
-
function generateKeyPair
|
|
2584
|
-
type:
|
|
2585
|
-
options:
|
|
2586
|
-
callback:
|
|
3003
|
+
function generateKeyPair(
|
|
3004
|
+
type: "ed448",
|
|
3005
|
+
options: ED448KeyPairOptions<"pem", "pem">,
|
|
3006
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2587
3007
|
): void;
|
|
2588
3008
|
function generateKeyPair(
|
|
2589
|
-
type:
|
|
2590
|
-
|
|
3009
|
+
type: "ed448",
|
|
3010
|
+
options: ED448KeyPairOptions<"pem", "der">,
|
|
3011
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2591
3012
|
): void;
|
|
2592
|
-
function generateKeyPair
|
|
2593
|
-
type:
|
|
2594
|
-
options:
|
|
2595
|
-
callback:
|
|
3013
|
+
function generateKeyPair(
|
|
3014
|
+
type: "ed448",
|
|
3015
|
+
options: ED448KeyPairOptions<"der", "pem">,
|
|
3016
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2596
3017
|
): void;
|
|
2597
|
-
function generateKeyPair
|
|
2598
|
-
type: "
|
|
2599
|
-
options:
|
|
2600
|
-
callback:
|
|
3018
|
+
function generateKeyPair(
|
|
3019
|
+
type: "ed448",
|
|
3020
|
+
options: ED448KeyPairOptions<"der", "der">,
|
|
3021
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2601
3022
|
): void;
|
|
2602
|
-
function generateKeyPair
|
|
2603
|
-
type: "
|
|
2604
|
-
options:
|
|
2605
|
-
callback:
|
|
3023
|
+
function generateKeyPair(
|
|
3024
|
+
type: "ed448",
|
|
3025
|
+
options: ED448KeyPairKeyObjectOptions | undefined,
|
|
3026
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
2606
3027
|
): void;
|
|
2607
3028
|
function generateKeyPair(
|
|
2608
|
-
type:
|
|
2609
|
-
|
|
3029
|
+
type: "x25519",
|
|
3030
|
+
options: X25519KeyPairOptions<"pem", "pem">,
|
|
3031
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2610
3032
|
): void;
|
|
2611
|
-
function generateKeyPair
|
|
2612
|
-
type:
|
|
2613
|
-
options:
|
|
2614
|
-
callback:
|
|
3033
|
+
function generateKeyPair(
|
|
3034
|
+
type: "x25519",
|
|
3035
|
+
options: X25519KeyPairOptions<"pem", "der">,
|
|
3036
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2615
3037
|
): void;
|
|
2616
3038
|
function generateKeyPair(
|
|
2617
3039
|
type: "x25519",
|
|
2618
|
-
|
|
3040
|
+
options: X25519KeyPairOptions<"der", "pem">,
|
|
3041
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2619
3042
|
): void;
|
|
2620
|
-
function generateKeyPair
|
|
3043
|
+
function generateKeyPair(
|
|
3044
|
+
type: "x25519",
|
|
3045
|
+
options: X25519KeyPairOptions<"der", "der">,
|
|
3046
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3047
|
+
): void;
|
|
3048
|
+
function generateKeyPair(
|
|
2621
3049
|
type: "x25519",
|
|
2622
|
-
options:
|
|
2623
|
-
callback:
|
|
3050
|
+
options: X25519KeyPairKeyObjectOptions | undefined,
|
|
3051
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3052
|
+
): void;
|
|
3053
|
+
function generateKeyPair(
|
|
3054
|
+
type: "x448",
|
|
3055
|
+
options: X448KeyPairOptions<"pem", "pem">,
|
|
3056
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
2624
3057
|
): void;
|
|
2625
3058
|
function generateKeyPair(
|
|
2626
3059
|
type: "x448",
|
|
2627
|
-
|
|
3060
|
+
options: X448KeyPairOptions<"pem", "der">,
|
|
3061
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2628
3062
|
): void;
|
|
2629
|
-
function generateKeyPair
|
|
3063
|
+
function generateKeyPair(
|
|
2630
3064
|
type: "x448",
|
|
2631
|
-
options:
|
|
2632
|
-
callback:
|
|
3065
|
+
options: X448KeyPairOptions<"der", "pem">,
|
|
3066
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3067
|
+
): void;
|
|
3068
|
+
function generateKeyPair(
|
|
3069
|
+
type: "x448",
|
|
3070
|
+
options: X448KeyPairOptions<"der", "der">,
|
|
3071
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3072
|
+
): void;
|
|
3073
|
+
function generateKeyPair(
|
|
3074
|
+
type: "x448",
|
|
3075
|
+
options: X448KeyPairKeyObjectOptions | undefined,
|
|
3076
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
2633
3077
|
): void;
|
|
2634
3078
|
namespace generateKeyPair {
|
|
2635
|
-
function __promisify__
|
|
2636
|
-
type: "
|
|
2637
|
-
options:
|
|
2638
|
-
): Promise<
|
|
2639
|
-
|
|
3079
|
+
function __promisify__(
|
|
3080
|
+
type: "rsa",
|
|
3081
|
+
options: RSAKeyPairOptions<"pem", "pem">,
|
|
3082
|
+
): Promise<{
|
|
3083
|
+
publicKey: string;
|
|
3084
|
+
privateKey: string;
|
|
3085
|
+
}>;
|
|
3086
|
+
function __promisify__(
|
|
3087
|
+
type: "rsa",
|
|
3088
|
+
options: RSAKeyPairOptions<"pem", "der">,
|
|
3089
|
+
): Promise<{
|
|
3090
|
+
publicKey: string;
|
|
3091
|
+
privateKey: NonSharedBuffer;
|
|
3092
|
+
}>;
|
|
3093
|
+
function __promisify__(
|
|
3094
|
+
type: "rsa",
|
|
3095
|
+
options: RSAKeyPairOptions<"der", "pem">,
|
|
3096
|
+
): Promise<{
|
|
3097
|
+
publicKey: NonSharedBuffer;
|
|
3098
|
+
privateKey: string;
|
|
3099
|
+
}>;
|
|
3100
|
+
function __promisify__(
|
|
3101
|
+
type: "rsa",
|
|
3102
|
+
options: RSAKeyPairOptions<"der", "der">,
|
|
3103
|
+
): Promise<{
|
|
3104
|
+
publicKey: NonSharedBuffer;
|
|
3105
|
+
privateKey: NonSharedBuffer;
|
|
3106
|
+
}>;
|
|
3107
|
+
function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3108
|
+
function __promisify__(
|
|
3109
|
+
type: "rsa-pss",
|
|
3110
|
+
options: RSAPSSKeyPairOptions<"pem", "pem">,
|
|
3111
|
+
): Promise<{
|
|
3112
|
+
publicKey: string;
|
|
3113
|
+
privateKey: string;
|
|
3114
|
+
}>;
|
|
3115
|
+
function __promisify__(
|
|
3116
|
+
type: "rsa-pss",
|
|
3117
|
+
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
3118
|
+
): Promise<{
|
|
3119
|
+
publicKey: string;
|
|
3120
|
+
privateKey: NonSharedBuffer;
|
|
3121
|
+
}>;
|
|
3122
|
+
function __promisify__(
|
|
3123
|
+
type: "rsa-pss",
|
|
3124
|
+
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
3125
|
+
): Promise<{
|
|
3126
|
+
publicKey: NonSharedBuffer;
|
|
3127
|
+
privateKey: string;
|
|
3128
|
+
}>;
|
|
3129
|
+
function __promisify__(
|
|
3130
|
+
type: "rsa-pss",
|
|
3131
|
+
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
3132
|
+
): Promise<{
|
|
3133
|
+
publicKey: NonSharedBuffer;
|
|
3134
|
+
privateKey: NonSharedBuffer;
|
|
3135
|
+
}>;
|
|
3136
|
+
function __promisify__(
|
|
3137
|
+
type: "rsa-pss",
|
|
3138
|
+
options: RSAPSSKeyPairKeyObjectOptions,
|
|
3139
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3140
|
+
function __promisify__(
|
|
3141
|
+
type: "dsa",
|
|
3142
|
+
options: DSAKeyPairOptions<"pem", "pem">,
|
|
3143
|
+
): Promise<{
|
|
3144
|
+
publicKey: string;
|
|
3145
|
+
privateKey: string;
|
|
3146
|
+
}>;
|
|
3147
|
+
function __promisify__(
|
|
3148
|
+
type: "dsa",
|
|
3149
|
+
options: DSAKeyPairOptions<"pem", "der">,
|
|
3150
|
+
): Promise<{
|
|
3151
|
+
publicKey: string;
|
|
3152
|
+
privateKey: NonSharedBuffer;
|
|
3153
|
+
}>;
|
|
3154
|
+
function __promisify__(
|
|
3155
|
+
type: "dsa",
|
|
3156
|
+
options: DSAKeyPairOptions<"der", "pem">,
|
|
3157
|
+
): Promise<{
|
|
3158
|
+
publicKey: NonSharedBuffer;
|
|
3159
|
+
privateKey: string;
|
|
3160
|
+
}>;
|
|
3161
|
+
function __promisify__(
|
|
2640
3162
|
type: "dsa",
|
|
2641
|
-
options:
|
|
2642
|
-
): Promise<
|
|
2643
|
-
|
|
3163
|
+
options: DSAKeyPairOptions<"der", "der">,
|
|
3164
|
+
): Promise<{
|
|
3165
|
+
publicKey: NonSharedBuffer;
|
|
3166
|
+
privateKey: NonSharedBuffer;
|
|
3167
|
+
}>;
|
|
3168
|
+
function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3169
|
+
function __promisify__(
|
|
2644
3170
|
type: "ec",
|
|
2645
|
-
options:
|
|
2646
|
-
): Promise<
|
|
2647
|
-
|
|
3171
|
+
options: ECKeyPairOptions<"pem", "pem">,
|
|
3172
|
+
): Promise<{
|
|
3173
|
+
publicKey: string;
|
|
3174
|
+
privateKey: string;
|
|
3175
|
+
}>;
|
|
3176
|
+
function __promisify__(
|
|
3177
|
+
type: "ec",
|
|
3178
|
+
options: ECKeyPairOptions<"pem", "der">,
|
|
3179
|
+
): Promise<{
|
|
3180
|
+
publicKey: string;
|
|
3181
|
+
privateKey: NonSharedBuffer;
|
|
3182
|
+
}>;
|
|
3183
|
+
function __promisify__(
|
|
3184
|
+
type: "ec",
|
|
3185
|
+
options: ECKeyPairOptions<"der", "pem">,
|
|
3186
|
+
): Promise<{
|
|
3187
|
+
publicKey: NonSharedBuffer;
|
|
3188
|
+
privateKey: string;
|
|
3189
|
+
}>;
|
|
3190
|
+
function __promisify__(
|
|
3191
|
+
type: "ec",
|
|
3192
|
+
options: ECKeyPairOptions<"der", "der">,
|
|
3193
|
+
): Promise<{
|
|
3194
|
+
publicKey: NonSharedBuffer;
|
|
3195
|
+
privateKey: NonSharedBuffer;
|
|
3196
|
+
}>;
|
|
3197
|
+
function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3198
|
+
function __promisify__(
|
|
3199
|
+
type: "ed25519",
|
|
3200
|
+
options: ED25519KeyPairOptions<"pem", "pem">,
|
|
3201
|
+
): Promise<{
|
|
3202
|
+
publicKey: string;
|
|
3203
|
+
privateKey: string;
|
|
3204
|
+
}>;
|
|
3205
|
+
function __promisify__(
|
|
3206
|
+
type: "ed25519",
|
|
3207
|
+
options: ED25519KeyPairOptions<"pem", "der">,
|
|
3208
|
+
): Promise<{
|
|
3209
|
+
publicKey: string;
|
|
3210
|
+
privateKey: NonSharedBuffer;
|
|
3211
|
+
}>;
|
|
3212
|
+
function __promisify__(
|
|
3213
|
+
type: "ed25519",
|
|
3214
|
+
options: ED25519KeyPairOptions<"der", "pem">,
|
|
3215
|
+
): Promise<{
|
|
3216
|
+
publicKey: NonSharedBuffer;
|
|
3217
|
+
privateKey: string;
|
|
3218
|
+
}>;
|
|
3219
|
+
function __promisify__(
|
|
2648
3220
|
type: "ed25519",
|
|
2649
|
-
options
|
|
2650
|
-
): Promise<
|
|
2651
|
-
|
|
3221
|
+
options: ED25519KeyPairOptions<"der", "der">,
|
|
3222
|
+
): Promise<{
|
|
3223
|
+
publicKey: NonSharedBuffer;
|
|
3224
|
+
privateKey: NonSharedBuffer;
|
|
3225
|
+
}>;
|
|
3226
|
+
function __promisify__(
|
|
3227
|
+
type: "ed25519",
|
|
3228
|
+
options?: ED25519KeyPairKeyObjectOptions,
|
|
3229
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3230
|
+
function __promisify__(
|
|
2652
3231
|
type: "ed448",
|
|
2653
|
-
options
|
|
2654
|
-
): Promise<
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
3232
|
+
options: ED448KeyPairOptions<"pem", "pem">,
|
|
3233
|
+
): Promise<{
|
|
3234
|
+
publicKey: string;
|
|
3235
|
+
privateKey: string;
|
|
3236
|
+
}>;
|
|
3237
|
+
function __promisify__(
|
|
3238
|
+
type: "ed448",
|
|
3239
|
+
options: ED448KeyPairOptions<"pem", "der">,
|
|
3240
|
+
): Promise<{
|
|
3241
|
+
publicKey: string;
|
|
3242
|
+
privateKey: NonSharedBuffer;
|
|
3243
|
+
}>;
|
|
3244
|
+
function __promisify__(
|
|
3245
|
+
type: "ed448",
|
|
3246
|
+
options: ED448KeyPairOptions<"der", "pem">,
|
|
3247
|
+
): Promise<{
|
|
3248
|
+
publicKey: NonSharedBuffer;
|
|
3249
|
+
privateKey: string;
|
|
3250
|
+
}>;
|
|
3251
|
+
function __promisify__(
|
|
3252
|
+
type: "ed448",
|
|
3253
|
+
options: ED448KeyPairOptions<"der", "der">,
|
|
3254
|
+
): Promise<{
|
|
3255
|
+
publicKey: NonSharedBuffer;
|
|
3256
|
+
privateKey: NonSharedBuffer;
|
|
3257
|
+
}>;
|
|
3258
|
+
function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3259
|
+
function __promisify__(
|
|
2676
3260
|
type: "x25519",
|
|
2677
|
-
options
|
|
2678
|
-
): Promise<
|
|
2679
|
-
|
|
3261
|
+
options: X25519KeyPairOptions<"pem", "pem">,
|
|
3262
|
+
): Promise<{
|
|
3263
|
+
publicKey: string;
|
|
3264
|
+
privateKey: string;
|
|
3265
|
+
}>;
|
|
3266
|
+
function __promisify__(
|
|
3267
|
+
type: "x25519",
|
|
3268
|
+
options: X25519KeyPairOptions<"pem", "der">,
|
|
3269
|
+
): Promise<{
|
|
3270
|
+
publicKey: string;
|
|
3271
|
+
privateKey: NonSharedBuffer;
|
|
3272
|
+
}>;
|
|
3273
|
+
function __promisify__(
|
|
3274
|
+
type: "x25519",
|
|
3275
|
+
options: X25519KeyPairOptions<"der", "pem">,
|
|
3276
|
+
): Promise<{
|
|
3277
|
+
publicKey: NonSharedBuffer;
|
|
3278
|
+
privateKey: string;
|
|
3279
|
+
}>;
|
|
3280
|
+
function __promisify__(
|
|
3281
|
+
type: "x25519",
|
|
3282
|
+
options: X25519KeyPairOptions<"der", "der">,
|
|
3283
|
+
): Promise<{
|
|
3284
|
+
publicKey: NonSharedBuffer;
|
|
3285
|
+
privateKey: NonSharedBuffer;
|
|
3286
|
+
}>;
|
|
3287
|
+
function __promisify__(
|
|
3288
|
+
type: "x25519",
|
|
3289
|
+
options?: X25519KeyPairKeyObjectOptions,
|
|
3290
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3291
|
+
function __promisify__(
|
|
3292
|
+
type: "x448",
|
|
3293
|
+
options: X448KeyPairOptions<"pem", "pem">,
|
|
3294
|
+
): Promise<{
|
|
3295
|
+
publicKey: string;
|
|
3296
|
+
privateKey: string;
|
|
3297
|
+
}>;
|
|
3298
|
+
function __promisify__(
|
|
3299
|
+
type: "x448",
|
|
3300
|
+
options: X448KeyPairOptions<"pem", "der">,
|
|
3301
|
+
): Promise<{
|
|
3302
|
+
publicKey: string;
|
|
3303
|
+
privateKey: NonSharedBuffer;
|
|
3304
|
+
}>;
|
|
3305
|
+
function __promisify__(
|
|
2680
3306
|
type: "x448",
|
|
2681
|
-
options
|
|
2682
|
-
): Promise<
|
|
3307
|
+
options: X448KeyPairOptions<"der", "pem">,
|
|
3308
|
+
): Promise<{
|
|
3309
|
+
publicKey: NonSharedBuffer;
|
|
3310
|
+
privateKey: string;
|
|
3311
|
+
}>;
|
|
3312
|
+
function __promisify__(
|
|
3313
|
+
type: "x448",
|
|
3314
|
+
options: X448KeyPairOptions<"der", "der">,
|
|
3315
|
+
): Promise<{
|
|
3316
|
+
publicKey: NonSharedBuffer;
|
|
3317
|
+
privateKey: NonSharedBuffer;
|
|
3318
|
+
}>;
|
|
3319
|
+
function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
2683
3320
|
}
|
|
2684
3321
|
/**
|
|
2685
3322
|
* Calculates and returns the signature for `data` using the given private key and
|
|
2686
3323
|
* algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
|
|
2687
|
-
* dependent upon the key type.
|
|
2688
|
-
*
|
|
2689
|
-
* `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and
|
|
2690
|
-
* ML-DSA.
|
|
3324
|
+
* dependent upon the key type (especially Ed25519 and Ed448).
|
|
2691
3325
|
*
|
|
2692
3326
|
* If `key` is not a `KeyObject`, this function behaves as if `key` had been
|
|
2693
3327
|
* passed to {@link createPrivateKey}. If it is an object, the following
|
|
@@ -2698,22 +3332,18 @@ declare module "node:crypto" {
|
|
|
2698
3332
|
*/
|
|
2699
3333
|
function sign(
|
|
2700
3334
|
algorithm: string | null | undefined,
|
|
2701
|
-
data:
|
|
3335
|
+
data: NodeJS.ArrayBufferView,
|
|
2702
3336
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
2703
3337
|
): NonSharedBuffer;
|
|
2704
3338
|
function sign(
|
|
2705
3339
|
algorithm: string | null | undefined,
|
|
2706
|
-
data:
|
|
3340
|
+
data: NodeJS.ArrayBufferView,
|
|
2707
3341
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
2708
3342
|
callback: (error: Error | null, data: NonSharedBuffer) => void,
|
|
2709
3343
|
): void;
|
|
2710
3344
|
/**
|
|
2711
|
-
* Verifies the given signature for `data` using the given key and algorithm. If
|
|
2712
|
-
*
|
|
2713
|
-
* key type.
|
|
2714
|
-
*
|
|
2715
|
-
* `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and
|
|
2716
|
-
* ML-DSA.
|
|
3345
|
+
* Verifies the given signature for `data` using the given key and algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the
|
|
3346
|
+
* key type (especially Ed25519 and Ed448).
|
|
2717
3347
|
*
|
|
2718
3348
|
* If `key` is not a `KeyObject`, this function behaves as if `key` had been
|
|
2719
3349
|
* passed to {@link createPublicKey}. If it is an object, the following
|
|
@@ -2729,118 +3359,28 @@ declare module "node:crypto" {
|
|
|
2729
3359
|
*/
|
|
2730
3360
|
function verify(
|
|
2731
3361
|
algorithm: string | null | undefined,
|
|
2732
|
-
data:
|
|
3362
|
+
data: NodeJS.ArrayBufferView,
|
|
2733
3363
|
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
2734
|
-
signature:
|
|
3364
|
+
signature: NodeJS.ArrayBufferView,
|
|
2735
3365
|
): boolean;
|
|
2736
3366
|
function verify(
|
|
2737
3367
|
algorithm: string | null | undefined,
|
|
2738
|
-
data:
|
|
3368
|
+
data: NodeJS.ArrayBufferView,
|
|
2739
3369
|
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
2740
|
-
signature:
|
|
3370
|
+
signature: NodeJS.ArrayBufferView,
|
|
2741
3371
|
callback: (error: Error | null, result: boolean) => void,
|
|
2742
3372
|
): void;
|
|
2743
3373
|
/**
|
|
2744
|
-
*
|
|
2745
|
-
*
|
|
2746
|
-
* Supported key types and their KEM algorithms are:
|
|
2747
|
-
*
|
|
2748
|
-
* * `'rsa'` RSA Secret Value Encapsulation
|
|
2749
|
-
* * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
|
|
2750
|
-
* * `'x25519'` DHKEM(X25519, HKDF-SHA256)
|
|
2751
|
-
* * `'x448'` DHKEM(X448, HKDF-SHA512)
|
|
2752
|
-
* * `'ml-kem-512'` ML-KEM
|
|
2753
|
-
* * `'ml-kem-768'` ML-KEM
|
|
2754
|
-
* * `'ml-kem-1024'` ML-KEM
|
|
2755
|
-
*
|
|
2756
|
-
* If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
|
|
2757
|
-
* passed to `crypto.createPrivateKey()`.
|
|
2758
|
-
*
|
|
2759
|
-
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
2760
|
-
* @since v24.7.0
|
|
2761
|
-
*/
|
|
2762
|
-
function decapsulate(
|
|
2763
|
-
key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
|
|
2764
|
-
ciphertext: ArrayBufferLike | NodeJS.ArrayBufferView,
|
|
2765
|
-
): NonSharedBuffer;
|
|
2766
|
-
function decapsulate(
|
|
2767
|
-
key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
|
|
2768
|
-
ciphertext: ArrayBufferLike | NodeJS.ArrayBufferView,
|
|
2769
|
-
callback: (err: Error, sharedKey: NonSharedBuffer) => void,
|
|
2770
|
-
): void;
|
|
2771
|
-
interface DiffieHellmanOptions {
|
|
2772
|
-
privateKey: KeyLike | PrivateKeyInput;
|
|
2773
|
-
publicKey: KeyLike | PublicKeyInput;
|
|
2774
|
-
}
|
|
2775
|
-
/**
|
|
2776
|
-
* Computes the Diffie-Hellman shared secret based on a `privateKey` and a `publicKey`.
|
|
2777
|
-
* Both keys must have the same `asymmetricKeyType` and must support either the DH or
|
|
2778
|
-
* ECDH operation.
|
|
2779
|
-
*
|
|
2780
|
-
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3374
|
+
* Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
|
|
3375
|
+
* Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES).
|
|
2781
3376
|
* @since v13.9.0, v12.17.0
|
|
2782
3377
|
*/
|
|
2783
|
-
function diffieHellman(options:
|
|
2784
|
-
function diffieHellman(
|
|
2785
|
-
options: DiffieHellmanOptions,
|
|
2786
|
-
callback: (err: Error | null, secret: NonSharedBuffer) => void,
|
|
2787
|
-
): void;
|
|
2788
|
-
/**
|
|
2789
|
-
* Key encapsulation using a KEM algorithm with a public key.
|
|
2790
|
-
*
|
|
2791
|
-
* Supported key types and their KEM algorithms are:
|
|
2792
|
-
*
|
|
2793
|
-
* * `'rsa'` RSA Secret Value Encapsulation
|
|
2794
|
-
* * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
|
|
2795
|
-
* * `'x25519'` DHKEM(X25519, HKDF-SHA256)
|
|
2796
|
-
* * `'x448'` DHKEM(X448, HKDF-SHA512)
|
|
2797
|
-
* * `'ml-kem-512'` ML-KEM
|
|
2798
|
-
* * `'ml-kem-768'` ML-KEM
|
|
2799
|
-
* * `'ml-kem-1024'` ML-KEM
|
|
2800
|
-
*
|
|
2801
|
-
* If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
|
|
2802
|
-
* passed to `crypto.createPublicKey()`.
|
|
2803
|
-
*
|
|
2804
|
-
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
2805
|
-
* @since v24.7.0
|
|
2806
|
-
*/
|
|
2807
|
-
function encapsulate(
|
|
2808
|
-
key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
|
|
2809
|
-
): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer };
|
|
2810
|
-
function encapsulate(
|
|
2811
|
-
key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
|
|
2812
|
-
callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void,
|
|
2813
|
-
): void;
|
|
2814
|
-
interface OneShotDigestOptions {
|
|
2815
|
-
/**
|
|
2816
|
-
* Encoding used to encode the returned digest.
|
|
2817
|
-
* @default 'hex'
|
|
2818
|
-
*/
|
|
2819
|
-
outputEncoding?: BufferEncoding | "buffer" | undefined;
|
|
2820
|
-
/**
|
|
2821
|
-
* For XOF hash functions such as 'shake256', the outputLength option
|
|
2822
|
-
* can be used to specify the desired output length in bytes.
|
|
2823
|
-
*/
|
|
2824
|
-
outputLength?: number | undefined;
|
|
2825
|
-
}
|
|
2826
|
-
interface OneShotDigestOptionsWithStringEncoding extends OneShotDigestOptions {
|
|
2827
|
-
outputEncoding?: BufferEncoding | undefined;
|
|
2828
|
-
}
|
|
2829
|
-
interface OneShotDigestOptionsWithBufferEncoding extends OneShotDigestOptions {
|
|
2830
|
-
outputEncoding: "buffer";
|
|
2831
|
-
}
|
|
3378
|
+
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
|
|
2832
3379
|
/**
|
|
2833
|
-
* A utility for creating one-shot hash digests of data. It can be faster than
|
|
2834
|
-
* the
|
|
2835
|
-
*
|
|
2836
|
-
*
|
|
2837
|
-
*
|
|
2838
|
-
* The `algorithm` is dependent on the available algorithms supported by the
|
|
2839
|
-
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
2840
|
-
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
2841
|
-
* display the available digest algorithms.
|
|
2842
|
-
*
|
|
2843
|
-
* If `options` is a string, then it specifies the `outputEncoding`.
|
|
3380
|
+
* A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data
|
|
3381
|
+
* (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm`
|
|
3382
|
+
* is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. On recent releases
|
|
3383
|
+
* of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms.
|
|
2844
3384
|
*
|
|
2845
3385
|
* Example:
|
|
2846
3386
|
*
|
|
@@ -2860,25 +3400,16 @@ declare module "node:crypto" {
|
|
|
2860
3400
|
* console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));
|
|
2861
3401
|
* ```
|
|
2862
3402
|
* @since v21.7.0, v20.12.0
|
|
2863
|
-
* @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different
|
|
2864
|
-
*
|
|
2865
|
-
*
|
|
2866
|
-
* the encoded `TypedArray` into this API instead.
|
|
3403
|
+
* @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user
|
|
3404
|
+
* could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead.
|
|
3405
|
+
* @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v22.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest.
|
|
2867
3406
|
*/
|
|
3407
|
+
function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string;
|
|
3408
|
+
function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): NonSharedBuffer;
|
|
2868
3409
|
function hash(
|
|
2869
3410
|
algorithm: string,
|
|
2870
3411
|
data: BinaryLike,
|
|
2871
|
-
|
|
2872
|
-
): string;
|
|
2873
|
-
function hash(
|
|
2874
|
-
algorithm: string,
|
|
2875
|
-
data: BinaryLike,
|
|
2876
|
-
options: OneShotDigestOptionsWithBufferEncoding | "buffer",
|
|
2877
|
-
): NonSharedBuffer;
|
|
2878
|
-
function hash(
|
|
2879
|
-
algorithm: string,
|
|
2880
|
-
data: BinaryLike,
|
|
2881
|
-
options: OneShotDigestOptions | BufferEncoding | "buffer",
|
|
3412
|
+
outputEncoding?: BinaryToTextEncoding | "buffer",
|
|
2882
3413
|
): string | NonSharedBuffer;
|
|
2883
3414
|
type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
|
|
2884
3415
|
interface CipherInfoOptions {
|
|
@@ -2892,11 +3423,31 @@ declare module "node:crypto" {
|
|
|
2892
3423
|
ivLength?: number | undefined;
|
|
2893
3424
|
}
|
|
2894
3425
|
interface CipherInfo {
|
|
3426
|
+
/**
|
|
3427
|
+
* The name of the cipher.
|
|
3428
|
+
*/
|
|
2895
3429
|
name: string;
|
|
3430
|
+
/**
|
|
3431
|
+
* The nid of the cipher.
|
|
3432
|
+
*/
|
|
2896
3433
|
nid: number;
|
|
2897
|
-
|
|
2898
|
-
|
|
3434
|
+
/**
|
|
3435
|
+
* The block size of the cipher in bytes.
|
|
3436
|
+
* This property is omitted when mode is 'stream'.
|
|
3437
|
+
*/
|
|
3438
|
+
blockSize?: number | undefined;
|
|
3439
|
+
/**
|
|
3440
|
+
* The expected or default initialization vector length in bytes.
|
|
3441
|
+
* This property is omitted if the cipher does not use an initialization vector.
|
|
3442
|
+
*/
|
|
3443
|
+
ivLength?: number | undefined;
|
|
3444
|
+
/**
|
|
3445
|
+
* The expected or default key length in bytes.
|
|
3446
|
+
*/
|
|
2899
3447
|
keyLength: number;
|
|
3448
|
+
/**
|
|
3449
|
+
* The cipher mode.
|
|
3450
|
+
*/
|
|
2900
3451
|
mode: CipherMode;
|
|
2901
3452
|
}
|
|
2902
3453
|
/**
|
|
@@ -2940,7 +3491,7 @@ declare module "node:crypto" {
|
|
|
2940
3491
|
*/
|
|
2941
3492
|
function hkdf(
|
|
2942
3493
|
digest: string,
|
|
2943
|
-
|
|
3494
|
+
irm: BinaryLike | KeyObject,
|
|
2944
3495
|
salt: BinaryLike,
|
|
2945
3496
|
info: BinaryLike,
|
|
2946
3497
|
keylen: number,
|
|
@@ -2974,15 +3525,27 @@ declare module "node:crypto" {
|
|
|
2974
3525
|
*/
|
|
2975
3526
|
function hkdfSync(
|
|
2976
3527
|
digest: string,
|
|
2977
|
-
ikm:
|
|
3528
|
+
ikm: BinaryLike | KeyObject,
|
|
2978
3529
|
salt: BinaryLike,
|
|
2979
3530
|
info: BinaryLike,
|
|
2980
3531
|
keylen: number,
|
|
2981
3532
|
): ArrayBuffer;
|
|
2982
3533
|
interface SecureHeapUsage {
|
|
3534
|
+
/**
|
|
3535
|
+
* The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag.
|
|
3536
|
+
*/
|
|
2983
3537
|
total: number;
|
|
3538
|
+
/**
|
|
3539
|
+
* The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag.
|
|
3540
|
+
*/
|
|
2984
3541
|
min: number;
|
|
3542
|
+
/**
|
|
3543
|
+
* The total number of bytes currently allocated from the secure heap.
|
|
3544
|
+
*/
|
|
2985
3545
|
used: number;
|
|
3546
|
+
/**
|
|
3547
|
+
* The calculated ratio of `used` to `total` allocated bytes.
|
|
3548
|
+
*/
|
|
2986
3549
|
utilization: number;
|
|
2987
3550
|
}
|
|
2988
3551
|
/**
|
|
@@ -2995,11 +3558,11 @@ declare module "node:crypto" {
|
|
|
2995
3558
|
* Node.js will pre-emptively generate and persistently cache enough
|
|
2996
3559
|
* random data to generate up to 128 random UUIDs. To generate a UUID
|
|
2997
3560
|
* without using the cache, set `disableEntropyCache` to `true`.
|
|
3561
|
+
*
|
|
2998
3562
|
* @default `false`
|
|
2999
3563
|
*/
|
|
3000
3564
|
disableEntropyCache?: boolean | undefined;
|
|
3001
3565
|
}
|
|
3002
|
-
interface RandomUUIDV7Options extends RandomUUIDOptions {}
|
|
3003
3566
|
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
3004
3567
|
/**
|
|
3005
3568
|
* Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
|
|
@@ -3007,21 +3570,26 @@ declare module "node:crypto" {
|
|
|
3007
3570
|
* @since v15.6.0, v14.17.0
|
|
3008
3571
|
*/
|
|
3009
3572
|
function randomUUID(options?: RandomUUIDOptions): UUID;
|
|
3010
|
-
/**
|
|
3011
|
-
* Generates a random [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.txt) version 7 UUID. The UUID contains a millisecond
|
|
3012
|
-
* precision Unix timestamp in the most significant 48 bits, followed by
|
|
3013
|
-
* cryptographically secure random bits for the remaining fields, making it
|
|
3014
|
-
* suitable for use as a database key with time-based sorting. The embedded
|
|
3015
|
-
* timestamp relies on a non-monotonic clock and is not guaranteed to be strictly
|
|
3016
|
-
* increasing.
|
|
3017
|
-
* @since v26.1.0
|
|
3018
|
-
*/
|
|
3019
|
-
function randomUUIDv7(options?: RandomUUIDV7Options): UUID;
|
|
3020
3573
|
interface X509CheckOptions {
|
|
3574
|
+
/**
|
|
3575
|
+
* @default 'always'
|
|
3576
|
+
*/
|
|
3021
3577
|
subject?: "always" | "default" | "never" | undefined;
|
|
3578
|
+
/**
|
|
3579
|
+
* @default true
|
|
3580
|
+
*/
|
|
3022
3581
|
wildcards?: boolean | undefined;
|
|
3582
|
+
/**
|
|
3583
|
+
* @default true
|
|
3584
|
+
*/
|
|
3023
3585
|
partialWildcards?: boolean | undefined;
|
|
3586
|
+
/**
|
|
3587
|
+
* @default false
|
|
3588
|
+
*/
|
|
3024
3589
|
multiLabelWildcards?: boolean | undefined;
|
|
3590
|
+
/**
|
|
3591
|
+
* @default false
|
|
3592
|
+
*/
|
|
3025
3593
|
singleLabelSubdomains?: boolean | undefined;
|
|
3026
3594
|
}
|
|
3027
3595
|
/**
|
|
@@ -3144,16 +3712,6 @@ declare module "node:crypto" {
|
|
|
3144
3712
|
* @since v15.6.0
|
|
3145
3713
|
*/
|
|
3146
3714
|
readonly serialNumber: string;
|
|
3147
|
-
/**
|
|
3148
|
-
* The algorithm used to sign the certificate or `undefined` if the signature algorithm is unknown by OpenSSL.
|
|
3149
|
-
* @since v24.9.0
|
|
3150
|
-
*/
|
|
3151
|
-
readonly signatureAlgorithm: string | undefined;
|
|
3152
|
-
/**
|
|
3153
|
-
* The OID of the algorithm used to sign the certificate.
|
|
3154
|
-
* @since v24.9.0
|
|
3155
|
-
*/
|
|
3156
|
-
readonly signatureAlgorithmOid: string;
|
|
3157
3715
|
/**
|
|
3158
3716
|
* The date/time from which this certificate is considered valid.
|
|
3159
3717
|
* @since v15.6.0
|
|
@@ -3174,7 +3732,7 @@ declare module "node:crypto" {
|
|
|
3174
3732
|
* @since v22.10.0
|
|
3175
3733
|
*/
|
|
3176
3734
|
readonly validToDate: Date;
|
|
3177
|
-
constructor(buffer:
|
|
3735
|
+
constructor(buffer: BinaryLike);
|
|
3178
3736
|
/**
|
|
3179
3737
|
* Checks whether the certificate matches the given email address.
|
|
3180
3738
|
*
|
|
@@ -3277,10 +3835,13 @@ declare module "node:crypto" {
|
|
|
3277
3835
|
*/
|
|
3278
3836
|
verify(publicKey: KeyObject): boolean;
|
|
3279
3837
|
}
|
|
3280
|
-
type LargeNumberLike =
|
|
3838
|
+
type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint;
|
|
3281
3839
|
interface GeneratePrimeOptions {
|
|
3282
3840
|
add?: LargeNumberLike | undefined;
|
|
3283
3841
|
rem?: LargeNumberLike | undefined;
|
|
3842
|
+
/**
|
|
3843
|
+
* @default false
|
|
3844
|
+
*/
|
|
3284
3845
|
safe?: boolean | undefined;
|
|
3285
3846
|
bigint?: boolean | undefined;
|
|
3286
3847
|
}
|
|
@@ -3320,13 +3881,13 @@ declare module "node:crypto" {
|
|
|
3320
3881
|
function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
|
|
3321
3882
|
function generatePrime(
|
|
3322
3883
|
size: number,
|
|
3323
|
-
options:
|
|
3324
|
-
callback: (err: Error | null, prime:
|
|
3884
|
+
options: GeneratePrimeOptionsBigInt,
|
|
3885
|
+
callback: (err: Error | null, prime: bigint) => void,
|
|
3325
3886
|
): void;
|
|
3326
3887
|
function generatePrime(
|
|
3327
3888
|
size: number,
|
|
3328
|
-
options:
|
|
3329
|
-
callback: (err: Error | null, prime:
|
|
3889
|
+
options: GeneratePrimeOptionsArrayBuffer,
|
|
3890
|
+
callback: (err: Error | null, prime: ArrayBuffer) => void,
|
|
3330
3891
|
): void;
|
|
3331
3892
|
function generatePrime(
|
|
3332
3893
|
size: number,
|
|
@@ -3361,8 +3922,8 @@ declare module "node:crypto" {
|
|
|
3361
3922
|
* @param size The size (in bits) of the prime to generate.
|
|
3362
3923
|
*/
|
|
3363
3924
|
function generatePrimeSync(size: number): ArrayBuffer;
|
|
3364
|
-
function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer;
|
|
3365
3925
|
function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint;
|
|
3926
|
+
function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer;
|
|
3366
3927
|
function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint;
|
|
3367
3928
|
interface CheckPrimeOptions {
|
|
3368
3929
|
/**
|
|
@@ -3370,6 +3931,7 @@ declare module "node:crypto" {
|
|
|
3370
3931
|
* When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input.
|
|
3371
3932
|
* Care must be used when selecting a number of checks.
|
|
3372
3933
|
* Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details.
|
|
3934
|
+
*
|
|
3373
3935
|
* @default 0
|
|
3374
3936
|
*/
|
|
3375
3937
|
checks?: number | undefined;
|
|
@@ -3421,101 +3983,7 @@ declare module "node:crypto" {
|
|
|
3421
3983
|
* @since v17.4.0
|
|
3422
3984
|
* @return Returns `typedArray`.
|
|
3423
3985
|
*/
|
|
3424
|
-
function getRandomValues<
|
|
3425
|
-
T extends Exclude<
|
|
3426
|
-
NodeJS.NonSharedTypedArray,
|
|
3427
|
-
NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array
|
|
3428
|
-
>,
|
|
3429
|
-
>(typedArray: T): T;
|
|
3430
|
-
type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id";
|
|
3431
|
-
interface Argon2Parameters {
|
|
3432
|
-
message: BinaryLike;
|
|
3433
|
-
nonce: BinaryLike;
|
|
3434
|
-
parallelism: number;
|
|
3435
|
-
tagLength: number;
|
|
3436
|
-
memory: number;
|
|
3437
|
-
passes: number;
|
|
3438
|
-
secret?: BinaryLike | undefined;
|
|
3439
|
-
associatedData?: BinaryLike | undefined;
|
|
3440
|
-
}
|
|
3441
|
-
/**
|
|
3442
|
-
* Provides an asynchronous [Argon2](https://www.rfc-editor.org/rfc/rfc9106.html) implementation. Argon2 is a password-based
|
|
3443
|
-
* key derivation function that is designed to be expensive computationally and
|
|
3444
|
-
* memory-wise in order to make brute-force attacks unrewarding.
|
|
3445
|
-
*
|
|
3446
|
-
* The `nonce` should be as unique as possible. It is recommended that a nonce is
|
|
3447
|
-
* random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
|
|
3448
|
-
*
|
|
3449
|
-
* When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
|
|
3450
|
-
* consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v26.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
|
|
3451
|
-
*
|
|
3452
|
-
* The `callback` function is called with two arguments: `err` and `derivedKey`.
|
|
3453
|
-
* `err` is an exception object when key derivation fails, otherwise `err` is
|
|
3454
|
-
* `null`. `derivedKey` is passed to the callback as a `Buffer`.
|
|
3455
|
-
*
|
|
3456
|
-
* An exception is thrown when any of the input arguments specify invalid values
|
|
3457
|
-
* or types.
|
|
3458
|
-
*
|
|
3459
|
-
* ```js
|
|
3460
|
-
* const { argon2, randomBytes } = await import('node:crypto');
|
|
3461
|
-
*
|
|
3462
|
-
* const parameters = {
|
|
3463
|
-
* message: 'password',
|
|
3464
|
-
* nonce: randomBytes(16),
|
|
3465
|
-
* parallelism: 4,
|
|
3466
|
-
* tagLength: 64,
|
|
3467
|
-
* memory: 65536,
|
|
3468
|
-
* passes: 3,
|
|
3469
|
-
* };
|
|
3470
|
-
*
|
|
3471
|
-
* argon2('argon2id', parameters, (err, derivedKey) => {
|
|
3472
|
-
* if (err) throw err;
|
|
3473
|
-
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
3474
|
-
* });
|
|
3475
|
-
* ```
|
|
3476
|
-
* @since v24.7.0
|
|
3477
|
-
* @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
|
|
3478
|
-
*/
|
|
3479
|
-
function argon2(
|
|
3480
|
-
algorithm: Argon2Algorithm,
|
|
3481
|
-
parameters: Argon2Parameters,
|
|
3482
|
-
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
3483
|
-
): void;
|
|
3484
|
-
/**
|
|
3485
|
-
* Provides a synchronous [Argon2][] implementation. Argon2 is a password-based
|
|
3486
|
-
* key derivation function that is designed to be expensive computationally and
|
|
3487
|
-
* memory-wise in order to make brute-force attacks unrewarding.
|
|
3488
|
-
*
|
|
3489
|
-
* The `nonce` should be as unique as possible. It is recommended that a nonce is
|
|
3490
|
-
* random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
|
|
3491
|
-
*
|
|
3492
|
-
* When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
|
|
3493
|
-
* consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v26.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
|
|
3494
|
-
*
|
|
3495
|
-
* An exception is thrown when key derivation fails, otherwise the derived key is
|
|
3496
|
-
* returned as a `Buffer`.
|
|
3497
|
-
*
|
|
3498
|
-
* An exception is thrown when any of the input arguments specify invalid values
|
|
3499
|
-
* or types.
|
|
3500
|
-
*
|
|
3501
|
-
* ```js
|
|
3502
|
-
* const { argon2Sync, randomBytes } = await import('node:crypto');
|
|
3503
|
-
*
|
|
3504
|
-
* const parameters = {
|
|
3505
|
-
* message: 'password',
|
|
3506
|
-
* nonce: randomBytes(16),
|
|
3507
|
-
* parallelism: 4,
|
|
3508
|
-
* tagLength: 64,
|
|
3509
|
-
* memory: 65536,
|
|
3510
|
-
* passes: 3,
|
|
3511
|
-
* };
|
|
3512
|
-
*
|
|
3513
|
-
* const derivedKey = argon2Sync('argon2id', parameters);
|
|
3514
|
-
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
3515
|
-
* ```
|
|
3516
|
-
* @since v24.7.0
|
|
3517
|
-
*/
|
|
3518
|
-
function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
|
|
3986
|
+
function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
|
|
3519
3987
|
/**
|
|
3520
3988
|
* A convenient alias for `crypto.webcrypto.subtle`.
|
|
3521
3989
|
* @since v17.4.0
|
|
@@ -3529,40 +3997,37 @@ declare module "node:crypto" {
|
|
|
3529
3997
|
*/
|
|
3530
3998
|
const webcrypto: webcrypto.Crypto;
|
|
3531
3999
|
namespace webcrypto {
|
|
3532
|
-
type
|
|
3533
|
-
type
|
|
3534
|
-
type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki";
|
|
4000
|
+
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
4001
|
+
type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
|
|
3535
4002
|
type KeyType = "private" | "public" | "secret";
|
|
3536
4003
|
type KeyUsage =
|
|
3537
|
-
| "decapsulateBits"
|
|
3538
|
-
| "decapsulateKey"
|
|
3539
4004
|
| "decrypt"
|
|
3540
4005
|
| "deriveBits"
|
|
3541
4006
|
| "deriveKey"
|
|
3542
|
-
| "encapsulateBits"
|
|
3543
|
-
| "encapsulateKey"
|
|
3544
4007
|
| "encrypt"
|
|
3545
4008
|
| "sign"
|
|
3546
4009
|
| "unwrapKey"
|
|
3547
4010
|
| "verify"
|
|
3548
4011
|
| "wrapKey";
|
|
4012
|
+
type AlgorithmIdentifier = Algorithm | string;
|
|
3549
4013
|
type HashAlgorithmIdentifier = AlgorithmIdentifier;
|
|
3550
4014
|
type NamedCurve = string;
|
|
3551
|
-
|
|
3552
|
-
additionalData?: NodeJS.BufferSource;
|
|
3553
|
-
iv: NodeJS.BufferSource;
|
|
3554
|
-
tagLength: number;
|
|
3555
|
-
}
|
|
4015
|
+
type BigInteger = Uint8Array;
|
|
3556
4016
|
interface AesCbcParams extends Algorithm {
|
|
3557
|
-
iv:
|
|
4017
|
+
iv: BufferSource;
|
|
3558
4018
|
}
|
|
3559
4019
|
interface AesCtrParams extends Algorithm {
|
|
3560
|
-
counter:
|
|
4020
|
+
counter: BufferSource;
|
|
3561
4021
|
length: number;
|
|
3562
4022
|
}
|
|
3563
4023
|
interface AesDerivedKeyParams extends Algorithm {
|
|
3564
4024
|
length: number;
|
|
3565
4025
|
}
|
|
4026
|
+
interface AesGcmParams extends Algorithm {
|
|
4027
|
+
additionalData?: BufferSource;
|
|
4028
|
+
iv: BufferSource;
|
|
4029
|
+
tagLength?: number;
|
|
4030
|
+
}
|
|
3566
4031
|
interface AesKeyAlgorithm extends KeyAlgorithm {
|
|
3567
4032
|
length: number;
|
|
3568
4033
|
}
|
|
@@ -3572,23 +4037,6 @@ declare module "node:crypto" {
|
|
|
3572
4037
|
interface Algorithm {
|
|
3573
4038
|
name: string;
|
|
3574
4039
|
}
|
|
3575
|
-
interface Argon2Params extends Algorithm {
|
|
3576
|
-
associatedData?: NodeJS.BufferSource;
|
|
3577
|
-
memory: number;
|
|
3578
|
-
nonce: NodeJS.BufferSource;
|
|
3579
|
-
parallelism: number;
|
|
3580
|
-
passes: number;
|
|
3581
|
-
secretValue?: NodeJS.BufferSource;
|
|
3582
|
-
version?: number;
|
|
3583
|
-
}
|
|
3584
|
-
interface CShakeParams extends Algorithm {
|
|
3585
|
-
customization?: NodeJS.BufferSource;
|
|
3586
|
-
functionName?: NodeJS.BufferSource;
|
|
3587
|
-
outputLength: number;
|
|
3588
|
-
}
|
|
3589
|
-
interface ContextParams extends Algorithm {
|
|
3590
|
-
context?: NodeJS.BufferSource;
|
|
3591
|
-
}
|
|
3592
4040
|
interface EcKeyAlgorithm extends KeyAlgorithm {
|
|
3593
4041
|
namedCurve: NamedCurve;
|
|
3594
4042
|
}
|
|
@@ -3604,10 +4052,13 @@ declare module "node:crypto" {
|
|
|
3604
4052
|
interface EcdsaParams extends Algorithm {
|
|
3605
4053
|
hash: HashAlgorithmIdentifier;
|
|
3606
4054
|
}
|
|
4055
|
+
interface Ed448Params extends Algorithm {
|
|
4056
|
+
context?: BufferSource;
|
|
4057
|
+
}
|
|
3607
4058
|
interface HkdfParams extends Algorithm {
|
|
3608
4059
|
hash: HashAlgorithmIdentifier;
|
|
3609
|
-
info:
|
|
3610
|
-
salt:
|
|
4060
|
+
info: BufferSource;
|
|
4061
|
+
salt: BufferSource;
|
|
3611
4062
|
}
|
|
3612
4063
|
interface HmacImportParams extends Algorithm {
|
|
3613
4064
|
hash: HashAlgorithmIdentifier;
|
|
@@ -3621,10 +4072,6 @@ declare module "node:crypto" {
|
|
|
3621
4072
|
hash: HashAlgorithmIdentifier;
|
|
3622
4073
|
length?: number;
|
|
3623
4074
|
}
|
|
3624
|
-
interface KangarooTwelveParams {
|
|
3625
|
-
customization?: NodeJS.BufferSource;
|
|
3626
|
-
outputLength: number;
|
|
3627
|
-
}
|
|
3628
4075
|
interface JsonWebKey {
|
|
3629
4076
|
alg?: string;
|
|
3630
4077
|
crv?: string;
|
|
@@ -3648,23 +4095,10 @@ declare module "node:crypto" {
|
|
|
3648
4095
|
interface KeyAlgorithm {
|
|
3649
4096
|
name: string;
|
|
3650
4097
|
}
|
|
3651
|
-
interface KmacImportParams extends Algorithm {
|
|
3652
|
-
length?: number;
|
|
3653
|
-
}
|
|
3654
|
-
interface KmacKeyAlgorithm extends KeyAlgorithm {
|
|
3655
|
-
length: number;
|
|
3656
|
-
}
|
|
3657
|
-
interface KmacKeyGenParams extends Algorithm {
|
|
3658
|
-
length?: number;
|
|
3659
|
-
}
|
|
3660
|
-
interface KmacParams extends Algorithm {
|
|
3661
|
-
customization?: NodeJS.BufferSource;
|
|
3662
|
-
outputLength: number;
|
|
3663
|
-
}
|
|
3664
4098
|
interface Pbkdf2Params extends Algorithm {
|
|
3665
4099
|
hash: HashAlgorithmIdentifier;
|
|
3666
4100
|
iterations: number;
|
|
3667
|
-
salt:
|
|
4101
|
+
salt: BufferSource;
|
|
3668
4102
|
}
|
|
3669
4103
|
interface RsaHashedImportParams extends Algorithm {
|
|
3670
4104
|
hash: HashAlgorithmIdentifier;
|
|
@@ -3684,7 +4118,7 @@ declare module "node:crypto" {
|
|
|
3684
4118
|
publicExponent: BigInteger;
|
|
3685
4119
|
}
|
|
3686
4120
|
interface RsaOaepParams extends Algorithm {
|
|
3687
|
-
label?:
|
|
4121
|
+
label?: BufferSource;
|
|
3688
4122
|
}
|
|
3689
4123
|
interface RsaOtherPrimesInfo {
|
|
3690
4124
|
d?: string;
|
|
@@ -3694,110 +4128,269 @@ declare module "node:crypto" {
|
|
|
3694
4128
|
interface RsaPssParams extends Algorithm {
|
|
3695
4129
|
saltLength: number;
|
|
3696
4130
|
}
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
4131
|
+
/**
|
|
4132
|
+
* Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class.
|
|
4133
|
+
* `Crypto` is a singleton that provides access to the remainder of the crypto API.
|
|
4134
|
+
* @since v15.0.0
|
|
4135
|
+
*/
|
|
3701
4136
|
interface Crypto {
|
|
4137
|
+
/**
|
|
4138
|
+
* Provides access to the `SubtleCrypto` API.
|
|
4139
|
+
* @since v15.0.0
|
|
4140
|
+
*/
|
|
3702
4141
|
readonly subtle: SubtleCrypto;
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
4142
|
+
/**
|
|
4143
|
+
* Generates cryptographically strong random values.
|
|
4144
|
+
* The given `typedArray` is filled with random values, and a reference to `typedArray` is returned.
|
|
4145
|
+
*
|
|
4146
|
+
* The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted.
|
|
4147
|
+
*
|
|
4148
|
+
* An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
|
|
4149
|
+
* @since v15.0.0
|
|
4150
|
+
*/
|
|
4151
|
+
getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(typedArray: T): T;
|
|
4152
|
+
/**
|
|
4153
|
+
* Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
|
|
4154
|
+
* The UUID is generated using a cryptographic pseudorandom number generator.
|
|
4155
|
+
* @since v16.7.0
|
|
4156
|
+
*/
|
|
3711
4157
|
randomUUID(): UUID;
|
|
4158
|
+
CryptoKey: CryptoKeyConstructor;
|
|
3712
4159
|
}
|
|
4160
|
+
// This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
|
|
4161
|
+
interface CryptoKeyConstructor {
|
|
4162
|
+
/** Illegal constructor */
|
|
4163
|
+
(_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
|
|
4164
|
+
readonly length: 0;
|
|
4165
|
+
readonly name: "CryptoKey";
|
|
4166
|
+
readonly prototype: CryptoKey;
|
|
4167
|
+
}
|
|
4168
|
+
/**
|
|
4169
|
+
* @since v15.0.0
|
|
4170
|
+
*/
|
|
3713
4171
|
interface CryptoKey {
|
|
4172
|
+
/**
|
|
4173
|
+
* An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters.
|
|
4174
|
+
* @since v15.0.0
|
|
4175
|
+
*/
|
|
3714
4176
|
readonly algorithm: KeyAlgorithm;
|
|
4177
|
+
/**
|
|
4178
|
+
* When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`.
|
|
4179
|
+
* @since v15.0.0
|
|
4180
|
+
*/
|
|
3715
4181
|
readonly extractable: boolean;
|
|
4182
|
+
/**
|
|
4183
|
+
* A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key.
|
|
4184
|
+
* @since v15.0.0
|
|
4185
|
+
*/
|
|
3716
4186
|
readonly type: KeyType;
|
|
4187
|
+
/**
|
|
4188
|
+
* An array of strings identifying the operations for which the key may be used.
|
|
4189
|
+
*
|
|
4190
|
+
* The possible usages are:
|
|
4191
|
+
* - `'encrypt'` - The key may be used to encrypt data.
|
|
4192
|
+
* - `'decrypt'` - The key may be used to decrypt data.
|
|
4193
|
+
* - `'sign'` - The key may be used to generate digital signatures.
|
|
4194
|
+
* - `'verify'` - The key may be used to verify digital signatures.
|
|
4195
|
+
* - `'deriveKey'` - The key may be used to derive a new key.
|
|
4196
|
+
* - `'deriveBits'` - The key may be used to derive bits.
|
|
4197
|
+
* - `'wrapKey'` - The key may be used to wrap another key.
|
|
4198
|
+
* - `'unwrapKey'` - The key may be used to unwrap another key.
|
|
4199
|
+
*
|
|
4200
|
+
* Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`).
|
|
4201
|
+
* @since v15.0.0
|
|
4202
|
+
*/
|
|
3717
4203
|
readonly usages: KeyUsage[];
|
|
3718
4204
|
}
|
|
4205
|
+
/**
|
|
4206
|
+
* The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair.
|
|
4207
|
+
* @since v15.0.0
|
|
4208
|
+
*/
|
|
3719
4209
|
interface CryptoKeyPair {
|
|
4210
|
+
/**
|
|
4211
|
+
* A {@link CryptoKey} whose type will be `'private'`.
|
|
4212
|
+
* @since v15.0.0
|
|
4213
|
+
*/
|
|
3720
4214
|
privateKey: CryptoKey;
|
|
4215
|
+
/**
|
|
4216
|
+
* A {@link CryptoKey} whose type will be `'public'`.
|
|
4217
|
+
* @since v15.0.0
|
|
4218
|
+
*/
|
|
3721
4219
|
publicKey: CryptoKey;
|
|
3722
4220
|
}
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
}
|
|
3727
|
-
interface EncapsulatedKey {
|
|
3728
|
-
sharedKey: CryptoKey;
|
|
3729
|
-
ciphertext: ArrayBuffer;
|
|
3730
|
-
}
|
|
4221
|
+
/**
|
|
4222
|
+
* @since v15.0.0
|
|
4223
|
+
*/
|
|
3731
4224
|
interface SubtleCrypto {
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
4225
|
+
/**
|
|
4226
|
+
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
4227
|
+
* `subtle.decrypt()` attempts to decipher the provided `data`. If successful,
|
|
4228
|
+
* the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
|
|
4229
|
+
*
|
|
4230
|
+
* The algorithms currently supported include:
|
|
4231
|
+
*
|
|
4232
|
+
* - `'RSA-OAEP'`
|
|
4233
|
+
* - `'AES-CTR'`
|
|
4234
|
+
* - `'AES-CBC'`
|
|
4235
|
+
* - `'AES-GCM'`
|
|
4236
|
+
* @since v15.0.0
|
|
4237
|
+
*/
|
|
3745
4238
|
decrypt(
|
|
3746
|
-
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
4239
|
+
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
|
|
3747
4240
|
key: CryptoKey,
|
|
3748
|
-
data:
|
|
4241
|
+
data: BufferSource,
|
|
3749
4242
|
): Promise<ArrayBuffer>;
|
|
4243
|
+
/**
|
|
4244
|
+
* Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
|
|
4245
|
+
* `subtle.deriveBits()` attempts to generate `length` bits.
|
|
4246
|
+
* The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
|
|
4247
|
+
* When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
|
|
4248
|
+
* for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
|
|
4249
|
+
* If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the generated data.
|
|
4250
|
+
*
|
|
4251
|
+
* The algorithms currently supported include:
|
|
4252
|
+
*
|
|
4253
|
+
* - `'ECDH'`
|
|
4254
|
+
* - `'X25519'`
|
|
4255
|
+
* - `'X448'`
|
|
4256
|
+
* - `'HKDF'`
|
|
4257
|
+
* - `'PBKDF2'`
|
|
4258
|
+
* @since v15.0.0
|
|
4259
|
+
*/
|
|
3750
4260
|
deriveBits(
|
|
3751
|
-
algorithm:
|
|
4261
|
+
algorithm: EcdhKeyDeriveParams,
|
|
3752
4262
|
baseKey: CryptoKey,
|
|
3753
4263
|
length?: number | null,
|
|
3754
4264
|
): Promise<ArrayBuffer>;
|
|
4265
|
+
deriveBits(
|
|
4266
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
4267
|
+
baseKey: CryptoKey,
|
|
4268
|
+
length: number,
|
|
4269
|
+
): Promise<ArrayBuffer>;
|
|
4270
|
+
/**
|
|
4271
|
+
* Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
|
|
4272
|
+
* `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
|
|
4273
|
+
*
|
|
4274
|
+
* Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
|
|
4275
|
+
* then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
|
|
4276
|
+
*
|
|
4277
|
+
* The algorithms currently supported include:
|
|
4278
|
+
*
|
|
4279
|
+
* - `'ECDH'`
|
|
4280
|
+
* - `'X25519'`
|
|
4281
|
+
* - `'X448'`
|
|
4282
|
+
* - `'HKDF'`
|
|
4283
|
+
* - `'PBKDF2'`
|
|
4284
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4285
|
+
* @since v15.0.0
|
|
4286
|
+
*/
|
|
3755
4287
|
deriveKey(
|
|
3756
|
-
algorithm:
|
|
4288
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
3757
4289
|
baseKey: CryptoKey,
|
|
3758
|
-
|
|
4290
|
+
derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
|
|
3759
4291
|
extractable: boolean,
|
|
3760
4292
|
keyUsages: readonly KeyUsage[],
|
|
3761
4293
|
): Promise<CryptoKey>;
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
): Promise<
|
|
4294
|
+
/**
|
|
4295
|
+
* Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
|
|
4296
|
+
* If successful, the returned promise is resolved with an `<ArrayBuffer>` containing the computed digest.
|
|
4297
|
+
*
|
|
4298
|
+
* If `algorithm` is provided as a `<string>`, it must be one of:
|
|
4299
|
+
*
|
|
4300
|
+
* - `'SHA-1'`
|
|
4301
|
+
* - `'SHA-256'`
|
|
4302
|
+
* - `'SHA-384'`
|
|
4303
|
+
* - `'SHA-512'`
|
|
4304
|
+
*
|
|
4305
|
+
* If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
|
|
4306
|
+
* @since v15.0.0
|
|
4307
|
+
*/
|
|
4308
|
+
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
|
4309
|
+
/**
|
|
4310
|
+
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|
|
4311
|
+
* `subtle.encrypt()` attempts to encipher `data`. If successful,
|
|
4312
|
+
* the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
|
|
4313
|
+
*
|
|
4314
|
+
* The algorithms currently supported include:
|
|
4315
|
+
*
|
|
4316
|
+
* - `'RSA-OAEP'`
|
|
4317
|
+
* - `'AES-CTR'`
|
|
4318
|
+
* - `'AES-CBC'`
|
|
4319
|
+
* - `'AES-GCM'`
|
|
4320
|
+
* @since v15.0.0
|
|
4321
|
+
*/
|
|
3777
4322
|
encrypt(
|
|
3778
|
-
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
4323
|
+
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
|
|
3779
4324
|
key: CryptoKey,
|
|
3780
|
-
data:
|
|
4325
|
+
data: BufferSource,
|
|
3781
4326
|
): Promise<ArrayBuffer>;
|
|
4327
|
+
/**
|
|
4328
|
+
* Exports the given key into the specified format, if supported.
|
|
4329
|
+
*
|
|
4330
|
+
* If the `<CryptoKey>` is not extractable, the returned promise will reject.
|
|
4331
|
+
*
|
|
4332
|
+
* When `format` is either `'pkcs8'` or `'spki'` and the export is successful,
|
|
4333
|
+
* the returned promise will be resolved with an `<ArrayBuffer>` containing the exported key data.
|
|
4334
|
+
*
|
|
4335
|
+
* When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
|
|
4336
|
+
* JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
|
|
4337
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
4338
|
+
* @returns `<Promise>` containing `<ArrayBuffer>`.
|
|
4339
|
+
* @since v15.0.0
|
|
4340
|
+
*/
|
|
3782
4341
|
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
|
3783
4342
|
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
|
3784
|
-
|
|
4343
|
+
/**
|
|
4344
|
+
* Using the method and parameters provided in `algorithm`,
|
|
4345
|
+
* `subtle.generateKey()` attempts to generate new keying material.
|
|
4346
|
+
* Depending the method used, the method may generate either a single `<CryptoKey>` or a `<CryptoKeyPair>`.
|
|
4347
|
+
*
|
|
4348
|
+
* The `<CryptoKeyPair>` (public and private key) generating algorithms supported include:
|
|
4349
|
+
*
|
|
4350
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
4351
|
+
* - `'RSA-PSS'`
|
|
4352
|
+
* - `'RSA-OAEP'`
|
|
4353
|
+
* - `'ECDSA'`
|
|
4354
|
+
* - `'Ed25519'`
|
|
4355
|
+
* - `'Ed448'`
|
|
4356
|
+
* - `'ECDH'`
|
|
4357
|
+
* - `'X25519'`
|
|
4358
|
+
* - `'X448'`
|
|
4359
|
+
* The `<CryptoKey>` (secret key) generating algorithms supported include:
|
|
4360
|
+
*
|
|
4361
|
+
* - `'HMAC'`
|
|
4362
|
+
* - `'AES-CTR'`
|
|
4363
|
+
* - `'AES-CBC'`
|
|
4364
|
+
* - `'AES-GCM'`
|
|
4365
|
+
* - `'AES-KW'`
|
|
4366
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4367
|
+
* @since v15.0.0
|
|
4368
|
+
*/
|
|
3785
4369
|
generateKey(
|
|
3786
4370
|
algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
|
|
3787
4371
|
extractable: boolean,
|
|
3788
|
-
keyUsages: KeyUsage[],
|
|
4372
|
+
keyUsages: readonly KeyUsage[],
|
|
3789
4373
|
): Promise<CryptoKeyPair>;
|
|
3790
4374
|
generateKey(
|
|
3791
|
-
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params
|
|
4375
|
+
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
|
|
3792
4376
|
extractable: boolean,
|
|
3793
|
-
keyUsages: KeyUsage[],
|
|
4377
|
+
keyUsages: readonly KeyUsage[],
|
|
3794
4378
|
): Promise<CryptoKey>;
|
|
3795
4379
|
generateKey(
|
|
3796
4380
|
algorithm: AlgorithmIdentifier,
|
|
3797
4381
|
extractable: boolean,
|
|
3798
4382
|
keyUsages: KeyUsage[],
|
|
3799
4383
|
): Promise<CryptoKeyPair | CryptoKey>;
|
|
3800
|
-
|
|
4384
|
+
/**
|
|
4385
|
+
* The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
|
|
4386
|
+
* to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
|
|
4387
|
+
* If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
|
|
4388
|
+
*
|
|
4389
|
+
* If importing a `'PBKDF2'` key, `extractable` must be `false`.
|
|
4390
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
4391
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4392
|
+
* @since v15.0.0
|
|
4393
|
+
*/
|
|
3801
4394
|
importKey(
|
|
3802
4395
|
format: "jwk",
|
|
3803
4396
|
keyData: JsonWebKey,
|
|
@@ -3806,147 +4399,147 @@ declare module "node:crypto" {
|
|
|
3806
4399
|
| RsaHashedImportParams
|
|
3807
4400
|
| EcKeyImportParams
|
|
3808
4401
|
| HmacImportParams
|
|
3809
|
-
| AesKeyAlgorithm
|
|
3810
|
-
| KmacImportParams,
|
|
4402
|
+
| AesKeyAlgorithm,
|
|
3811
4403
|
extractable: boolean,
|
|
3812
|
-
keyUsages: KeyUsage[],
|
|
4404
|
+
keyUsages: readonly KeyUsage[],
|
|
3813
4405
|
): Promise<CryptoKey>;
|
|
3814
4406
|
importKey(
|
|
3815
4407
|
format: Exclude<KeyFormat, "jwk">,
|
|
3816
|
-
keyData:
|
|
4408
|
+
keyData: BufferSource,
|
|
3817
4409
|
algorithm:
|
|
3818
4410
|
| AlgorithmIdentifier
|
|
3819
4411
|
| RsaHashedImportParams
|
|
3820
4412
|
| EcKeyImportParams
|
|
3821
4413
|
| HmacImportParams
|
|
3822
|
-
| AesKeyAlgorithm
|
|
3823
|
-
| KmacImportParams,
|
|
4414
|
+
| AesKeyAlgorithm,
|
|
3824
4415
|
extractable: boolean,
|
|
3825
4416
|
keyUsages: KeyUsage[],
|
|
3826
4417
|
): Promise<CryptoKey>;
|
|
4418
|
+
/**
|
|
4419
|
+
* Using the method and parameters given by `algorithm` and the keying material provided by `key`,
|
|
4420
|
+
* `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful,
|
|
4421
|
+
* the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
|
|
4422
|
+
*
|
|
4423
|
+
* The algorithms currently supported include:
|
|
4424
|
+
*
|
|
4425
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
4426
|
+
* - `'RSA-PSS'`
|
|
4427
|
+
* - `'ECDSA'`
|
|
4428
|
+
* - `'Ed25519'`
|
|
4429
|
+
* - `'Ed448'`
|
|
4430
|
+
* - `'HMAC'`
|
|
4431
|
+
* @since v15.0.0
|
|
4432
|
+
*/
|
|
3827
4433
|
sign(
|
|
3828
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
4434
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
|
|
3829
4435
|
key: CryptoKey,
|
|
3830
|
-
data:
|
|
4436
|
+
data: BufferSource,
|
|
3831
4437
|
): Promise<ArrayBuffer>;
|
|
4438
|
+
/**
|
|
4439
|
+
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
4440
|
+
* The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
|
|
4441
|
+
* It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
|
|
4442
|
+
* then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
|
|
4443
|
+
* If successful, the returned promise is resolved with a `<CryptoKey>` object.
|
|
4444
|
+
*
|
|
4445
|
+
* The wrapping algorithms currently supported include:
|
|
4446
|
+
*
|
|
4447
|
+
* - `'RSA-OAEP'`
|
|
4448
|
+
* - `'AES-CTR'`
|
|
4449
|
+
* - `'AES-CBC'`
|
|
4450
|
+
* - `'AES-GCM'`
|
|
4451
|
+
* - `'AES-KW'`
|
|
4452
|
+
*
|
|
4453
|
+
* The unwrapped key algorithms supported include:
|
|
4454
|
+
*
|
|
4455
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
4456
|
+
* - `'RSA-PSS'`
|
|
4457
|
+
* - `'RSA-OAEP'`
|
|
4458
|
+
* - `'ECDSA'`
|
|
4459
|
+
* - `'Ed25519'`
|
|
4460
|
+
* - `'Ed448'`
|
|
4461
|
+
* - `'ECDH'`
|
|
4462
|
+
* - `'X25519'`
|
|
4463
|
+
* - `'X448'`
|
|
4464
|
+
* - `'HMAC'`
|
|
4465
|
+
* - `'AES-CTR'`
|
|
4466
|
+
* - `'AES-CBC'`
|
|
4467
|
+
* - `'AES-GCM'`
|
|
4468
|
+
* - `'AES-KW'`
|
|
4469
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
4470
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4471
|
+
* @since v15.0.0
|
|
4472
|
+
*/
|
|
3832
4473
|
unwrapKey(
|
|
3833
4474
|
format: KeyFormat,
|
|
3834
|
-
wrappedKey:
|
|
4475
|
+
wrappedKey: BufferSource,
|
|
3835
4476
|
unwrappingKey: CryptoKey,
|
|
3836
|
-
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
4477
|
+
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
|
|
3837
4478
|
unwrappedKeyAlgorithm:
|
|
3838
4479
|
| AlgorithmIdentifier
|
|
3839
4480
|
| RsaHashedImportParams
|
|
3840
4481
|
| EcKeyImportParams
|
|
3841
4482
|
| HmacImportParams
|
|
3842
|
-
| AesKeyAlgorithm
|
|
3843
|
-
| KmacImportParams,
|
|
4483
|
+
| AesKeyAlgorithm,
|
|
3844
4484
|
extractable: boolean,
|
|
3845
4485
|
keyUsages: KeyUsage[],
|
|
3846
4486
|
): Promise<CryptoKey>;
|
|
4487
|
+
/**
|
|
4488
|
+
* Using the method and parameters given in `algorithm` and the keying material provided by `key`,
|
|
4489
|
+
* `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`.
|
|
4490
|
+
* The returned promise is resolved with either `true` or `false`.
|
|
4491
|
+
*
|
|
4492
|
+
* The algorithms currently supported include:
|
|
4493
|
+
*
|
|
4494
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
4495
|
+
* - `'RSA-PSS'`
|
|
4496
|
+
* - `'ECDSA'`
|
|
4497
|
+
* - `'Ed25519'`
|
|
4498
|
+
* - `'Ed448'`
|
|
4499
|
+
* - `'HMAC'`
|
|
4500
|
+
* @since v15.0.0
|
|
4501
|
+
*/
|
|
3847
4502
|
verify(
|
|
3848
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
4503
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
|
|
3849
4504
|
key: CryptoKey,
|
|
3850
|
-
signature:
|
|
3851
|
-
data:
|
|
4505
|
+
signature: BufferSource,
|
|
4506
|
+
data: BufferSource,
|
|
3852
4507
|
): Promise<boolean>;
|
|
4508
|
+
/**
|
|
4509
|
+
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
4510
|
+
* The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
|
|
4511
|
+
* then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
|
|
4512
|
+
* It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
|
|
4513
|
+
* then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
|
|
4514
|
+
* If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the encrypted key data.
|
|
4515
|
+
*
|
|
4516
|
+
* The wrapping algorithms currently supported include:
|
|
4517
|
+
*
|
|
4518
|
+
* - `'RSA-OAEP'`
|
|
4519
|
+
* - `'AES-CTR'`
|
|
4520
|
+
* - `'AES-CBC'`
|
|
4521
|
+
* - `'AES-GCM'`
|
|
4522
|
+
* - `'AES-KW'`
|
|
4523
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
4524
|
+
* @since v15.0.0
|
|
4525
|
+
*/
|
|
3853
4526
|
wrapKey(
|
|
3854
4527
|
format: KeyFormat,
|
|
3855
4528
|
key: CryptoKey,
|
|
3856
4529
|
wrappingKey: CryptoKey,
|
|
3857
|
-
wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
4530
|
+
wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
|
|
3858
4531
|
): Promise<ArrayBuffer>;
|
|
3859
4532
|
}
|
|
3860
4533
|
}
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
const OPENSSL_VERSION_NUMBER: number;
|
|
3869
|
-
const SSL_OP_ALL: number;
|
|
3870
|
-
const SSL_OP_ALLOW_NO_DHE_KEX: number;
|
|
3871
|
-
const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
|
|
3872
|
-
const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
|
|
3873
|
-
const SSL_OP_CISCO_ANYCONNECT: number;
|
|
3874
|
-
const SSL_OP_COOKIE_EXCHANGE: number;
|
|
3875
|
-
const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
|
|
3876
|
-
const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
|
|
3877
|
-
const SSL_OP_LEGACY_SERVER_CONNECT: number;
|
|
3878
|
-
const SSL_OP_NO_COMPRESSION: number;
|
|
3879
|
-
const SSL_OP_NO_ENCRYPT_THEN_MAC: number;
|
|
3880
|
-
const SSL_OP_NO_QUERY_MTU: number;
|
|
3881
|
-
const SSL_OP_NO_RENEGOTIATION: number;
|
|
3882
|
-
const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
|
|
3883
|
-
const SSL_OP_NO_SSLv2: number;
|
|
3884
|
-
const SSL_OP_NO_SSLv3: number;
|
|
3885
|
-
const SSL_OP_NO_TICKET: number;
|
|
3886
|
-
const SSL_OP_NO_TLSv1: number;
|
|
3887
|
-
const SSL_OP_NO_TLSv1_1: number;
|
|
3888
|
-
const SSL_OP_NO_TLSv1_2: number;
|
|
3889
|
-
const SSL_OP_NO_TLSv1_3: number;
|
|
3890
|
-
const SSL_OP_PRIORITIZE_CHACHA: number;
|
|
3891
|
-
const SSL_OP_TLS_ROLLBACK_BUG: number;
|
|
3892
|
-
const ENGINE_METHOD_RSA: number;
|
|
3893
|
-
const ENGINE_METHOD_DSA: number;
|
|
3894
|
-
const ENGINE_METHOD_DH: number;
|
|
3895
|
-
const ENGINE_METHOD_RAND: number;
|
|
3896
|
-
const ENGINE_METHOD_EC: number;
|
|
3897
|
-
const ENGINE_METHOD_CIPHERS: number;
|
|
3898
|
-
const ENGINE_METHOD_DIGESTS: number;
|
|
3899
|
-
const ENGINE_METHOD_PKEY_METHS: number;
|
|
3900
|
-
const ENGINE_METHOD_PKEY_ASN1_METHS: number;
|
|
3901
|
-
const ENGINE_METHOD_ALL: number;
|
|
3902
|
-
const ENGINE_METHOD_NONE: number;
|
|
3903
|
-
const DH_CHECK_P_NOT_SAFE_PRIME: number;
|
|
3904
|
-
const DH_CHECK_P_NOT_PRIME: number;
|
|
3905
|
-
const DH_UNABLE_TO_CHECK_GENERATOR: number;
|
|
3906
|
-
const DH_NOT_SUITABLE_GENERATOR: number;
|
|
3907
|
-
const RSA_PKCS1_PADDING: number;
|
|
3908
|
-
const RSA_NO_PADDING: number;
|
|
3909
|
-
const RSA_PKCS1_OAEP_PADDING: number;
|
|
3910
|
-
const RSA_X931_PADDING: number;
|
|
3911
|
-
const RSA_PKCS1_PSS_PADDING: number;
|
|
3912
|
-
const RSA_PSS_SALTLEN_DIGEST: number;
|
|
3913
|
-
const RSA_PSS_SALTLEN_MAX_SIGN: number;
|
|
3914
|
-
const RSA_PSS_SALTLEN_AUTO: number;
|
|
3915
|
-
const TLS1_VERSION: number;
|
|
3916
|
-
const TLS1_1_VERSION: number;
|
|
3917
|
-
const TLS1_2_VERSION: number;
|
|
3918
|
-
const TLS1_3_VERSION: number;
|
|
3919
|
-
const POINT_CONVERSION_COMPRESSED: number;
|
|
3920
|
-
const POINT_CONVERSION_UNCOMPRESSED: number;
|
|
3921
|
-
const POINT_CONVERSION_HYBRID: number;
|
|
3922
|
-
const defaultCipherList: string;
|
|
3923
|
-
const defaultCoreCipherList: string;
|
|
3924
|
-
}
|
|
3925
|
-
// TODO: remove in future major version
|
|
3926
|
-
/** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
|
|
3927
|
-
type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
|
|
3928
|
-
/** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
|
|
3929
|
-
type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1";
|
|
3930
|
-
/** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
|
|
3931
|
-
type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
|
|
3932
|
-
/** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
|
|
3933
|
-
type Encoding = BufferEncoding;
|
|
3934
|
-
/** @deprecated This type will be removed in a future version. Use `KeyLike` instead. */
|
|
3935
|
-
type CipherKey = KeyLike;
|
|
3936
|
-
/** @deprecated This type will be removed in a future version. */
|
|
3937
|
-
interface RsaPrivateKey {
|
|
3938
|
-
key: KeyLike;
|
|
3939
|
-
passphrase?: string | undefined;
|
|
3940
|
-
oaepHash?: string | undefined;
|
|
3941
|
-
oaepLabel?: NodeJS.TypedArray | undefined;
|
|
3942
|
-
padding?: number | undefined;
|
|
3943
|
-
}
|
|
3944
|
-
/** @deprecated This type will be removed in a future version. */
|
|
3945
|
-
interface RsaPublicKey {
|
|
3946
|
-
key: KeyLike;
|
|
3947
|
-
padding?: number | undefined;
|
|
4534
|
+
|
|
4535
|
+
global {
|
|
4536
|
+
var crypto: typeof globalThis extends {
|
|
4537
|
+
crypto: infer T;
|
|
4538
|
+
onmessage: any;
|
|
4539
|
+
} ? T
|
|
4540
|
+
: webcrypto.Crypto;
|
|
3948
4541
|
}
|
|
3949
4542
|
}
|
|
3950
|
-
declare module "crypto" {
|
|
3951
|
-
export * from "
|
|
4543
|
+
declare module "node:crypto" {
|
|
4544
|
+
export * from "crypto";
|
|
3952
4545
|
}
|