cloudstructs 0.9.39 → 0.9.40
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/.jsii +4 -4
- package/assets/slack-textract/detect.lambda/index.js +232 -5
- package/lib/codecommit-mirror/index.js +2 -2
- package/lib/dmarc/index.js +1 -1
- package/lib/ecs-service-roller/index.js +2 -2
- package/lib/email-receiver/receiver.js +1 -1
- package/lib/mjml-template/index.js +1 -1
- package/lib/saml-identity-provider/index.js +2 -2
- package/lib/slack-app/manifest.js +1 -1
- package/lib/slack-app/slack-app.js +2 -2
- package/lib/slack-events/index.js +1 -1
- package/lib/slack-textract/index.js +1 -1
- package/lib/ssl-server-test/index.js +1 -1
- package/lib/state-machine-cr-provider/index.js +1 -1
- package/lib/static-website/index.js +1 -1
- package/lib/toolkit-cleaner/index.js +1 -1
- package/lib/url-shortener/index.js +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +15 -9
- package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +900 -193
- package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +15 -11
- package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +14 -5
- package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +149 -30
- package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +9 -12
- package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +24 -0
- package/node_modules/@slack/logger/node_modules/@types/node/inspector.generated.d.ts +181 -0
- package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +5 -5
- package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +13 -3
- package/node_modules/@slack/logger/node_modules/@types/node/package.json +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +7 -19
- package/node_modules/@slack/logger/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@slack/logger/node_modules/@types/node/sqlite.d.ts +6 -4
- package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +29 -3
- package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@slack/logger/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +18 -2
- package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +146 -86
- package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@slack/logger/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +39 -1
- package/node_modules/@slack/logger/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/@slack/logger/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/@slack/logger/node_modules/undici-types/package.json +1 -1
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts +79 -3
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts +19 -2
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/events/message.d.ts +1 -0
- package/node_modules/@slack/types/dist/events/message.d.ts.map +1 -1
- package/node_modules/@slack/types/package.json +2 -2
- package/node_modules/@slack/web-api/README.md +5 -5
- package/node_modules/@slack/web-api/dist/WebClient.d.ts +30 -3
- package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/WebClient.js +43 -0
- package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
- package/node_modules/@slack/web-api/dist/chat-stream.d.ts +86 -0
- package/node_modules/@slack/web-api/dist/chat-stream.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/chat-stream.js +149 -0
- package/node_modules/@slack/web-api/dist/chat-stream.js.map +1 -0
- package/node_modules/@slack/web-api/dist/methods.d.ts +15 -3
- package/node_modules/@slack/web-api/dist/methods.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/methods.js +13 -1
- package/node_modules/@slack/web-api/dist/methods.js.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/assistant.d.ts +2 -0
- package/node_modules/@slack/web-api/dist/types/request/assistant.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/chat.d.ts +28 -6
- package/node_modules/@slack/web-api/dist/types/request/chat.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts +1 -1
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.d.ts +10 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.js +3 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.d.ts +10 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.js +3 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.d.ts +24 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.js +3 -0
- package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts +3 -0
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +15 -9
- package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +900 -193
- package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +15 -11
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +14 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +149 -30
- package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +9 -12
- package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.generated.d.ts +181 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +13 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +7 -19
- package/node_modules/@slack/web-api/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/sqlite.d.ts +6 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +29 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +18 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +146 -86
- package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +39 -1
- package/node_modules/@slack/web-api/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/@slack/web-api/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/@slack/web-api/node_modules/undici-types/package.json +1 -1
- package/node_modules/@slack/web-api/package.json +4 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +15 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +900 -193
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +15 -11
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +14 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +149 -30
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +9 -12
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +24 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.generated.d.ts +181 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +5 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +13 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +7 -19
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +6 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +29 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +18 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +146 -86
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +39 -1
- package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +15 -9
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +900 -193
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +15 -11
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +14 -5
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +149 -30
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +9 -12
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +24 -0
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.generated.d.ts +181 -0
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +5 -5
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +13 -3
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +7 -19
- package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +6 -4
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +29 -3
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +18 -2
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +146 -86
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/keyv/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +39 -1
- package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/@types/keyv/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +15 -9
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +900 -193
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +15 -11
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +14 -5
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +149 -30
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +9 -12
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +24 -0
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.generated.d.ts +181 -0
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +5 -5
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +13 -3
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +7 -19
- package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +6 -4
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +29 -3
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +18 -2
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +146 -86
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/responselike/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +39 -1
- package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/@types/responselike/node_modules/undici-types/package.json +1 -1
- package/node_modules/semver/classes/range.js +1 -0
- package/node_modules/semver/classes/semver.js +19 -5
- package/node_modules/semver/internal/identifiers.js +4 -0
- package/node_modules/semver/package.json +3 -3
- package/package.json +18 -18
|
@@ -510,50 +510,50 @@ declare module "crypto" {
|
|
|
510
510
|
format: "jwk";
|
|
511
511
|
}
|
|
512
512
|
interface JsonWebKey {
|
|
513
|
-
crv?: string
|
|
514
|
-
d?: string
|
|
515
|
-
dp?: string
|
|
516
|
-
dq?: string
|
|
517
|
-
e?: string
|
|
518
|
-
k?: string
|
|
519
|
-
kty?: string
|
|
520
|
-
n?: string
|
|
521
|
-
p?: string
|
|
522
|
-
q?: string
|
|
523
|
-
qi?: string
|
|
524
|
-
x?: string
|
|
525
|
-
y?: string
|
|
513
|
+
crv?: string;
|
|
514
|
+
d?: string;
|
|
515
|
+
dp?: string;
|
|
516
|
+
dq?: string;
|
|
517
|
+
e?: string;
|
|
518
|
+
k?: string;
|
|
519
|
+
kty?: string;
|
|
520
|
+
n?: string;
|
|
521
|
+
p?: string;
|
|
522
|
+
q?: string;
|
|
523
|
+
qi?: string;
|
|
524
|
+
x?: string;
|
|
525
|
+
y?: string;
|
|
526
526
|
[key: string]: unknown;
|
|
527
527
|
}
|
|
528
528
|
interface AsymmetricKeyDetails {
|
|
529
529
|
/**
|
|
530
530
|
* Key size in bits (RSA, DSA).
|
|
531
531
|
*/
|
|
532
|
-
modulusLength?: number
|
|
532
|
+
modulusLength?: number;
|
|
533
533
|
/**
|
|
534
534
|
* Public exponent (RSA).
|
|
535
535
|
*/
|
|
536
|
-
publicExponent?: bigint
|
|
536
|
+
publicExponent?: bigint;
|
|
537
537
|
/**
|
|
538
538
|
* Name of the message digest (RSA-PSS).
|
|
539
539
|
*/
|
|
540
|
-
hashAlgorithm?: string
|
|
540
|
+
hashAlgorithm?: string;
|
|
541
541
|
/**
|
|
542
542
|
* Name of the message digest used by MGF1 (RSA-PSS).
|
|
543
543
|
*/
|
|
544
|
-
mgf1HashAlgorithm?: string
|
|
544
|
+
mgf1HashAlgorithm?: string;
|
|
545
545
|
/**
|
|
546
546
|
* Minimal salt length in bytes (RSA-PSS).
|
|
547
547
|
*/
|
|
548
|
-
saltLength?: number
|
|
548
|
+
saltLength?: number;
|
|
549
549
|
/**
|
|
550
550
|
* Size of q in bits (DSA).
|
|
551
551
|
*/
|
|
552
|
-
divisorLength?: number
|
|
552
|
+
divisorLength?: number;
|
|
553
553
|
/**
|
|
554
554
|
* Name of the curve (EC).
|
|
555
555
|
*/
|
|
556
|
-
namedCurve?: string
|
|
556
|
+
namedCurve?: string;
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
559
559
|
* Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
|
|
@@ -591,27 +591,14 @@ declare module "crypto" {
|
|
|
591
591
|
*/
|
|
592
592
|
static from(key: webcrypto.CryptoKey): KeyObject;
|
|
593
593
|
/**
|
|
594
|
-
* For asymmetric keys, this property represents the type of the key.
|
|
595
|
-
* types
|
|
596
|
-
*
|
|
597
|
-
* * `'rsa'` (OID 1.2.840.113549.1.1.1)
|
|
598
|
-
* * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
|
|
599
|
-
* * `'dsa'` (OID 1.2.840.10040.4.1)
|
|
600
|
-
* * `'ec'` (OID 1.2.840.10045.2.1)
|
|
601
|
-
* * `'x25519'` (OID 1.3.101.110)
|
|
602
|
-
* * `'x448'` (OID 1.3.101.111)
|
|
603
|
-
* * `'ed25519'` (OID 1.3.101.112)
|
|
604
|
-
* * `'ed448'` (OID 1.3.101.113)
|
|
605
|
-
* * `'dh'` (OID 1.2.840.113549.1.3.1)
|
|
606
|
-
* * `'ml-dsa-44'` (OID 2.16.840.1.101.3.4.3.17)
|
|
607
|
-
* * `'ml-dsa-65'` (OID 2.16.840.1.101.3.4.3.18)
|
|
608
|
-
* * `'ml-dsa-87'` (OID 2.16.840.1.101.3.4.3.19)
|
|
594
|
+
* For asymmetric keys, this property represents the type of the key. See the
|
|
595
|
+
* supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
|
|
609
596
|
*
|
|
610
597
|
* This property is `undefined` for unrecognized `KeyObject` types and symmetric
|
|
611
598
|
* keys.
|
|
612
599
|
* @since v11.6.0
|
|
613
600
|
*/
|
|
614
|
-
asymmetricKeyType?: KeyType
|
|
601
|
+
asymmetricKeyType?: KeyType;
|
|
615
602
|
/**
|
|
616
603
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
617
604
|
* this object contains information about the key. None of the information obtained
|
|
@@ -625,7 +612,7 @@ declare module "crypto" {
|
|
|
625
612
|
* Other key details might be exposed via this API using additional attributes.
|
|
626
613
|
* @since v15.7.0
|
|
627
614
|
*/
|
|
628
|
-
asymmetricKeyDetails?: AsymmetricKeyDetails
|
|
615
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
629
616
|
/**
|
|
630
617
|
* For symmetric keys, the following encoding options can be used:
|
|
631
618
|
*
|
|
@@ -664,7 +651,7 @@ declare module "crypto" {
|
|
|
664
651
|
* property is `undefined` for asymmetric keys.
|
|
665
652
|
* @since v11.6.0
|
|
666
653
|
*/
|
|
667
|
-
symmetricKeySize?: number
|
|
654
|
+
symmetricKeySize?: number;
|
|
668
655
|
/**
|
|
669
656
|
* Converts a `KeyObject` instance to a `CryptoKey`.
|
|
670
657
|
* @since 22.10.0
|
|
@@ -1323,6 +1310,7 @@ declare module "crypto" {
|
|
|
1323
1310
|
* @since v0.1.92
|
|
1324
1311
|
* @param options `stream.Writable` options
|
|
1325
1312
|
*/
|
|
1313
|
+
// TODO: signing algorithm type
|
|
1326
1314
|
function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
|
|
1327
1315
|
type DSAEncoding = "der" | "ieee-p1363";
|
|
1328
1316
|
interface SigningOptions {
|
|
@@ -1332,6 +1320,7 @@ declare module "crypto" {
|
|
|
1332
1320
|
padding?: number | undefined;
|
|
1333
1321
|
saltLength?: number | undefined;
|
|
1334
1322
|
dsaEncoding?: DSAEncoding | undefined;
|
|
1323
|
+
context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
1335
1324
|
}
|
|
1336
1325
|
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
1337
1326
|
interface SignKeyObjectInput extends SigningOptions {
|
|
@@ -2460,17 +2449,33 @@ declare module "crypto" {
|
|
|
2460
2449
|
*/
|
|
2461
2450
|
function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
|
|
2462
2451
|
type KeyType =
|
|
2463
|
-
| "
|
|
2464
|
-
| "rsa-pss"
|
|
2452
|
+
| "dh"
|
|
2465
2453
|
| "dsa"
|
|
2466
2454
|
| "ec"
|
|
2467
2455
|
| "ed25519"
|
|
2468
2456
|
| "ed448"
|
|
2469
|
-
| "x25519"
|
|
2470
|
-
| "x448"
|
|
2471
2457
|
| "ml-dsa-44"
|
|
2472
2458
|
| "ml-dsa-65"
|
|
2473
|
-
| "ml-dsa-87"
|
|
2459
|
+
| "ml-dsa-87"
|
|
2460
|
+
| "ml-kem-1024"
|
|
2461
|
+
| "ml-kem-512"
|
|
2462
|
+
| "ml-kem-768"
|
|
2463
|
+
| "rsa-pss"
|
|
2464
|
+
| "rsa"
|
|
2465
|
+
| "slh-dsa-sha2-128f"
|
|
2466
|
+
| "slh-dsa-sha2-128s"
|
|
2467
|
+
| "slh-dsa-sha2-192f"
|
|
2468
|
+
| "slh-dsa-sha2-192s"
|
|
2469
|
+
| "slh-dsa-sha2-256f"
|
|
2470
|
+
| "slh-dsa-sha2-256s"
|
|
2471
|
+
| "slh-dsa-shake-128f"
|
|
2472
|
+
| "slh-dsa-shake-128s"
|
|
2473
|
+
| "slh-dsa-shake-192f"
|
|
2474
|
+
| "slh-dsa-shake-192s"
|
|
2475
|
+
| "slh-dsa-shake-256f"
|
|
2476
|
+
| "slh-dsa-shake-256s"
|
|
2477
|
+
| "x25519"
|
|
2478
|
+
| "x448";
|
|
2474
2479
|
type KeyFormat = "pem" | "der" | "jwk";
|
|
2475
2480
|
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
2476
2481
|
format: T;
|
|
@@ -2486,6 +2491,8 @@ declare module "crypto" {
|
|
|
2486
2491
|
interface X25519KeyPairKeyObjectOptions {}
|
|
2487
2492
|
interface X448KeyPairKeyObjectOptions {}
|
|
2488
2493
|
interface MLDSAKeyPairKeyObjectOptions {}
|
|
2494
|
+
interface MLKEMKeyPairKeyObjectOptions {}
|
|
2495
|
+
interface SLHDSAKeyPairKeyObjectOptions {}
|
|
2489
2496
|
interface ECKeyPairKeyObjectOptions {
|
|
2490
2497
|
/**
|
|
2491
2498
|
* Name of the curve to use
|
|
@@ -2520,15 +2527,15 @@ declare module "crypto" {
|
|
|
2520
2527
|
/**
|
|
2521
2528
|
* Name of the message digest
|
|
2522
2529
|
*/
|
|
2523
|
-
hashAlgorithm?: string;
|
|
2530
|
+
hashAlgorithm?: string | undefined;
|
|
2524
2531
|
/**
|
|
2525
2532
|
* Name of the message digest used by MGF1
|
|
2526
2533
|
*/
|
|
2527
|
-
mgf1HashAlgorithm?: string;
|
|
2534
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2528
2535
|
/**
|
|
2529
2536
|
* Minimal salt length in bytes
|
|
2530
2537
|
*/
|
|
2531
|
-
saltLength?: string;
|
|
2538
|
+
saltLength?: string | undefined;
|
|
2532
2539
|
}
|
|
2533
2540
|
interface DSAKeyPairKeyObjectOptions {
|
|
2534
2541
|
/**
|
|
@@ -2571,15 +2578,15 @@ declare module "crypto" {
|
|
|
2571
2578
|
/**
|
|
2572
2579
|
* Name of the message digest
|
|
2573
2580
|
*/
|
|
2574
|
-
hashAlgorithm?: string;
|
|
2581
|
+
hashAlgorithm?: string | undefined;
|
|
2575
2582
|
/**
|
|
2576
2583
|
* Name of the message digest used by MGF1
|
|
2577
2584
|
*/
|
|
2578
|
-
mgf1HashAlgorithm?: string;
|
|
2585
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2579
2586
|
/**
|
|
2580
2587
|
* Minimal salt length in bytes
|
|
2581
2588
|
*/
|
|
2582
|
-
saltLength?: string;
|
|
2589
|
+
saltLength?: string | undefined;
|
|
2583
2590
|
publicKeyEncoding: {
|
|
2584
2591
|
type: "spki";
|
|
2585
2592
|
format: PubF;
|
|
@@ -2659,6 +2666,24 @@ declare module "crypto" {
|
|
|
2659
2666
|
type: "pkcs8";
|
|
2660
2667
|
};
|
|
2661
2668
|
}
|
|
2669
|
+
interface MLKEMKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2670
|
+
publicKeyEncoding: {
|
|
2671
|
+
type: "spki";
|
|
2672
|
+
format: PubF;
|
|
2673
|
+
};
|
|
2674
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2675
|
+
type: "pkcs8";
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
interface SLHDSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2679
|
+
publicKeyEncoding: {
|
|
2680
|
+
type: "spki";
|
|
2681
|
+
format: PubF;
|
|
2682
|
+
};
|
|
2683
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2684
|
+
type: "pkcs8";
|
|
2685
|
+
};
|
|
2686
|
+
}
|
|
2662
2687
|
interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
|
|
2663
2688
|
publicKey: T1;
|
|
2664
2689
|
privateKey: T2;
|
|
@@ -2702,8 +2727,8 @@ declare module "crypto" {
|
|
|
2702
2727
|
* When PEM encoding was selected, the respective key will be a string, otherwise
|
|
2703
2728
|
* it will be a buffer containing the data encoded as DER.
|
|
2704
2729
|
* @since v10.12.0
|
|
2705
|
-
* @param type
|
|
2706
|
-
*
|
|
2730
|
+
* @param type The asymmetric key type to generate. See the
|
|
2731
|
+
* supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
|
|
2707
2732
|
*/
|
|
2708
2733
|
function generateKeyPairSync(
|
|
2709
2734
|
type: "rsa",
|
|
@@ -2861,6 +2886,106 @@ declare module "crypto" {
|
|
|
2861
2886
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
2862
2887
|
options?: MLDSAKeyPairKeyObjectOptions,
|
|
2863
2888
|
): KeyPairKeyObjectResult;
|
|
2889
|
+
function generateKeyPairSync(
|
|
2890
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2891
|
+
options: MLKEMKeyPairOptions<"pem", "pem">,
|
|
2892
|
+
): KeyPairSyncResult<string, string>;
|
|
2893
|
+
function generateKeyPairSync(
|
|
2894
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2895
|
+
options: MLKEMKeyPairOptions<"pem", "der">,
|
|
2896
|
+
): KeyPairSyncResult<string, Buffer>;
|
|
2897
|
+
function generateKeyPairSync(
|
|
2898
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2899
|
+
options: MLKEMKeyPairOptions<"der", "pem">,
|
|
2900
|
+
): KeyPairSyncResult<Buffer, string>;
|
|
2901
|
+
function generateKeyPairSync(
|
|
2902
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2903
|
+
options: MLKEMKeyPairOptions<"der", "der">,
|
|
2904
|
+
): KeyPairSyncResult<Buffer, Buffer>;
|
|
2905
|
+
function generateKeyPairSync(
|
|
2906
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2907
|
+
options?: MLKEMKeyPairKeyObjectOptions,
|
|
2908
|
+
): KeyPairKeyObjectResult;
|
|
2909
|
+
function generateKeyPairSync(
|
|
2910
|
+
type:
|
|
2911
|
+
| "slh-dsa-sha2-128f"
|
|
2912
|
+
| "slh-dsa-sha2-128s"
|
|
2913
|
+
| "slh-dsa-sha2-192f"
|
|
2914
|
+
| "slh-dsa-sha2-192s"
|
|
2915
|
+
| "slh-dsa-sha2-256f"
|
|
2916
|
+
| "slh-dsa-sha2-256s"
|
|
2917
|
+
| "slh-dsa-shake-128f"
|
|
2918
|
+
| "slh-dsa-shake-128s"
|
|
2919
|
+
| "slh-dsa-shake-192f"
|
|
2920
|
+
| "slh-dsa-shake-192s"
|
|
2921
|
+
| "slh-dsa-shake-256f"
|
|
2922
|
+
| "slh-dsa-shake-256s",
|
|
2923
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
2924
|
+
): KeyPairSyncResult<string, string>;
|
|
2925
|
+
function generateKeyPairSync(
|
|
2926
|
+
type:
|
|
2927
|
+
| "slh-dsa-sha2-128f"
|
|
2928
|
+
| "slh-dsa-sha2-128s"
|
|
2929
|
+
| "slh-dsa-sha2-192f"
|
|
2930
|
+
| "slh-dsa-sha2-192s"
|
|
2931
|
+
| "slh-dsa-sha2-256f"
|
|
2932
|
+
| "slh-dsa-sha2-256s"
|
|
2933
|
+
| "slh-dsa-shake-128f"
|
|
2934
|
+
| "slh-dsa-shake-128s"
|
|
2935
|
+
| "slh-dsa-shake-192f"
|
|
2936
|
+
| "slh-dsa-shake-192s"
|
|
2937
|
+
| "slh-dsa-shake-256f"
|
|
2938
|
+
| "slh-dsa-shake-256s",
|
|
2939
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
2940
|
+
): KeyPairSyncResult<string, Buffer>;
|
|
2941
|
+
function generateKeyPairSync(
|
|
2942
|
+
type:
|
|
2943
|
+
| "slh-dsa-sha2-128f"
|
|
2944
|
+
| "slh-dsa-sha2-128s"
|
|
2945
|
+
| "slh-dsa-sha2-192f"
|
|
2946
|
+
| "slh-dsa-sha2-192s"
|
|
2947
|
+
| "slh-dsa-sha2-256f"
|
|
2948
|
+
| "slh-dsa-sha2-256s"
|
|
2949
|
+
| "slh-dsa-shake-128f"
|
|
2950
|
+
| "slh-dsa-shake-128s"
|
|
2951
|
+
| "slh-dsa-shake-192f"
|
|
2952
|
+
| "slh-dsa-shake-192s"
|
|
2953
|
+
| "slh-dsa-shake-256f"
|
|
2954
|
+
| "slh-dsa-shake-256s",
|
|
2955
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
2956
|
+
): KeyPairSyncResult<Buffer, string>;
|
|
2957
|
+
function generateKeyPairSync(
|
|
2958
|
+
type:
|
|
2959
|
+
| "slh-dsa-sha2-128f"
|
|
2960
|
+
| "slh-dsa-sha2-128s"
|
|
2961
|
+
| "slh-dsa-sha2-192f"
|
|
2962
|
+
| "slh-dsa-sha2-192s"
|
|
2963
|
+
| "slh-dsa-sha2-256f"
|
|
2964
|
+
| "slh-dsa-sha2-256s"
|
|
2965
|
+
| "slh-dsa-shake-128f"
|
|
2966
|
+
| "slh-dsa-shake-128s"
|
|
2967
|
+
| "slh-dsa-shake-192f"
|
|
2968
|
+
| "slh-dsa-shake-192s"
|
|
2969
|
+
| "slh-dsa-shake-256f"
|
|
2970
|
+
| "slh-dsa-shake-256s",
|
|
2971
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
2972
|
+
): KeyPairSyncResult<Buffer, Buffer>;
|
|
2973
|
+
function generateKeyPairSync(
|
|
2974
|
+
type:
|
|
2975
|
+
| "slh-dsa-sha2-128f"
|
|
2976
|
+
| "slh-dsa-sha2-128s"
|
|
2977
|
+
| "slh-dsa-sha2-192f"
|
|
2978
|
+
| "slh-dsa-sha2-192s"
|
|
2979
|
+
| "slh-dsa-sha2-256f"
|
|
2980
|
+
| "slh-dsa-sha2-256s"
|
|
2981
|
+
| "slh-dsa-shake-128f"
|
|
2982
|
+
| "slh-dsa-shake-128s"
|
|
2983
|
+
| "slh-dsa-shake-192f"
|
|
2984
|
+
| "slh-dsa-shake-192s"
|
|
2985
|
+
| "slh-dsa-shake-256f"
|
|
2986
|
+
| "slh-dsa-shake-256s",
|
|
2987
|
+
options?: SLHDSAKeyPairKeyObjectOptions,
|
|
2988
|
+
): KeyPairKeyObjectResult;
|
|
2864
2989
|
/**
|
|
2865
2990
|
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
2866
2991
|
* Ed25519, Ed448, X25519, X448, and DH are currently supported.
|
|
@@ -2898,8 +3023,8 @@ declare module "crypto" {
|
|
|
2898
3023
|
* If this method is invoked as its `util.promisify()` ed version, it returns
|
|
2899
3024
|
* a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
|
|
2900
3025
|
* @since v10.12.0
|
|
2901
|
-
* @param type
|
|
2902
|
-
*
|
|
3026
|
+
* @param type The asymmetric key type to generate. See the
|
|
3027
|
+
* supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
|
|
2903
3028
|
*/
|
|
2904
3029
|
function generateKeyPair(
|
|
2905
3030
|
type: "rsa",
|
|
@@ -3126,6 +3251,116 @@ declare module "crypto" {
|
|
|
3126
3251
|
options: MLDSAKeyPairKeyObjectOptions | undefined,
|
|
3127
3252
|
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3128
3253
|
): void;
|
|
3254
|
+
function generateKeyPair(
|
|
3255
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3256
|
+
options: MLKEMKeyPairOptions<"pem", "pem">,
|
|
3257
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
3258
|
+
): void;
|
|
3259
|
+
function generateKeyPair(
|
|
3260
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3261
|
+
options: MLKEMKeyPairOptions<"pem", "der">,
|
|
3262
|
+
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
|
3263
|
+
): void;
|
|
3264
|
+
function generateKeyPair(
|
|
3265
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3266
|
+
options: MLKEMKeyPairOptions<"der", "pem">,
|
|
3267
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
|
3268
|
+
): void;
|
|
3269
|
+
function generateKeyPair(
|
|
3270
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3271
|
+
options: MLKEMKeyPairOptions<"der", "der">,
|
|
3272
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
|
3273
|
+
): void;
|
|
3274
|
+
function generateKeyPair(
|
|
3275
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3276
|
+
options: MLKEMKeyPairKeyObjectOptions | undefined,
|
|
3277
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3278
|
+
): void;
|
|
3279
|
+
function generateKeyPair(
|
|
3280
|
+
type:
|
|
3281
|
+
| "slh-dsa-sha2-128f"
|
|
3282
|
+
| "slh-dsa-sha2-128s"
|
|
3283
|
+
| "slh-dsa-sha2-192f"
|
|
3284
|
+
| "slh-dsa-sha2-192s"
|
|
3285
|
+
| "slh-dsa-sha2-256f"
|
|
3286
|
+
| "slh-dsa-sha2-256s"
|
|
3287
|
+
| "slh-dsa-shake-128f"
|
|
3288
|
+
| "slh-dsa-shake-128s"
|
|
3289
|
+
| "slh-dsa-shake-192f"
|
|
3290
|
+
| "slh-dsa-shake-192s"
|
|
3291
|
+
| "slh-dsa-shake-256f"
|
|
3292
|
+
| "slh-dsa-shake-256s",
|
|
3293
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
3294
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
3295
|
+
): void;
|
|
3296
|
+
function generateKeyPair(
|
|
3297
|
+
type:
|
|
3298
|
+
| "slh-dsa-sha2-128f"
|
|
3299
|
+
| "slh-dsa-sha2-128s"
|
|
3300
|
+
| "slh-dsa-sha2-192f"
|
|
3301
|
+
| "slh-dsa-sha2-192s"
|
|
3302
|
+
| "slh-dsa-sha2-256f"
|
|
3303
|
+
| "slh-dsa-sha2-256s"
|
|
3304
|
+
| "slh-dsa-shake-128f"
|
|
3305
|
+
| "slh-dsa-shake-128s"
|
|
3306
|
+
| "slh-dsa-shake-192f"
|
|
3307
|
+
| "slh-dsa-shake-192s"
|
|
3308
|
+
| "slh-dsa-shake-256f"
|
|
3309
|
+
| "slh-dsa-shake-256s",
|
|
3310
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
3311
|
+
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
|
3312
|
+
): void;
|
|
3313
|
+
function generateKeyPair(
|
|
3314
|
+
type:
|
|
3315
|
+
| "slh-dsa-sha2-128f"
|
|
3316
|
+
| "slh-dsa-sha2-128s"
|
|
3317
|
+
| "slh-dsa-sha2-192f"
|
|
3318
|
+
| "slh-dsa-sha2-192s"
|
|
3319
|
+
| "slh-dsa-sha2-256f"
|
|
3320
|
+
| "slh-dsa-sha2-256s"
|
|
3321
|
+
| "slh-dsa-shake-128f"
|
|
3322
|
+
| "slh-dsa-shake-128s"
|
|
3323
|
+
| "slh-dsa-shake-192f"
|
|
3324
|
+
| "slh-dsa-shake-192s"
|
|
3325
|
+
| "slh-dsa-shake-256f"
|
|
3326
|
+
| "slh-dsa-shake-256s",
|
|
3327
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
3328
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
|
3329
|
+
): void;
|
|
3330
|
+
function generateKeyPair(
|
|
3331
|
+
type:
|
|
3332
|
+
| "slh-dsa-sha2-128f"
|
|
3333
|
+
| "slh-dsa-sha2-128s"
|
|
3334
|
+
| "slh-dsa-sha2-192f"
|
|
3335
|
+
| "slh-dsa-sha2-192s"
|
|
3336
|
+
| "slh-dsa-sha2-256f"
|
|
3337
|
+
| "slh-dsa-sha2-256s"
|
|
3338
|
+
| "slh-dsa-shake-128f"
|
|
3339
|
+
| "slh-dsa-shake-128s"
|
|
3340
|
+
| "slh-dsa-shake-192f"
|
|
3341
|
+
| "slh-dsa-shake-192s"
|
|
3342
|
+
| "slh-dsa-shake-256f"
|
|
3343
|
+
| "slh-dsa-shake-256s",
|
|
3344
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
3345
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
|
3346
|
+
): void;
|
|
3347
|
+
function generateKeyPair(
|
|
3348
|
+
type:
|
|
3349
|
+
| "slh-dsa-sha2-128f"
|
|
3350
|
+
| "slh-dsa-sha2-128s"
|
|
3351
|
+
| "slh-dsa-sha2-192f"
|
|
3352
|
+
| "slh-dsa-sha2-192s"
|
|
3353
|
+
| "slh-dsa-sha2-256f"
|
|
3354
|
+
| "slh-dsa-sha2-256s"
|
|
3355
|
+
| "slh-dsa-shake-128f"
|
|
3356
|
+
| "slh-dsa-shake-128s"
|
|
3357
|
+
| "slh-dsa-shake-192f"
|
|
3358
|
+
| "slh-dsa-shake-192s"
|
|
3359
|
+
| "slh-dsa-shake-256f"
|
|
3360
|
+
| "slh-dsa-shake-256s",
|
|
3361
|
+
options: SLHDSAKeyPairKeyObjectOptions | undefined,
|
|
3362
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3363
|
+
): void;
|
|
3129
3364
|
namespace generateKeyPair {
|
|
3130
3365
|
function __promisify__(
|
|
3131
3366
|
type: "rsa",
|
|
@@ -3400,6 +3635,130 @@ declare module "crypto" {
|
|
|
3400
3635
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3401
3636
|
options?: MLDSAKeyPairKeyObjectOptions,
|
|
3402
3637
|
): Promise<KeyPairKeyObjectResult>;
|
|
3638
|
+
function __promisify__(
|
|
3639
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3640
|
+
options: MLKEMKeyPairOptions<"pem", "pem">,
|
|
3641
|
+
): Promise<{
|
|
3642
|
+
publicKey: string;
|
|
3643
|
+
privateKey: string;
|
|
3644
|
+
}>;
|
|
3645
|
+
function __promisify__(
|
|
3646
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3647
|
+
options: MLKEMKeyPairOptions<"pem", "der">,
|
|
3648
|
+
): Promise<{
|
|
3649
|
+
publicKey: string;
|
|
3650
|
+
privateKey: Buffer;
|
|
3651
|
+
}>;
|
|
3652
|
+
function __promisify__(
|
|
3653
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3654
|
+
options: MLKEMKeyPairOptions<"der", "pem">,
|
|
3655
|
+
): Promise<{
|
|
3656
|
+
publicKey: Buffer;
|
|
3657
|
+
privateKey: string;
|
|
3658
|
+
}>;
|
|
3659
|
+
function __promisify__(
|
|
3660
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3661
|
+
options: MLKEMKeyPairOptions<"der", "der">,
|
|
3662
|
+
): Promise<{
|
|
3663
|
+
publicKey: Buffer;
|
|
3664
|
+
privateKey: Buffer;
|
|
3665
|
+
}>;
|
|
3666
|
+
function __promisify__(
|
|
3667
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3668
|
+
options?: MLKEMKeyPairKeyObjectOptions,
|
|
3669
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3670
|
+
function __promisify__(
|
|
3671
|
+
type:
|
|
3672
|
+
| "slh-dsa-sha2-128f"
|
|
3673
|
+
| "slh-dsa-sha2-128s"
|
|
3674
|
+
| "slh-dsa-sha2-192f"
|
|
3675
|
+
| "slh-dsa-sha2-192s"
|
|
3676
|
+
| "slh-dsa-sha2-256f"
|
|
3677
|
+
| "slh-dsa-sha2-256s"
|
|
3678
|
+
| "slh-dsa-shake-128f"
|
|
3679
|
+
| "slh-dsa-shake-128s"
|
|
3680
|
+
| "slh-dsa-shake-192f"
|
|
3681
|
+
| "slh-dsa-shake-192s"
|
|
3682
|
+
| "slh-dsa-shake-256f"
|
|
3683
|
+
| "slh-dsa-shake-256s",
|
|
3684
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
3685
|
+
): Promise<{
|
|
3686
|
+
publicKey: string;
|
|
3687
|
+
privateKey: string;
|
|
3688
|
+
}>;
|
|
3689
|
+
function __promisify__(
|
|
3690
|
+
type:
|
|
3691
|
+
| "slh-dsa-sha2-128f"
|
|
3692
|
+
| "slh-dsa-sha2-128s"
|
|
3693
|
+
| "slh-dsa-sha2-192f"
|
|
3694
|
+
| "slh-dsa-sha2-192s"
|
|
3695
|
+
| "slh-dsa-sha2-256f"
|
|
3696
|
+
| "slh-dsa-sha2-256s"
|
|
3697
|
+
| "slh-dsa-shake-128f"
|
|
3698
|
+
| "slh-dsa-shake-128s"
|
|
3699
|
+
| "slh-dsa-shake-192f"
|
|
3700
|
+
| "slh-dsa-shake-192s"
|
|
3701
|
+
| "slh-dsa-shake-256f"
|
|
3702
|
+
| "slh-dsa-shake-256s",
|
|
3703
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
3704
|
+
): Promise<{
|
|
3705
|
+
publicKey: string;
|
|
3706
|
+
privateKey: Buffer;
|
|
3707
|
+
}>;
|
|
3708
|
+
function __promisify__(
|
|
3709
|
+
type:
|
|
3710
|
+
| "slh-dsa-sha2-128f"
|
|
3711
|
+
| "slh-dsa-sha2-128s"
|
|
3712
|
+
| "slh-dsa-sha2-192f"
|
|
3713
|
+
| "slh-dsa-sha2-192s"
|
|
3714
|
+
| "slh-dsa-sha2-256f"
|
|
3715
|
+
| "slh-dsa-sha2-256s"
|
|
3716
|
+
| "slh-dsa-shake-128f"
|
|
3717
|
+
| "slh-dsa-shake-128s"
|
|
3718
|
+
| "slh-dsa-shake-192f"
|
|
3719
|
+
| "slh-dsa-shake-192s"
|
|
3720
|
+
| "slh-dsa-shake-256f"
|
|
3721
|
+
| "slh-dsa-shake-256s",
|
|
3722
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
3723
|
+
): Promise<{
|
|
3724
|
+
publicKey: Buffer;
|
|
3725
|
+
privateKey: string;
|
|
3726
|
+
}>;
|
|
3727
|
+
function __promisify__(
|
|
3728
|
+
type:
|
|
3729
|
+
| "slh-dsa-sha2-128f"
|
|
3730
|
+
| "slh-dsa-sha2-128s"
|
|
3731
|
+
| "slh-dsa-sha2-192f"
|
|
3732
|
+
| "slh-dsa-sha2-192s"
|
|
3733
|
+
| "slh-dsa-sha2-256f"
|
|
3734
|
+
| "slh-dsa-sha2-256s"
|
|
3735
|
+
| "slh-dsa-shake-128f"
|
|
3736
|
+
| "slh-dsa-shake-128s"
|
|
3737
|
+
| "slh-dsa-shake-192f"
|
|
3738
|
+
| "slh-dsa-shake-192s"
|
|
3739
|
+
| "slh-dsa-shake-256f"
|
|
3740
|
+
| "slh-dsa-shake-256s",
|
|
3741
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
3742
|
+
): Promise<{
|
|
3743
|
+
publicKey: Buffer;
|
|
3744
|
+
privateKey: Buffer;
|
|
3745
|
+
}>;
|
|
3746
|
+
function __promisify__(
|
|
3747
|
+
type:
|
|
3748
|
+
| "slh-dsa-sha2-128f"
|
|
3749
|
+
| "slh-dsa-sha2-128s"
|
|
3750
|
+
| "slh-dsa-sha2-192f"
|
|
3751
|
+
| "slh-dsa-sha2-192s"
|
|
3752
|
+
| "slh-dsa-sha2-256f"
|
|
3753
|
+
| "slh-dsa-sha2-256s"
|
|
3754
|
+
| "slh-dsa-shake-128f"
|
|
3755
|
+
| "slh-dsa-shake-128s"
|
|
3756
|
+
| "slh-dsa-shake-192f"
|
|
3757
|
+
| "slh-dsa-shake-192s"
|
|
3758
|
+
| "slh-dsa-shake-256f"
|
|
3759
|
+
| "slh-dsa-shake-256s",
|
|
3760
|
+
options?: SLHDSAKeyPairKeyObjectOptions,
|
|
3761
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3403
3762
|
}
|
|
3404
3763
|
/**
|
|
3405
3764
|
* Calculates and returns the signature for `data` using the given private key and
|
|
@@ -3461,9 +3820,37 @@ declare module "crypto" {
|
|
|
3461
3820
|
callback: (error: Error | null, result: boolean) => void,
|
|
3462
3821
|
): void;
|
|
3463
3822
|
/**
|
|
3464
|
-
*
|
|
3465
|
-
*
|
|
3466
|
-
*
|
|
3823
|
+
* Key decapsulation using a KEM algorithm with a private key.
|
|
3824
|
+
*
|
|
3825
|
+
* Supported key types and their KEM algorithms are:
|
|
3826
|
+
*
|
|
3827
|
+
* * `'rsa'` RSA Secret Value Encapsulation
|
|
3828
|
+
* * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
|
|
3829
|
+
* * `'x25519'` DHKEM(X25519, HKDF-SHA256)
|
|
3830
|
+
* * `'x448'` DHKEM(X448, HKDF-SHA512)
|
|
3831
|
+
* * `'ml-kem-512'` ML-KEM
|
|
3832
|
+
* * `'ml-kem-768'` ML-KEM
|
|
3833
|
+
* * `'ml-kem-1024'` ML-KEM
|
|
3834
|
+
*
|
|
3835
|
+
* If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
|
|
3836
|
+
* passed to `crypto.createPrivateKey()`.
|
|
3837
|
+
*
|
|
3838
|
+
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3839
|
+
* @since v24.7.0
|
|
3840
|
+
*/
|
|
3841
|
+
function decapsulate(
|
|
3842
|
+
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3843
|
+
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3844
|
+
): Buffer;
|
|
3845
|
+
function decapsulate(
|
|
3846
|
+
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3847
|
+
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3848
|
+
callback: (err: Error, sharedKey: Buffer) => void,
|
|
3849
|
+
): void;
|
|
3850
|
+
/**
|
|
3851
|
+
* Computes the Diffie-Hellman shared secret based on a `privateKey` and a `publicKey`.
|
|
3852
|
+
* Both keys must have the same `asymmetricKeyType` and must support either the DH or
|
|
3853
|
+
* ECDH operation.
|
|
3467
3854
|
*
|
|
3468
3855
|
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3469
3856
|
* @since v13.9.0, v12.17.0
|
|
@@ -3473,6 +3860,30 @@ declare module "crypto" {
|
|
|
3473
3860
|
options: { privateKey: KeyObject; publicKey: KeyObject },
|
|
3474
3861
|
callback: (err: Error | null, secret: Buffer) => void,
|
|
3475
3862
|
): void;
|
|
3863
|
+
/**
|
|
3864
|
+
* Key encapsulation using a KEM algorithm with a public key.
|
|
3865
|
+
*
|
|
3866
|
+
* Supported key types and their KEM algorithms are:
|
|
3867
|
+
*
|
|
3868
|
+
* * `'rsa'` RSA Secret Value Encapsulation
|
|
3869
|
+
* * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
|
|
3870
|
+
* * `'x25519'` DHKEM(X25519, HKDF-SHA256)
|
|
3871
|
+
* * `'x448'` DHKEM(X448, HKDF-SHA512)
|
|
3872
|
+
* * `'ml-kem-512'` ML-KEM
|
|
3873
|
+
* * `'ml-kem-768'` ML-KEM
|
|
3874
|
+
* * `'ml-kem-1024'` ML-KEM
|
|
3875
|
+
*
|
|
3876
|
+
* If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
|
|
3877
|
+
* passed to `crypto.createPublicKey()`.
|
|
3878
|
+
*
|
|
3879
|
+
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3880
|
+
* @since v24.7.0
|
|
3881
|
+
*/
|
|
3882
|
+
function encapsulate(key: KeyLike | PublicKeyInput | JsonWebKeyInput): { sharedKey: Buffer; ciphertext: Buffer };
|
|
3883
|
+
function encapsulate(
|
|
3884
|
+
key: KeyLike | PublicKeyInput | JsonWebKeyInput,
|
|
3885
|
+
callback: (err: Error, result: { sharedKey: Buffer; ciphertext: Buffer }) => void,
|
|
3886
|
+
): void;
|
|
3476
3887
|
interface OneShotDigestOptions {
|
|
3477
3888
|
/**
|
|
3478
3889
|
* Encoding used to encode the returned digest.
|
|
@@ -3705,23 +4116,23 @@ declare module "crypto" {
|
|
|
3705
4116
|
/**
|
|
3706
4117
|
* @default 'always'
|
|
3707
4118
|
*/
|
|
3708
|
-
subject?: "always" | "default" | "never";
|
|
4119
|
+
subject?: "always" | "default" | "never" | undefined;
|
|
3709
4120
|
/**
|
|
3710
4121
|
* @default true
|
|
3711
4122
|
*/
|
|
3712
|
-
wildcards?: boolean;
|
|
4123
|
+
wildcards?: boolean | undefined;
|
|
3713
4124
|
/**
|
|
3714
4125
|
* @default true
|
|
3715
4126
|
*/
|
|
3716
|
-
partialWildcards?: boolean;
|
|
4127
|
+
partialWildcards?: boolean | undefined;
|
|
3717
4128
|
/**
|
|
3718
4129
|
* @default false
|
|
3719
4130
|
*/
|
|
3720
|
-
multiLabelWildcards?: boolean;
|
|
4131
|
+
multiLabelWildcards?: boolean | undefined;
|
|
3721
4132
|
/**
|
|
3722
4133
|
* @default false
|
|
3723
4134
|
*/
|
|
3724
|
-
singleLabelSubdomains?: boolean;
|
|
4135
|
+
singleLabelSubdomains?: boolean | undefined;
|
|
3725
4136
|
}
|
|
3726
4137
|
/**
|
|
3727
4138
|
* Encapsulates an X509 certificate and provides read-only access to
|
|
@@ -3823,7 +4234,7 @@ declare module "crypto" {
|
|
|
3823
4234
|
* available.
|
|
3824
4235
|
* @since v15.9.0
|
|
3825
4236
|
*/
|
|
3826
|
-
readonly issuerCertificate
|
|
4237
|
+
readonly issuerCertificate: X509Certificate | undefined;
|
|
3827
4238
|
/**
|
|
3828
4239
|
* The public key `KeyObject` for this certificate.
|
|
3829
4240
|
* @since v15.6.0
|
|
@@ -4115,6 +4526,130 @@ declare module "crypto" {
|
|
|
4115
4526
|
* @return Returns `typedArray`.
|
|
4116
4527
|
*/
|
|
4117
4528
|
function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
|
|
4529
|
+
type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id";
|
|
4530
|
+
interface Argon2Parameters {
|
|
4531
|
+
/**
|
|
4532
|
+
* REQUIRED, this is the password for password hashing applications of Argon2.
|
|
4533
|
+
*/
|
|
4534
|
+
message: string | ArrayBuffer | NodeJS.ArrayBufferView;
|
|
4535
|
+
/**
|
|
4536
|
+
* REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.
|
|
4537
|
+
*/
|
|
4538
|
+
nonce: string | ArrayBuffer | NodeJS.ArrayBufferView;
|
|
4539
|
+
/**
|
|
4540
|
+
* REQUIRED, degree of parallelism determines how many computational chains (lanes)
|
|
4541
|
+
* can be run. Must be greater than 1 and less than `2**24-1`.
|
|
4542
|
+
*/
|
|
4543
|
+
parallelism: number;
|
|
4544
|
+
/**
|
|
4545
|
+
* REQUIRED, the length of the key to generate. Must be greater than 4 and
|
|
4546
|
+
* less than `2**32-1`.
|
|
4547
|
+
*/
|
|
4548
|
+
tagLength: number;
|
|
4549
|
+
/**
|
|
4550
|
+
* REQUIRED, memory cost in 1KiB blocks. Must be greater than
|
|
4551
|
+
* `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded
|
|
4552
|
+
* down to the nearest multiple of `4 * parallelism`.
|
|
4553
|
+
*/
|
|
4554
|
+
memory: number;
|
|
4555
|
+
/**
|
|
4556
|
+
* REQUIRED, number of passes (iterations). Must be greater than 1 and less
|
|
4557
|
+
* than `2**32-1`.
|
|
4558
|
+
*/
|
|
4559
|
+
passes: number;
|
|
4560
|
+
/**
|
|
4561
|
+
* OPTIONAL, Random additional input,
|
|
4562
|
+
* similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in
|
|
4563
|
+
* password hashing applications. If used, must have a length not greater than `2**32-1` bytes.
|
|
4564
|
+
*/
|
|
4565
|
+
secret?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
4566
|
+
/**
|
|
4567
|
+
* OPTIONAL, Additional data to
|
|
4568
|
+
* be added to the hash, functionally equivalent to salt or secret, but meant for
|
|
4569
|
+
* non-random data. If used, must have a length not greater than `2**32-1` bytes.
|
|
4570
|
+
*/
|
|
4571
|
+
associatedData?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
4572
|
+
}
|
|
4573
|
+
/**
|
|
4574
|
+
* Provides an asynchronous [Argon2](https://www.rfc-editor.org/rfc/rfc9106.html) implementation. Argon2 is a password-based
|
|
4575
|
+
* key derivation function that is designed to be expensive computationally and
|
|
4576
|
+
* memory-wise in order to make brute-force attacks unrewarding.
|
|
4577
|
+
*
|
|
4578
|
+
* The `nonce` should be as unique as possible. It is recommended that a nonce is
|
|
4579
|
+
* random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
|
|
4580
|
+
*
|
|
4581
|
+
* When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
|
|
4582
|
+
* consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
|
|
4583
|
+
*
|
|
4584
|
+
* The `callback` function is called with two arguments: `err` and `derivedKey`.
|
|
4585
|
+
* `err` is an exception object when key derivation fails, otherwise `err` is
|
|
4586
|
+
* `null`. `derivedKey` is passed to the callback as a `Buffer`.
|
|
4587
|
+
*
|
|
4588
|
+
* An exception is thrown when any of the input arguments specify invalid values
|
|
4589
|
+
* or types.
|
|
4590
|
+
*
|
|
4591
|
+
* ```js
|
|
4592
|
+
* const { argon2, randomBytes } = await import('node:crypto');
|
|
4593
|
+
*
|
|
4594
|
+
* const parameters = {
|
|
4595
|
+
* message: 'password',
|
|
4596
|
+
* nonce: randomBytes(16),
|
|
4597
|
+
* parallelism: 4,
|
|
4598
|
+
* tagLength: 64,
|
|
4599
|
+
* memory: 65536,
|
|
4600
|
+
* passes: 3,
|
|
4601
|
+
* };
|
|
4602
|
+
*
|
|
4603
|
+
* argon2('argon2id', parameters, (err, derivedKey) => {
|
|
4604
|
+
* if (err) throw err;
|
|
4605
|
+
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
4606
|
+
* });
|
|
4607
|
+
* ```
|
|
4608
|
+
* @since v24.7.0
|
|
4609
|
+
* @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
|
|
4610
|
+
* @experimental
|
|
4611
|
+
*/
|
|
4612
|
+
function argon2(
|
|
4613
|
+
algorithm: Argon2Algorithm,
|
|
4614
|
+
parameters: Argon2Parameters,
|
|
4615
|
+
callback: (err: Error | null, derivedKey: Buffer) => void,
|
|
4616
|
+
): void;
|
|
4617
|
+
/**
|
|
4618
|
+
* Provides a synchronous [Argon2][] implementation. Argon2 is a password-based
|
|
4619
|
+
* key derivation function that is designed to be expensive computationally and
|
|
4620
|
+
* memory-wise in order to make brute-force attacks unrewarding.
|
|
4621
|
+
*
|
|
4622
|
+
* The `nonce` should be as unique as possible. It is recommended that a nonce is
|
|
4623
|
+
* random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
|
|
4624
|
+
*
|
|
4625
|
+
* When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
|
|
4626
|
+
* consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
|
|
4627
|
+
*
|
|
4628
|
+
* An exception is thrown when key derivation fails, otherwise the derived key is
|
|
4629
|
+
* returned as a `Buffer`.
|
|
4630
|
+
*
|
|
4631
|
+
* An exception is thrown when any of the input arguments specify invalid values
|
|
4632
|
+
* or types.
|
|
4633
|
+
*
|
|
4634
|
+
* ```js
|
|
4635
|
+
* const { argon2Sync, randomBytes } = await import('node:crypto');
|
|
4636
|
+
*
|
|
4637
|
+
* const parameters = {
|
|
4638
|
+
* message: 'password',
|
|
4639
|
+
* nonce: randomBytes(16),
|
|
4640
|
+
* parallelism: 4,
|
|
4641
|
+
* tagLength: 64,
|
|
4642
|
+
* memory: 65536,
|
|
4643
|
+
* passes: 3,
|
|
4644
|
+
* };
|
|
4645
|
+
*
|
|
4646
|
+
* const derivedKey = argon2Sync('argon2id', parameters);
|
|
4647
|
+
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
4648
|
+
* ```
|
|
4649
|
+
* @since v24.7.0
|
|
4650
|
+
* @experimental
|
|
4651
|
+
*/
|
|
4652
|
+
function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): Buffer;
|
|
4118
4653
|
/**
|
|
4119
4654
|
* A convenient alias for `crypto.webcrypto.subtle`.
|
|
4120
4655
|
* @since v17.4.0
|
|
@@ -4129,21 +4664,30 @@ declare module "crypto" {
|
|
|
4129
4664
|
const webcrypto: webcrypto.Crypto;
|
|
4130
4665
|
namespace webcrypto {
|
|
4131
4666
|
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
4132
|
-
type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
|
|
4667
|
+
type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki";
|
|
4133
4668
|
type KeyType = "private" | "public" | "secret";
|
|
4134
4669
|
type KeyUsage =
|
|
4135
|
-
| "decrypt"
|
|
4136
|
-
| "deriveBits"
|
|
4137
|
-
| "deriveKey"
|
|
4138
4670
|
| "encrypt"
|
|
4671
|
+
| "decrypt"
|
|
4139
4672
|
| "sign"
|
|
4140
|
-
| "unwrapKey"
|
|
4141
4673
|
| "verify"
|
|
4142
|
-
| "
|
|
4674
|
+
| "deriveKey"
|
|
4675
|
+
| "deriveBits"
|
|
4676
|
+
| "encapsulateBits"
|
|
4677
|
+
| "decapsulateBits"
|
|
4678
|
+
| "encapsulateKey"
|
|
4679
|
+
| "decapsulateKey"
|
|
4680
|
+
| "wrapKey"
|
|
4681
|
+
| "unwrapKey";
|
|
4143
4682
|
type AlgorithmIdentifier = Algorithm | string;
|
|
4144
4683
|
type HashAlgorithmIdentifier = AlgorithmIdentifier;
|
|
4145
4684
|
type NamedCurve = string;
|
|
4146
4685
|
type BigInteger = Uint8Array;
|
|
4686
|
+
interface AeadParams extends Algorithm {
|
|
4687
|
+
additionalData?: BufferSource;
|
|
4688
|
+
iv: BufferSource;
|
|
4689
|
+
tagLength: number;
|
|
4690
|
+
}
|
|
4147
4691
|
interface AesCbcParams extends Algorithm {
|
|
4148
4692
|
iv: BufferSource;
|
|
4149
4693
|
}
|
|
@@ -4154,6 +4698,8 @@ declare module "crypto" {
|
|
|
4154
4698
|
interface AesDerivedKeyParams extends Algorithm {
|
|
4155
4699
|
length: number;
|
|
4156
4700
|
}
|
|
4701
|
+
// TODO: remove in next major
|
|
4702
|
+
/** @deprecated Replaced by `AeadParams`. */
|
|
4157
4703
|
interface AesGcmParams extends Algorithm {
|
|
4158
4704
|
additionalData?: BufferSource;
|
|
4159
4705
|
iv: BufferSource;
|
|
@@ -4168,6 +4714,23 @@ declare module "crypto" {
|
|
|
4168
4714
|
interface Algorithm {
|
|
4169
4715
|
name: string;
|
|
4170
4716
|
}
|
|
4717
|
+
interface Argon2Params extends Algorithm {
|
|
4718
|
+
associatedData?: BufferSource;
|
|
4719
|
+
memory: number;
|
|
4720
|
+
nonce: BufferSource;
|
|
4721
|
+
parallelism: number;
|
|
4722
|
+
passes: number;
|
|
4723
|
+
secretValue?: BufferSource;
|
|
4724
|
+
version?: number;
|
|
4725
|
+
}
|
|
4726
|
+
interface CShakeParams extends Algorithm {
|
|
4727
|
+
customization?: BufferSource;
|
|
4728
|
+
functionName?: BufferSource;
|
|
4729
|
+
length: number;
|
|
4730
|
+
}
|
|
4731
|
+
interface ContextParams extends Algorithm {
|
|
4732
|
+
context?: BufferSource;
|
|
4733
|
+
}
|
|
4171
4734
|
interface EcKeyAlgorithm extends KeyAlgorithm {
|
|
4172
4735
|
namedCurve: NamedCurve;
|
|
4173
4736
|
}
|
|
@@ -4183,9 +4746,6 @@ declare module "crypto" {
|
|
|
4183
4746
|
interface EcdsaParams extends Algorithm {
|
|
4184
4747
|
hash: HashAlgorithmIdentifier;
|
|
4185
4748
|
}
|
|
4186
|
-
interface Ed448Params extends Algorithm {
|
|
4187
|
-
context?: BufferSource;
|
|
4188
|
-
}
|
|
4189
4749
|
interface HkdfParams extends Algorithm {
|
|
4190
4750
|
hash: HashAlgorithmIdentifier;
|
|
4191
4751
|
info: BufferSource;
|
|
@@ -4226,6 +4786,19 @@ declare module "crypto" {
|
|
|
4226
4786
|
interface KeyAlgorithm {
|
|
4227
4787
|
name: string;
|
|
4228
4788
|
}
|
|
4789
|
+
interface KmacImportParams extends Algorithm {
|
|
4790
|
+
length?: number;
|
|
4791
|
+
}
|
|
4792
|
+
interface KmacKeyAlgorithm extends KeyAlgorithm {
|
|
4793
|
+
length: number;
|
|
4794
|
+
}
|
|
4795
|
+
interface KmacKeyGenParams extends Algorithm {
|
|
4796
|
+
length?: number;
|
|
4797
|
+
}
|
|
4798
|
+
interface KmacParams extends Algorithm {
|
|
4799
|
+
customization?: BufferSource;
|
|
4800
|
+
length: number;
|
|
4801
|
+
}
|
|
4229
4802
|
interface Pbkdf2Params extends Algorithm {
|
|
4230
4803
|
hash: HashAlgorithmIdentifier;
|
|
4231
4804
|
iterations: number;
|
|
@@ -4279,22 +4852,15 @@ declare module "crypto" {
|
|
|
4279
4852
|
* An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
|
|
4280
4853
|
* @since v15.0.0
|
|
4281
4854
|
*/
|
|
4282
|
-
getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(
|
|
4855
|
+
getRandomValues<T extends Exclude<NodeJS.TypedArray, Float16Array | Float32Array | Float64Array>>(
|
|
4856
|
+
typedArray: T,
|
|
4857
|
+
): T;
|
|
4283
4858
|
/**
|
|
4284
4859
|
* Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
|
|
4285
4860
|
* The UUID is generated using a cryptographic pseudorandom number generator.
|
|
4286
4861
|
* @since v16.7.0
|
|
4287
4862
|
*/
|
|
4288
4863
|
randomUUID(): UUID;
|
|
4289
|
-
CryptoKey: CryptoKeyConstructor;
|
|
4290
|
-
}
|
|
4291
|
-
// This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
|
|
4292
|
-
interface CryptoKeyConstructor {
|
|
4293
|
-
/** Illegal constructor */
|
|
4294
|
-
(_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
|
|
4295
|
-
readonly length: 0;
|
|
4296
|
-
readonly name: "CryptoKey";
|
|
4297
|
-
readonly prototype: CryptoKey;
|
|
4298
4864
|
}
|
|
4299
4865
|
/**
|
|
4300
4866
|
* @since v15.0.0
|
|
@@ -4349,31 +4915,81 @@ declare module "crypto" {
|
|
|
4349
4915
|
*/
|
|
4350
4916
|
publicKey: CryptoKey;
|
|
4351
4917
|
}
|
|
4918
|
+
interface EncapsulatedBits {
|
|
4919
|
+
sharedKey: ArrayBuffer;
|
|
4920
|
+
ciphertext: ArrayBuffer;
|
|
4921
|
+
}
|
|
4922
|
+
interface EncapsulatedKey {
|
|
4923
|
+
sharedKey: CryptoKey;
|
|
4924
|
+
ciphertext: ArrayBuffer;
|
|
4925
|
+
}
|
|
4352
4926
|
/**
|
|
4353
4927
|
* @since v15.0.0
|
|
4354
4928
|
*/
|
|
4355
4929
|
interface SubtleCrypto {
|
|
4930
|
+
/**
|
|
4931
|
+
* A message recipient uses their asymmetric private key to decrypt an
|
|
4932
|
+
* "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
|
|
4933
|
+
* key (represented as `ArrayBuffer`) which is then used to decrypt a message.
|
|
4934
|
+
*
|
|
4935
|
+
* The algorithms currently supported include:
|
|
4936
|
+
*
|
|
4937
|
+
* * `'ML-KEM-512'`
|
|
4938
|
+
* * `'ML-KEM-768'`
|
|
4939
|
+
* * `'ML-KEM-1024'`
|
|
4940
|
+
* @since v24.7.0
|
|
4941
|
+
* @returns Fulfills with `ArrayBuffer` upon success.
|
|
4942
|
+
*/
|
|
4943
|
+
decapsulateBits(
|
|
4944
|
+
decapsulationAlgorithm: AlgorithmIdentifier,
|
|
4945
|
+
decapsulationKey: CryptoKey,
|
|
4946
|
+
ciphertext: BufferSource,
|
|
4947
|
+
): Promise<ArrayBuffer>;
|
|
4948
|
+
/**
|
|
4949
|
+
* A message recipient uses their asymmetric private key to decrypt an
|
|
4950
|
+
* "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
|
|
4951
|
+
* key (represented as `CryptoKey`) which is then used to decrypt a message.
|
|
4952
|
+
*
|
|
4953
|
+
* The algorithms currently supported include:
|
|
4954
|
+
*
|
|
4955
|
+
* * `'ML-KEM-512'`
|
|
4956
|
+
* * `'ML-KEM-768'`
|
|
4957
|
+
* * `'ML-KEM-1024'`
|
|
4958
|
+
* @since v24.7.0
|
|
4959
|
+
* @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
|
|
4960
|
+
* @returns Fulfills with `CryptoKey` upon success.
|
|
4961
|
+
*/
|
|
4962
|
+
decapsulateKey(
|
|
4963
|
+
decapsulationAlgorithm: AlgorithmIdentifier,
|
|
4964
|
+
decapsulationKey: CryptoKey,
|
|
4965
|
+
ciphertext: BufferSource,
|
|
4966
|
+
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4967
|
+
extractable: boolean,
|
|
4968
|
+
usages: KeyUsage[],
|
|
4969
|
+
): Promise<CryptoKey>;
|
|
4356
4970
|
/**
|
|
4357
4971
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
4358
|
-
*
|
|
4972
|
+
* this method attempts to decipher the provided `data`. If successful,
|
|
4359
4973
|
* the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
|
|
4360
4974
|
*
|
|
4361
4975
|
* The algorithms currently supported include:
|
|
4362
4976
|
*
|
|
4363
|
-
*
|
|
4364
|
-
*
|
|
4365
|
-
*
|
|
4366
|
-
*
|
|
4977
|
+
* * `'AES-CBC'`
|
|
4978
|
+
* * `'AES-CTR'`
|
|
4979
|
+
* * `'AES-GCM'`
|
|
4980
|
+
* * `'AES-OCB'`
|
|
4981
|
+
* * `'ChaCha20-Poly1305'`
|
|
4982
|
+
* * `'RSA-OAEP'`
|
|
4367
4983
|
* @since v15.0.0
|
|
4368
4984
|
*/
|
|
4369
4985
|
decrypt(
|
|
4370
|
-
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
4986
|
+
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4371
4987
|
key: CryptoKey,
|
|
4372
4988
|
data: BufferSource,
|
|
4373
4989
|
): Promise<ArrayBuffer>;
|
|
4374
4990
|
/**
|
|
4375
4991
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
|
|
4376
|
-
*
|
|
4992
|
+
* this method attempts to generate `length` bits.
|
|
4377
4993
|
* The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
|
|
4378
4994
|
* When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
|
|
4379
4995
|
* for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
|
|
@@ -4381,11 +4997,14 @@ declare module "crypto" {
|
|
|
4381
4997
|
*
|
|
4382
4998
|
* The algorithms currently supported include:
|
|
4383
4999
|
*
|
|
4384
|
-
*
|
|
4385
|
-
*
|
|
4386
|
-
*
|
|
4387
|
-
*
|
|
4388
|
-
*
|
|
5000
|
+
* * `'Argon2d'`
|
|
5001
|
+
* * `'Argon2i'`
|
|
5002
|
+
* * `'Argon2id'`
|
|
5003
|
+
* * `'ECDH'`
|
|
5004
|
+
* * `'HKDF'`
|
|
5005
|
+
* * `'PBKDF2'`
|
|
5006
|
+
* * `'X25519'`
|
|
5007
|
+
* * `'X448'`
|
|
4389
5008
|
* @since v15.0.0
|
|
4390
5009
|
*/
|
|
4391
5010
|
deriveBits(
|
|
@@ -4394,31 +5013,34 @@ declare module "crypto" {
|
|
|
4394
5013
|
length?: number | null,
|
|
4395
5014
|
): Promise<ArrayBuffer>;
|
|
4396
5015
|
deriveBits(
|
|
4397
|
-
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
5016
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
|
|
4398
5017
|
baseKey: CryptoKey,
|
|
4399
5018
|
length: number,
|
|
4400
5019
|
): Promise<ArrayBuffer>;
|
|
4401
5020
|
/**
|
|
4402
5021
|
* Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
|
|
4403
|
-
*
|
|
5022
|
+
* this method attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
|
|
4404
5023
|
*
|
|
4405
5024
|
* Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
|
|
4406
5025
|
* then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
|
|
4407
5026
|
*
|
|
4408
5027
|
* The algorithms currently supported include:
|
|
4409
5028
|
*
|
|
4410
|
-
*
|
|
4411
|
-
*
|
|
4412
|
-
*
|
|
4413
|
-
*
|
|
4414
|
-
*
|
|
5029
|
+
* * `'Argon2d'`
|
|
5030
|
+
* * `'Argon2i'`
|
|
5031
|
+
* * `'Argon2id'`
|
|
5032
|
+
* * `'ECDH'`
|
|
5033
|
+
* * `'HKDF'`
|
|
5034
|
+
* * `'PBKDF2'`
|
|
5035
|
+
* * `'X25519'`
|
|
5036
|
+
* * `'X448'`
|
|
4415
5037
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4416
5038
|
* @since v15.0.0
|
|
4417
5039
|
*/
|
|
4418
5040
|
deriveKey(
|
|
4419
|
-
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
5041
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
|
|
4420
5042
|
baseKey: CryptoKey,
|
|
4421
|
-
derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
|
|
5043
|
+
derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4422
5044
|
extractable: boolean,
|
|
4423
5045
|
keyUsages: readonly KeyUsage[],
|
|
4424
5046
|
): Promise<CryptoKey>;
|
|
@@ -4428,30 +5050,73 @@ declare module "crypto" {
|
|
|
4428
5050
|
*
|
|
4429
5051
|
* If `algorithm` is provided as a `<string>`, it must be one of:
|
|
4430
5052
|
*
|
|
4431
|
-
*
|
|
4432
|
-
*
|
|
4433
|
-
*
|
|
4434
|
-
*
|
|
5053
|
+
* * `'cSHAKE128'`
|
|
5054
|
+
* * `'cSHAKE256'`
|
|
5055
|
+
* * `'SHA-1'`
|
|
5056
|
+
* * `'SHA-256'`
|
|
5057
|
+
* * `'SHA-384'`
|
|
5058
|
+
* * `'SHA-512'`
|
|
5059
|
+
* * `'SHA3-256'`
|
|
5060
|
+
* * `'SHA3-384'`
|
|
5061
|
+
* * `'SHA3-512'`
|
|
4435
5062
|
*
|
|
4436
5063
|
* If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
|
|
4437
5064
|
* @since v15.0.0
|
|
4438
5065
|
*/
|
|
4439
|
-
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
|
5066
|
+
digest(algorithm: AlgorithmIdentifier | CShakeParams, data: BufferSource): Promise<ArrayBuffer>;
|
|
5067
|
+
/**
|
|
5068
|
+
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5069
|
+
* This encrypted key is the "encapsulated key" represented as `EncapsulatedBits`.
|
|
5070
|
+
*
|
|
5071
|
+
* The algorithms currently supported include:
|
|
5072
|
+
*
|
|
5073
|
+
* * `'ML-KEM-512'`
|
|
5074
|
+
* * `'ML-KEM-768'`
|
|
5075
|
+
* * `'ML-KEM-1024'`
|
|
5076
|
+
* @since v24.7.0
|
|
5077
|
+
* @returns Fulfills with `EncapsulatedBits` upon success.
|
|
5078
|
+
*/
|
|
5079
|
+
encapsulateBits(
|
|
5080
|
+
encapsulationAlgorithm: AlgorithmIdentifier,
|
|
5081
|
+
encapsulationKey: CryptoKey,
|
|
5082
|
+
): Promise<EncapsulatedBits>;
|
|
5083
|
+
/**
|
|
5084
|
+
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5085
|
+
* This encrypted key is the "encapsulated key" represented as `EncapsulatedKey`.
|
|
5086
|
+
*
|
|
5087
|
+
* The algorithms currently supported include:
|
|
5088
|
+
*
|
|
5089
|
+
* * `'ML-KEM-512'`
|
|
5090
|
+
* * `'ML-KEM-768'`
|
|
5091
|
+
* * `'ML-KEM-1024'`
|
|
5092
|
+
* @since v24.7.0
|
|
5093
|
+
* @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
|
|
5094
|
+
* @returns Fulfills with `EncapsulatedKey` upon success.
|
|
5095
|
+
*/
|
|
5096
|
+
encapsulateKey(
|
|
5097
|
+
encapsulationAlgorithm: AlgorithmIdentifier,
|
|
5098
|
+
encapsulationKey: CryptoKey,
|
|
5099
|
+
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
5100
|
+
extractable: boolean,
|
|
5101
|
+
usages: KeyUsage[],
|
|
5102
|
+
): Promise<EncapsulatedKey>;
|
|
4440
5103
|
/**
|
|
4441
5104
|
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|
|
4442
|
-
*
|
|
5105
|
+
* this method attempts to encipher `data`. If successful,
|
|
4443
5106
|
* the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
|
|
4444
5107
|
*
|
|
4445
5108
|
* The algorithms currently supported include:
|
|
4446
5109
|
*
|
|
4447
|
-
*
|
|
4448
|
-
*
|
|
4449
|
-
*
|
|
4450
|
-
*
|
|
5110
|
+
* * `'AES-CBC'`
|
|
5111
|
+
* * `'AES-CTR'`
|
|
5112
|
+
* * `'AES-GCM'`
|
|
5113
|
+
* * `'AES-OCB'`
|
|
5114
|
+
* * `'ChaCha20-Poly1305'`
|
|
5115
|
+
* * `'RSA-OAEP'`
|
|
4451
5116
|
* @since v15.0.0
|
|
4452
5117
|
*/
|
|
4453
5118
|
encrypt(
|
|
4454
|
-
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
5119
|
+
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4455
5120
|
key: CryptoKey,
|
|
4456
5121
|
data: BufferSource,
|
|
4457
5122
|
): Promise<ArrayBuffer>;
|
|
@@ -4465,35 +5130,47 @@ declare module "crypto" {
|
|
|
4465
5130
|
*
|
|
4466
5131
|
* When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
|
|
4467
5132
|
* JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
|
|
4468
|
-
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`,
|
|
5133
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5134
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4469
5135
|
* @returns `<Promise>` containing `<ArrayBuffer>`.
|
|
4470
5136
|
* @since v15.0.0
|
|
4471
5137
|
*/
|
|
4472
5138
|
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
|
4473
5139
|
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
|
4474
5140
|
/**
|
|
4475
|
-
* Using the method and parameters provided in `algorithm`,
|
|
4476
|
-
*
|
|
4477
|
-
*
|
|
5141
|
+
* Using the method and parameters provided in `algorithm`, `subtle.generateKey()`
|
|
5142
|
+
* attempts to generate new keying material. Depending the method used, the method
|
|
5143
|
+
* may generate either a single `CryptoKey` or a `CryptoKeyPair`.
|
|
4478
5144
|
*
|
|
4479
|
-
* The
|
|
5145
|
+
* The `CryptoKeyPair` (public and private key) generating algorithms supported
|
|
5146
|
+
* include:
|
|
4480
5147
|
*
|
|
4481
|
-
*
|
|
4482
|
-
*
|
|
4483
|
-
*
|
|
4484
|
-
*
|
|
4485
|
-
*
|
|
4486
|
-
*
|
|
4487
|
-
*
|
|
4488
|
-
*
|
|
4489
|
-
*
|
|
4490
|
-
*
|
|
5148
|
+
* * `'ECDH'`
|
|
5149
|
+
* * `'ECDSA'`
|
|
5150
|
+
* * `'Ed25519'`
|
|
5151
|
+
* * `'Ed448'`
|
|
5152
|
+
* * `'ML-DSA-44'`
|
|
5153
|
+
* * `'ML-DSA-65'`
|
|
5154
|
+
* * `'ML-DSA-87'`
|
|
5155
|
+
* * `'ML-KEM-512'`
|
|
5156
|
+
* * `'ML-KEM-768'`
|
|
5157
|
+
* * `'ML-KEM-1024'`
|
|
5158
|
+
* * `'RSA-OAEP'`
|
|
5159
|
+
* * `'RSA-PSS'`
|
|
5160
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
5161
|
+
* * `'X25519'`
|
|
5162
|
+
* * `'X448'`
|
|
4491
5163
|
*
|
|
4492
|
-
*
|
|
4493
|
-
*
|
|
4494
|
-
*
|
|
4495
|
-
*
|
|
4496
|
-
*
|
|
5164
|
+
* The `CryptoKey` (secret key) generating algorithms supported include:
|
|
5165
|
+
* * `'AES-CBC'`
|
|
5166
|
+
* * `'AES-CTR'`
|
|
5167
|
+
* * `'AES-GCM'`
|
|
5168
|
+
* * `'AES-KW'`
|
|
5169
|
+
* * `'AES-OCB'`
|
|
5170
|
+
* * `'ChaCha20-Poly1305'`
|
|
5171
|
+
* * `'HMAC'`
|
|
5172
|
+
* * `'KMAC128'`
|
|
5173
|
+
* * `'KMAC256'`
|
|
4497
5174
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4498
5175
|
* @since v15.0.0
|
|
4499
5176
|
*/
|
|
@@ -4503,7 +5180,7 @@ declare module "crypto" {
|
|
|
4503
5180
|
keyUsages: readonly KeyUsage[],
|
|
4504
5181
|
): Promise<CryptoKeyPair>;
|
|
4505
5182
|
generateKey(
|
|
4506
|
-
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
|
|
5183
|
+
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams,
|
|
4507
5184
|
extractable: boolean,
|
|
4508
5185
|
keyUsages: readonly KeyUsage[],
|
|
4509
5186
|
): Promise<CryptoKey>;
|
|
@@ -4512,13 +5189,22 @@ declare module "crypto" {
|
|
|
4512
5189
|
extractable: boolean,
|
|
4513
5190
|
keyUsages: KeyUsage[],
|
|
4514
5191
|
): Promise<CryptoKeyPair | CryptoKey>;
|
|
5192
|
+
/**
|
|
5193
|
+
* Derives the public key from a given private key.
|
|
5194
|
+
* @since v24.7.0
|
|
5195
|
+
* @param key A private key from which to derive the corresponding public key.
|
|
5196
|
+
* @param keyUsages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
|
|
5197
|
+
* @returns Fulfills with a `CryptoKey` upon success.
|
|
5198
|
+
*/
|
|
5199
|
+
getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
4515
5200
|
/**
|
|
4516
5201
|
* The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
|
|
4517
5202
|
* to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
|
|
4518
5203
|
* If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
|
|
4519
5204
|
*
|
|
4520
|
-
* If importing
|
|
4521
|
-
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`,
|
|
5205
|
+
* If importing KDF algorithm keys, `extractable` must be `false`.
|
|
5206
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5207
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4522
5208
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4523
5209
|
* @since v15.0.0
|
|
4524
5210
|
*/
|
|
@@ -4530,7 +5216,8 @@ declare module "crypto" {
|
|
|
4530
5216
|
| RsaHashedImportParams
|
|
4531
5217
|
| EcKeyImportParams
|
|
4532
5218
|
| HmacImportParams
|
|
4533
|
-
| AesKeyAlgorithm
|
|
5219
|
+
| AesKeyAlgorithm
|
|
5220
|
+
| KmacImportParams,
|
|
4534
5221
|
extractable: boolean,
|
|
4535
5222
|
keyUsages: readonly KeyUsage[],
|
|
4536
5223
|
): Promise<CryptoKey>;
|
|
@@ -4542,62 +5229,81 @@ declare module "crypto" {
|
|
|
4542
5229
|
| RsaHashedImportParams
|
|
4543
5230
|
| EcKeyImportParams
|
|
4544
5231
|
| HmacImportParams
|
|
4545
|
-
| AesKeyAlgorithm
|
|
5232
|
+
| AesKeyAlgorithm
|
|
5233
|
+
| KmacImportParams,
|
|
4546
5234
|
extractable: boolean,
|
|
4547
5235
|
keyUsages: KeyUsage[],
|
|
4548
5236
|
): Promise<CryptoKey>;
|
|
4549
5237
|
/**
|
|
4550
5238
|
* Using the method and parameters given by `algorithm` and the keying material provided by `key`,
|
|
4551
|
-
*
|
|
5239
|
+
* this method attempts to generate a cryptographic signature of `data`. If successful,
|
|
4552
5240
|
* the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
|
|
4553
5241
|
*
|
|
4554
5242
|
* The algorithms currently supported include:
|
|
4555
5243
|
*
|
|
4556
|
-
*
|
|
4557
|
-
*
|
|
4558
|
-
*
|
|
4559
|
-
*
|
|
4560
|
-
*
|
|
4561
|
-
*
|
|
5244
|
+
* * `'ECDSA'`
|
|
5245
|
+
* * `'Ed25519'`
|
|
5246
|
+
* * `'Ed448'`
|
|
5247
|
+
* * `'HMAC'`
|
|
5248
|
+
* * `'KMAC128'`
|
|
5249
|
+
* * `'KMAC256'`
|
|
5250
|
+
* * `'ML-DSA-44'`
|
|
5251
|
+
* * `'ML-DSA-65'`
|
|
5252
|
+
* * `'ML-DSA-87'`
|
|
5253
|
+
* * `'RSA-PSS'`
|
|
5254
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
4562
5255
|
* @since v15.0.0
|
|
4563
5256
|
*/
|
|
4564
5257
|
sign(
|
|
4565
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
5258
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
|
|
4566
5259
|
key: CryptoKey,
|
|
4567
5260
|
data: BufferSource,
|
|
4568
5261
|
): Promise<ArrayBuffer>;
|
|
4569
5262
|
/**
|
|
4570
5263
|
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
4571
|
-
*
|
|
5264
|
+
* This method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
|
|
4572
5265
|
* It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
|
|
4573
5266
|
* then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
|
|
4574
5267
|
* If successful, the returned promise is resolved with a `<CryptoKey>` object.
|
|
4575
5268
|
*
|
|
4576
5269
|
* The wrapping algorithms currently supported include:
|
|
4577
5270
|
*
|
|
4578
|
-
*
|
|
4579
|
-
*
|
|
4580
|
-
*
|
|
4581
|
-
*
|
|
4582
|
-
*
|
|
5271
|
+
* * `'AES-CBC'`
|
|
5272
|
+
* * `'AES-CTR'`
|
|
5273
|
+
* * `'AES-GCM'`
|
|
5274
|
+
* * `'AES-KW'`
|
|
5275
|
+
* * `'AES-OCB'`
|
|
5276
|
+
* * `'ChaCha20-Poly1305'`
|
|
5277
|
+
* * `'RSA-OAEP'`
|
|
4583
5278
|
*
|
|
4584
5279
|
* The unwrapped key algorithms supported include:
|
|
4585
5280
|
*
|
|
4586
|
-
*
|
|
4587
|
-
*
|
|
4588
|
-
*
|
|
4589
|
-
*
|
|
4590
|
-
*
|
|
4591
|
-
*
|
|
4592
|
-
*
|
|
4593
|
-
*
|
|
4594
|
-
*
|
|
4595
|
-
*
|
|
4596
|
-
*
|
|
4597
|
-
*
|
|
4598
|
-
*
|
|
4599
|
-
*
|
|
4600
|
-
*
|
|
5281
|
+
* * `'AES-CBC'`
|
|
5282
|
+
* * `'AES-CTR'`
|
|
5283
|
+
* * `'AES-GCM'`
|
|
5284
|
+
* * `'AES-KW'`
|
|
5285
|
+
* * `'AES-OCB'`
|
|
5286
|
+
* * `'ChaCha20-Poly1305'`
|
|
5287
|
+
* * `'ECDH'`
|
|
5288
|
+
* * `'ECDSA'`
|
|
5289
|
+
* * `'Ed25519'`
|
|
5290
|
+
* * `'Ed448'`
|
|
5291
|
+
* * `'HMAC'`
|
|
5292
|
+
* * `'KMAC128'`
|
|
5293
|
+
* * `'KMAC256'`
|
|
5294
|
+
* * `'ML-DSA-44'`
|
|
5295
|
+
* * `'ML-DSA-65'`
|
|
5296
|
+
* * `'ML-DSA-87'`
|
|
5297
|
+
* * `'ML-KEM-512'`
|
|
5298
|
+
* * `'ML-KEM-768'`
|
|
5299
|
+
* * `'ML-KEM-1024'`
|
|
5300
|
+
* * `'RSA-OAEP'`
|
|
5301
|
+
* * `'RSA-PSS'`
|
|
5302
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
5303
|
+
* * `'X25519'`
|
|
5304
|
+
* * `'X448'`
|
|
5305
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5306
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4601
5307
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4602
5308
|
* @since v15.0.0
|
|
4603
5309
|
*/
|
|
@@ -4605,40 +5311,46 @@ declare module "crypto" {
|
|
|
4605
5311
|
format: KeyFormat,
|
|
4606
5312
|
wrappedKey: BufferSource,
|
|
4607
5313
|
unwrappingKey: CryptoKey,
|
|
4608
|
-
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
5314
|
+
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4609
5315
|
unwrappedKeyAlgorithm:
|
|
4610
5316
|
| AlgorithmIdentifier
|
|
4611
5317
|
| RsaHashedImportParams
|
|
4612
5318
|
| EcKeyImportParams
|
|
4613
5319
|
| HmacImportParams
|
|
4614
|
-
| AesKeyAlgorithm
|
|
5320
|
+
| AesKeyAlgorithm
|
|
5321
|
+
| KmacImportParams,
|
|
4615
5322
|
extractable: boolean,
|
|
4616
5323
|
keyUsages: KeyUsage[],
|
|
4617
5324
|
): Promise<CryptoKey>;
|
|
4618
5325
|
/**
|
|
4619
5326
|
* Using the method and parameters given in `algorithm` and the keying material provided by `key`,
|
|
4620
|
-
*
|
|
5327
|
+
* This method attempts to verify that `signature` is a valid cryptographic signature of `data`.
|
|
4621
5328
|
* The returned promise is resolved with either `true` or `false`.
|
|
4622
5329
|
*
|
|
4623
5330
|
* The algorithms currently supported include:
|
|
4624
5331
|
*
|
|
4625
|
-
*
|
|
4626
|
-
*
|
|
4627
|
-
*
|
|
4628
|
-
*
|
|
4629
|
-
*
|
|
4630
|
-
*
|
|
5332
|
+
* * `'ECDSA'`
|
|
5333
|
+
* * `'Ed25519'`
|
|
5334
|
+
* * `'Ed448'`
|
|
5335
|
+
* * `'HMAC'`
|
|
5336
|
+
* * `'KMAC128'`
|
|
5337
|
+
* * `'KMAC256'`
|
|
5338
|
+
* * `'ML-DSA-44'`
|
|
5339
|
+
* * `'ML-DSA-65'`
|
|
5340
|
+
* * `'ML-DSA-87'`
|
|
5341
|
+
* * `'RSA-PSS'`
|
|
5342
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
4631
5343
|
* @since v15.0.0
|
|
4632
5344
|
*/
|
|
4633
5345
|
verify(
|
|
4634
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
5346
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
|
|
4635
5347
|
key: CryptoKey,
|
|
4636
5348
|
signature: BufferSource,
|
|
4637
5349
|
data: BufferSource,
|
|
4638
5350
|
): Promise<boolean>;
|
|
4639
5351
|
/**
|
|
4640
5352
|
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
4641
|
-
*
|
|
5353
|
+
* This method exports the keying material into the format identified by `format`,
|
|
4642
5354
|
* then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
|
|
4643
5355
|
* It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
|
|
4644
5356
|
* then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
|
|
@@ -4646,30 +5358,25 @@ declare module "crypto" {
|
|
|
4646
5358
|
*
|
|
4647
5359
|
* The wrapping algorithms currently supported include:
|
|
4648
5360
|
*
|
|
4649
|
-
*
|
|
4650
|
-
*
|
|
4651
|
-
*
|
|
4652
|
-
*
|
|
4653
|
-
*
|
|
4654
|
-
*
|
|
5361
|
+
* * `'AES-CBC'`
|
|
5362
|
+
* * `'AES-CTR'`
|
|
5363
|
+
* * `'AES-GCM'`
|
|
5364
|
+
* * `'AES-KW'`
|
|
5365
|
+
* * `'AES-OCB'`
|
|
5366
|
+
* * `'ChaCha20-Poly1305'`
|
|
5367
|
+
* * `'RSA-OAEP'`
|
|
5368
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5369
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4655
5370
|
* @since v15.0.0
|
|
4656
5371
|
*/
|
|
4657
5372
|
wrapKey(
|
|
4658
5373
|
format: KeyFormat,
|
|
4659
5374
|
key: CryptoKey,
|
|
4660
5375
|
wrappingKey: CryptoKey,
|
|
4661
|
-
wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
5376
|
+
wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4662
5377
|
): Promise<ArrayBuffer>;
|
|
4663
5378
|
}
|
|
4664
5379
|
}
|
|
4665
|
-
|
|
4666
|
-
global {
|
|
4667
|
-
var crypto: typeof globalThis extends {
|
|
4668
|
-
crypto: infer T;
|
|
4669
|
-
onmessage: any;
|
|
4670
|
-
} ? T
|
|
4671
|
-
: webcrypto.Crypto;
|
|
4672
|
-
}
|
|
4673
5380
|
}
|
|
4674
5381
|
declare module "node:crypto" {
|
|
4675
5382
|
export * from "crypto";
|