cloudstructs 0.5.4 → 0.5.7
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-app/provider.lambda/index.js +107 -105
- package/assets/slack-textract/detect.lambda/index.js +113 -110
- package/assets/url-shortener/shortener.lambda/index.js +9 -23
- package/lib/codecommit-mirror/index.d.ts +0 -1
- package/lib/codecommit-mirror/index.js +5 -6
- package/lib/ecs-service-roller/index.d.ts +0 -1
- package/lib/ecs-service-roller/index.js +5 -6
- package/lib/email-receiver/index.d.ts +0 -1
- package/lib/email-receiver/receiver.d.ts +0 -1
- package/lib/email-receiver/receiver.js +1 -1
- package/lib/email-receiver/s3-function.d.ts +0 -1
- package/lib/email-receiver/s3-function.js +2 -2
- package/lib/email-receiver/s3.lambda.d.ts +0 -1
- package/lib/email-receiver/whitelist-function.d.ts +0 -1
- package/lib/email-receiver/whitelist-function.js +2 -2
- package/lib/email-receiver/whitelist.lambda.d.ts +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/saml-identity-provider/index.d.ts +0 -1
- package/lib/saml-identity-provider/index.js +4 -5
- package/lib/slack-app/index.d.ts +0 -1
- package/lib/slack-app/manifest.d.ts +0 -1
- package/lib/slack-app/manifest.js +33 -35
- package/lib/slack-app/provider-function.d.ts +0 -1
- package/lib/slack-app/provider-function.js +2 -2
- package/lib/slack-app/provider.d.ts +0 -1
- package/lib/slack-app/provider.js +2 -3
- package/lib/slack-app/provider.lambda.d.ts +0 -1
- package/lib/slack-app/provider.lambda.js +3 -4
- package/lib/slack-app/slack-app.d.ts +0 -1
- package/lib/slack-app/slack-app.js +4 -5
- package/lib/slack-events/events-function.d.ts +0 -1
- package/lib/slack-events/events-function.js +2 -2
- package/lib/slack-events/events.lambda.d.ts +0 -1
- package/lib/slack-events/index.d.ts +0 -1
- package/lib/slack-events/index.js +1 -1
- package/lib/slack-events/signature.d.ts +0 -1
- package/lib/slack-textract/detect-function.d.ts +0 -1
- package/lib/slack-textract/detect-function.js +2 -2
- package/lib/slack-textract/detect.lambda.d.ts +0 -1
- package/lib/slack-textract/index.d.ts +0 -1
- package/lib/slack-textract/index.js +1 -1
- package/lib/state-machine-cr-provider/index.d.ts +0 -1
- package/lib/state-machine-cr-provider/index.js +3 -4
- package/lib/state-machine-cr-provider/runtime/http.d.ts +0 -1
- package/lib/state-machine-cr-provider/runtime/http.js +3 -4
- package/lib/state-machine-cr-provider/runtime/index.d.ts +0 -1
- package/lib/state-machine-cr-provider/runtime/index.js +5 -7
- package/lib/static-website/index.d.ts +0 -1
- package/lib/static-website/index.js +3 -4
- package/lib/static-website/origin-request-function.d.ts +0 -1
- package/lib/static-website/origin-request-function.js +2 -2
- package/lib/static-website/origin-request.edge-lambda.d.ts +0 -1
- package/lib/toolkit-cleaner/clean-images-function.d.ts +0 -1
- package/lib/toolkit-cleaner/clean-images-function.js +2 -2
- package/lib/toolkit-cleaner/clean-images.lambda.d.ts +0 -1
- package/lib/toolkit-cleaner/clean-images.lambda.js +3 -4
- package/lib/toolkit-cleaner/clean-objects-function.d.ts +0 -1
- package/lib/toolkit-cleaner/clean-objects-function.js +2 -2
- package/lib/toolkit-cleaner/clean-objects.lambda.d.ts +0 -1
- package/lib/toolkit-cleaner/clean-objects.lambda.js +3 -4
- package/lib/toolkit-cleaner/extract-template-hashes-function.d.ts +0 -1
- package/lib/toolkit-cleaner/extract-template-hashes-function.js +2 -2
- package/lib/toolkit-cleaner/extract-template-hashes.lambda.d.ts +0 -1
- package/lib/toolkit-cleaner/get-stack-names-function.d.ts +0 -1
- package/lib/toolkit-cleaner/get-stack-names-function.js +2 -2
- package/lib/toolkit-cleaner/get-stack-names.lambda.d.ts +0 -1
- package/lib/toolkit-cleaner/get-stack-names.lambda.js +2 -3
- package/lib/toolkit-cleaner/index.d.ts +0 -1
- package/lib/toolkit-cleaner/index.js +4 -5
- package/lib/url-shortener/index.d.ts +0 -1
- package/lib/url-shortener/index.js +4 -5
- package/lib/url-shortener/redirect-function.d.ts +0 -1
- package/lib/url-shortener/redirect-function.js +2 -2
- package/lib/url-shortener/redirect.edge-lambda.d.ts +0 -1
- package/lib/url-shortener/redirect.edge-lambda.js +2 -3
- package/lib/url-shortener/shortener-function.d.ts +0 -1
- package/lib/url-shortener/shortener-function.js +2 -2
- package/lib/url-shortener/shortener.lambda.d.ts +0 -1
- package/lib/url-shortener/shortener.lambda.js +3 -4
- 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 +7 -8
- package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +668 -42
- package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +40 -17
- package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +33 -44
- package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +79 -23
- package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +11 -1
- package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@slack/logger/node_modules/@types/node/package.json +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +16 -2
- package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +14 -13
- package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +80 -15
- package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +18 -10
- package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +5 -3
- package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +2 -5
- package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +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 +7 -8
- package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +668 -42
- package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +40 -17
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +33 -44
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +79 -23
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +11 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +16 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +14 -13
- package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +80 -15
- package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +18 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +5 -3
- 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/worker_threads.d.ts +2 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +1 -1
- 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 +7 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +668 -42
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +40 -17
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +33 -44
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +79 -23
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +11 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +16 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +14 -13
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +80 -15
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +18 -10
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +5 -3
- 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/worker_threads.d.ts +2 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/assert.d.ts +7 -8
- package/node_modules/@types/is-stream/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@types/is-stream/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@types/is-stream/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +668 -42
- package/node_modules/@types/is-stream/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +40 -17
- package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +33 -44
- package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +79 -23
- package/node_modules/@types/is-stream/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/https.d.ts +11 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@types/is-stream/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@types/is-stream/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/perf_hooks.d.ts +16 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +14 -13
- package/node_modules/@types/is-stream/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +80 -15
- package/node_modules/@types/is-stream/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/timers.d.ts +3 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +18 -10
- package/node_modules/@types/is-stream/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@types/is-stream/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@types/is-stream/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/vm.d.ts +5 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/worker_threads.d.ts +2 -5
- package/node_modules/@types/is-stream/node_modules/@types/node/zlib.d.ts +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 +7 -8
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +668 -42
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +40 -17
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +33 -44
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +79 -23
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +11 -1
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +16 -2
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +14 -13
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +80 -15
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +18 -10
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +5 -3
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +2 -5
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +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 +7 -8
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +668 -42
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +40 -17
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +33 -44
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +79 -23
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +11 -1
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +16 -2
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +14 -13
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +80 -15
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +18 -10
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +5 -3
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +2 -5
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +1 -1
- package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/buffer-stream.js +0 -0
- package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.d.ts +0 -0
- package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.js +0 -0
- package/node_modules/{decompress-response/node_modules/mimic-response → cacheable-request/node_modules/get-stream}/license +0 -0
- package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/package.json +0 -0
- package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/readme.md +0 -0
- package/node_modules/clone-response/node_modules/mimic-response/index.js +32 -0
- package/node_modules/{get-stream → clone-response/node_modules/mimic-response}/license +1 -1
- package/node_modules/clone-response/node_modules/mimic-response/package.json +37 -0
- package/node_modules/clone-response/node_modules/mimic-response/readme.md +54 -0
- package/node_modules/clone-response/package.json +3 -6
- package/node_modules/keyv/README.md +16 -3
- package/node_modules/keyv/package.json +6 -8
- package/node_modules/keyv/src/index.d.ts +16 -2
- package/node_modules/{decompress-response/node_modules/mimic-response → mimic-response}/index.d.ts +0 -0
- package/node_modules/mimic-response/index.js +58 -13
- package/node_modules/mimic-response/license +1 -1
- package/node_modules/mimic-response/package.json +40 -35
- package/node_modules/mimic-response/readme.md +33 -9
- package/node_modules/responselike/package.json +3 -2
- package/package.json +13 -13
- package/changelog.md +0 -7
- package/lib/codecommit-mirror/index.d.ts.map +0 -1
- package/lib/ecs-service-roller/index.d.ts.map +0 -1
- package/lib/email-receiver/index.d.ts.map +0 -1
- package/lib/email-receiver/receiver.d.ts.map +0 -1
- package/lib/email-receiver/s3-function.d.ts.map +0 -1
- package/lib/email-receiver/s3.lambda.d.ts.map +0 -1
- package/lib/email-receiver/whitelist-function.d.ts.map +0 -1
- package/lib/email-receiver/whitelist.lambda.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/saml-identity-provider/index.d.ts.map +0 -1
- package/lib/slack-app/index.d.ts.map +0 -1
- package/lib/slack-app/manifest.d.ts.map +0 -1
- package/lib/slack-app/provider-function.d.ts.map +0 -1
- package/lib/slack-app/provider.d.ts.map +0 -1
- package/lib/slack-app/provider.lambda.d.ts.map +0 -1
- package/lib/slack-app/slack-app.d.ts.map +0 -1
- package/lib/slack-events/events-function.d.ts.map +0 -1
- package/lib/slack-events/events.lambda.d.ts.map +0 -1
- package/lib/slack-events/index.d.ts.map +0 -1
- package/lib/slack-events/signature.d.ts.map +0 -1
- package/lib/slack-textract/detect-function.d.ts.map +0 -1
- package/lib/slack-textract/detect.lambda.d.ts.map +0 -1
- package/lib/slack-textract/index.d.ts.map +0 -1
- package/lib/state-machine-cr-provider/index.d.ts.map +0 -1
- package/lib/state-machine-cr-provider/runtime/http.d.ts.map +0 -1
- package/lib/state-machine-cr-provider/runtime/index.d.ts.map +0 -1
- package/lib/static-website/index.d.ts.map +0 -1
- package/lib/static-website/origin-request-function.d.ts.map +0 -1
- package/lib/static-website/origin-request.edge-lambda.d.ts.map +0 -1
- package/lib/toolkit-cleaner/clean-images-function.d.ts.map +0 -1
- package/lib/toolkit-cleaner/clean-images.lambda.d.ts.map +0 -1
- package/lib/toolkit-cleaner/clean-objects-function.d.ts.map +0 -1
- package/lib/toolkit-cleaner/clean-objects.lambda.d.ts.map +0 -1
- package/lib/toolkit-cleaner/extract-template-hashes-function.d.ts.map +0 -1
- package/lib/toolkit-cleaner/extract-template-hashes.lambda.d.ts.map +0 -1
- package/lib/toolkit-cleaner/get-stack-names-function.d.ts.map +0 -1
- package/lib/toolkit-cleaner/get-stack-names.lambda.d.ts.map +0 -1
- package/lib/toolkit-cleaner/index.d.ts.map +0 -1
- package/lib/url-shortener/index.d.ts.map +0 -1
- package/lib/url-shortener/redirect-function.d.ts.map +0 -1
- package/lib/url-shortener/redirect.edge-lambda.d.ts.map +0 -1
- package/lib/url-shortener/shortener-function.d.ts.map +0 -1
- package/lib/url-shortener/shortener.lambda.d.ts.map +0 -1
- package/node_modules/decompress-response/node_modules/mimic-response/index.js +0 -77
- package/node_modules/decompress-response/node_modules/mimic-response/package.json +0 -42
- package/node_modules/decompress-response/node_modules/mimic-response/readme.md +0 -78
- package/releasetag.txt +0 -1
- package/version.txt +0 -1
|
@@ -13,47 +13,73 @@
|
|
|
13
13
|
* // Prints:
|
|
14
14
|
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
|
15
15
|
* ```
|
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'crypto' {
|
|
19
19
|
import * as stream from 'node:stream';
|
|
20
20
|
import { PeerCertificate } from 'node:tls';
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* SPKAC is a Certificate Signing Request mechanism originally implemented by
|
|
23
|
+
* Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
|
|
24
|
+
*
|
|
25
|
+
* `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
|
|
26
|
+
* should not use this element anymore.
|
|
27
|
+
*
|
|
28
|
+
* The `crypto` module provides the `Certificate` class for working with SPKAC
|
|
29
|
+
* data. The most common usage is handling output generated by the HTML5`<keygen>` element. Node.js uses [OpenSSL's SPKAC
|
|
30
|
+
* implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally.
|
|
31
|
+
* @since v0.11.8
|
|
32
|
+
*/
|
|
33
|
+
class Certificate {
|
|
22
34
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
35
|
+
* ```js
|
|
36
|
+
* const { Certificate } = await import('crypto');
|
|
37
|
+
* const spkac = getSpkacSomehow();
|
|
38
|
+
* const challenge = Certificate.exportChallenge(spkac);
|
|
39
|
+
* console.log(challenge.toString('utf8'));
|
|
40
|
+
* // Prints: the challenge as a UTF8 string
|
|
41
|
+
* ```
|
|
42
|
+
* @since v9.0.0
|
|
43
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
44
|
+
* @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
|
|
27
45
|
*/
|
|
28
|
-
exportChallenge(spkac: BinaryLike): Buffer;
|
|
46
|
+
static exportChallenge(spkac: BinaryLike): Buffer;
|
|
29
47
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
48
|
+
* ```js
|
|
49
|
+
* const { Certificate } = await import('crypto');
|
|
50
|
+
* const spkac = getSpkacSomehow();
|
|
51
|
+
* const publicKey = Certificate.exportPublicKey(spkac);
|
|
52
|
+
* console.log(publicKey);
|
|
53
|
+
* // Prints: the public key as <Buffer ...>
|
|
54
|
+
* ```
|
|
55
|
+
* @since v9.0.0
|
|
56
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
57
|
+
* @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
|
|
35
58
|
*/
|
|
36
|
-
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
59
|
+
static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
37
60
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
61
|
+
* ```js
|
|
62
|
+
* import { Buffer } from 'buffer';
|
|
63
|
+
* const { Certificate } = await import('crypto');
|
|
64
|
+
*
|
|
65
|
+
* const spkac = getSpkacSomehow();
|
|
66
|
+
* console.log(Certificate.verifySpkac(Buffer.from(spkac)));
|
|
67
|
+
* // Prints: true or false
|
|
68
|
+
* ```
|
|
69
|
+
* @since v9.0.0
|
|
70
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
71
|
+
* @return `true` if the given `spkac` data structure is valid, `false` otherwise.
|
|
42
72
|
*/
|
|
43
|
-
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
44
|
-
}
|
|
45
|
-
const Certificate: Certificate & {
|
|
46
|
-
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
|
47
|
-
new (): Certificate;
|
|
48
|
-
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
|
49
|
-
(): Certificate;
|
|
73
|
+
static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
50
74
|
/**
|
|
75
|
+
* @deprecated
|
|
51
76
|
* @param spkac
|
|
52
77
|
* @returns The challenge component of the `spkac` data structure,
|
|
53
78
|
* which includes a public key and a challenge.
|
|
54
79
|
*/
|
|
55
80
|
exportChallenge(spkac: BinaryLike): Buffer;
|
|
56
81
|
/**
|
|
82
|
+
* @deprecated
|
|
57
83
|
* @param spkac
|
|
58
84
|
* @param encoding The encoding of the spkac string.
|
|
59
85
|
* @returns The public key component of the `spkac` data structure,
|
|
@@ -61,12 +87,13 @@ declare module 'crypto' {
|
|
|
61
87
|
*/
|
|
62
88
|
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
63
89
|
/**
|
|
90
|
+
* @deprecated
|
|
64
91
|
* @param spkac
|
|
65
92
|
* @returns `true` if the given `spkac` data structure is valid,
|
|
66
93
|
* `false` otherwise.
|
|
67
94
|
*/
|
|
68
95
|
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
69
|
-
}
|
|
96
|
+
}
|
|
70
97
|
namespace constants {
|
|
71
98
|
// https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
|
|
72
99
|
const OPENSSL_VERSION_NUMBER: number;
|
|
@@ -172,7 +199,7 @@ declare module 'crypto' {
|
|
|
172
199
|
*
|
|
173
200
|
* The `algorithm` is dependent on the available algorithms supported by the
|
|
174
201
|
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
175
|
-
* On recent releases of OpenSSL, `openssl list -digest-algorithms`
|
|
202
|
+
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
176
203
|
* display the available digest algorithms.
|
|
177
204
|
*
|
|
178
205
|
* Example: generating the sha256 sum of a file
|
|
@@ -212,7 +239,7 @@ declare module 'crypto' {
|
|
|
212
239
|
*
|
|
213
240
|
* The `algorithm` is dependent on the available algorithms supported by the
|
|
214
241
|
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
215
|
-
* On recent releases of OpenSSL, `openssl list -digest-algorithms`
|
|
242
|
+
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
216
243
|
* display the available digest algorithms.
|
|
217
244
|
*
|
|
218
245
|
* The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
|
|
@@ -662,12 +689,13 @@ declare module 'crypto' {
|
|
|
662
689
|
* Creates and returns a `Cipher` object that uses the given `algorithm` and`password`.
|
|
663
690
|
*
|
|
664
691
|
* The `options` argument controls stream behavior and is optional except when a
|
|
665
|
-
* cipher in CCM or OCB mode
|
|
692
|
+
* 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
|
|
666
693
|
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
|
|
667
694
|
* tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
|
|
695
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
668
696
|
*
|
|
669
697
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
670
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
698
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
671
699
|
* display the available cipher algorithms.
|
|
672
700
|
*
|
|
673
701
|
* The `password` is used to derive the cipher key and initialization vector (IV).
|
|
@@ -700,12 +728,13 @@ declare module 'crypto' {
|
|
|
700
728
|
* initialization vector (`iv`).
|
|
701
729
|
*
|
|
702
730
|
* The `options` argument controls stream behavior and is optional except when a
|
|
703
|
-
* cipher in CCM or OCB mode
|
|
731
|
+
* 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
|
|
704
732
|
* authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
|
|
705
733
|
* tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
|
|
734
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
706
735
|
*
|
|
707
736
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
708
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
737
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
709
738
|
* display the available cipher algorithms.
|
|
710
739
|
*
|
|
711
740
|
* The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
@@ -925,8 +954,9 @@ declare module 'crypto' {
|
|
|
925
954
|
* Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key).
|
|
926
955
|
*
|
|
927
956
|
* The `options` argument controls stream behavior and is optional except when a
|
|
928
|
-
* cipher in CCM or OCB mode
|
|
957
|
+
* 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
|
|
929
958
|
* authentication tag in bytes, see `CCM mode`.
|
|
959
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
930
960
|
*
|
|
931
961
|
* The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
|
|
932
962
|
* function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
|
|
@@ -951,12 +981,13 @@ declare module 'crypto' {
|
|
|
951
981
|
* Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`).
|
|
952
982
|
*
|
|
953
983
|
* The `options` argument controls stream behavior and is optional except when a
|
|
954
|
-
* cipher in CCM or OCB mode
|
|
984
|
+
* 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
|
|
955
985
|
* 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
|
|
956
986
|
* to those with the specified length.
|
|
987
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
957
988
|
*
|
|
958
989
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
959
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
990
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
960
991
|
* display the available cipher algorithms.
|
|
961
992
|
*
|
|
962
993
|
* The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
|
|
@@ -1510,9 +1541,9 @@ declare module 'crypto' {
|
|
|
1510
1541
|
* @param inputEncoding The `encoding` of an `otherPublicKey` string.
|
|
1511
1542
|
* @param outputEncoding The `encoding` of the return value.
|
|
1512
1543
|
*/
|
|
1513
|
-
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
|
|
1514
|
-
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
|
|
1515
|
-
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
1544
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
|
|
1545
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
|
|
1546
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string;
|
|
1516
1547
|
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
|
|
1517
1548
|
/**
|
|
1518
1549
|
* Returns the Diffie-Hellman prime in the specified `encoding`.
|
|
@@ -1582,6 +1613,36 @@ declare module 'crypto' {
|
|
|
1582
1613
|
*/
|
|
1583
1614
|
verifyError: number;
|
|
1584
1615
|
}
|
|
1616
|
+
/**
|
|
1617
|
+
* The `DiffieHellmanGroup` class takes a well-known modp group as its argument.
|
|
1618
|
+
* It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation.
|
|
1619
|
+
* In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods.
|
|
1620
|
+
*
|
|
1621
|
+
* ```js
|
|
1622
|
+
* const { createDiffieHellmanGroup } = await import('node:crypto');
|
|
1623
|
+
* const dh = createDiffieHellmanGroup('modp1');
|
|
1624
|
+
* ```
|
|
1625
|
+
* The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt):
|
|
1626
|
+
* ```bash
|
|
1627
|
+
* $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
|
|
1628
|
+
* modp1 # 768 bits
|
|
1629
|
+
* modp2 # 1024 bits
|
|
1630
|
+
* modp5 # 1536 bits
|
|
1631
|
+
* modp14 # 2048 bits
|
|
1632
|
+
* modp15 # etc.
|
|
1633
|
+
* modp16
|
|
1634
|
+
* modp17
|
|
1635
|
+
* modp18
|
|
1636
|
+
* ```
|
|
1637
|
+
* @since v0.7.5
|
|
1638
|
+
*/
|
|
1639
|
+
const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
|
|
1640
|
+
interface DiffieHellmanGroupConstructor {
|
|
1641
|
+
new(name: string): DiffieHellmanGroup;
|
|
1642
|
+
(name: string): DiffieHellmanGroup;
|
|
1643
|
+
readonly prototype: DiffieHellmanGroup;
|
|
1644
|
+
}
|
|
1645
|
+
type DiffieHellmanGroup = Omit<DiffieHellman, 'setPublicKey' | 'setPrivateKey'>;
|
|
1585
1646
|
/**
|
|
1586
1647
|
* Creates a predefined `DiffieHellmanGroup` key exchange object. The
|
|
1587
1648
|
* supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`,
|
|
@@ -1612,7 +1673,12 @@ declare module 'crypto' {
|
|
|
1612
1673
|
* ```
|
|
1613
1674
|
* @since v0.7.5
|
|
1614
1675
|
*/
|
|
1615
|
-
function getDiffieHellman(groupName: string):
|
|
1676
|
+
function getDiffieHellman(groupName: string): DiffieHellmanGroup;
|
|
1677
|
+
/**
|
|
1678
|
+
* An alias for {@link getDiffieHellman}
|
|
1679
|
+
* @since v0.9.3
|
|
1680
|
+
*/
|
|
1681
|
+
function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
|
|
1616
1682
|
/**
|
|
1617
1683
|
* Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
|
1618
1684
|
* implementation. A selected HMAC digest algorithm specified by `digest` is
|
|
@@ -2094,6 +2160,12 @@ declare module 'crypto' {
|
|
|
2094
2160
|
* @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}.
|
|
2095
2161
|
*/
|
|
2096
2162
|
function getFips(): 1 | 0;
|
|
2163
|
+
/**
|
|
2164
|
+
* Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available.
|
|
2165
|
+
* @since v10.0.0
|
|
2166
|
+
* @param bool `true` to enable FIPS mode.
|
|
2167
|
+
*/
|
|
2168
|
+
function setFips(bool: boolean): void;
|
|
2097
2169
|
/**
|
|
2098
2170
|
* ```js
|
|
2099
2171
|
* const {
|
|
@@ -2272,7 +2344,8 @@ declare module 'crypto' {
|
|
|
2272
2344
|
* comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
|
|
2273
2345
|
*
|
|
2274
2346
|
* `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
|
|
2275
|
-
* must have the same byte length.
|
|
2347
|
+
* must have the same byte length. An error is thrown if `a` and `b` have
|
|
2348
|
+
* different byte lengths.
|
|
2276
2349
|
*
|
|
2277
2350
|
* If at least one of `a` and `b` is a `TypedArray` with more than one byte per
|
|
2278
2351
|
* entry, such as `Uint16Array`, the result will be computed using the platform
|
|
@@ -3094,12 +3167,16 @@ declare module 'crypto' {
|
|
|
3094
3167
|
*/
|
|
3095
3168
|
class X509Certificate {
|
|
3096
3169
|
/**
|
|
3097
|
-
* Will be \`true\` if this is a Certificate Authority (
|
|
3170
|
+
* Will be \`true\` if this is a Certificate Authority (CA) certificate.
|
|
3098
3171
|
* @since v15.6.0
|
|
3099
3172
|
*/
|
|
3100
3173
|
readonly ca: boolean;
|
|
3101
3174
|
/**
|
|
3102
3175
|
* The SHA-1 fingerprint of this certificate.
|
|
3176
|
+
*
|
|
3177
|
+
* Because SHA-1 is cryptographically broken and because the security of SHA-1 is
|
|
3178
|
+
* significantly worse than that of algorithms that are commonly used to sign
|
|
3179
|
+
* certificates, consider using `x509.fingerprint256` instead.
|
|
3103
3180
|
* @since v15.6.0
|
|
3104
3181
|
*/
|
|
3105
3182
|
readonly fingerprint: string;
|
|
@@ -3158,6 +3235,10 @@ declare module 'crypto' {
|
|
|
3158
3235
|
readonly raw: Buffer;
|
|
3159
3236
|
/**
|
|
3160
3237
|
* The serial number of this certificate.
|
|
3238
|
+
*
|
|
3239
|
+
* Serial numbers are assigned by certificate authorities and do not uniquely
|
|
3240
|
+
* identify certificates. Consider using `x509.fingerprint256` as a unique
|
|
3241
|
+
* identifier instead.
|
|
3161
3242
|
* @since v15.6.0
|
|
3162
3243
|
*/
|
|
3163
3244
|
readonly serialNumber: string;
|
|
@@ -3174,18 +3255,50 @@ declare module 'crypto' {
|
|
|
3174
3255
|
constructor(buffer: BinaryLike);
|
|
3175
3256
|
/**
|
|
3176
3257
|
* Checks whether the certificate matches the given email address.
|
|
3258
|
+
*
|
|
3259
|
+
* If the `'subject'` option is undefined or set to `'default'`, the certificate
|
|
3260
|
+
* subject is only considered if the subject alternative name extension either does
|
|
3261
|
+
* not exist or does not contain any email addresses.
|
|
3262
|
+
*
|
|
3263
|
+
* If the `'subject'` option is set to `'always'` and if the subject alternative
|
|
3264
|
+
* name extension either does not exist or does not contain a matching email
|
|
3265
|
+
* address, the certificate subject is considered.
|
|
3266
|
+
*
|
|
3267
|
+
* If the `'subject'` option is set to `'never'`, the certificate subject is never
|
|
3268
|
+
* considered, even if the certificate contains no subject alternative names.
|
|
3177
3269
|
* @since v15.6.0
|
|
3178
3270
|
* @return Returns `email` if the certificate matches, `undefined` if it does not.
|
|
3179
3271
|
*/
|
|
3180
3272
|
checkEmail(email: string, options?: Pick<X509CheckOptions, 'subject'>): string | undefined;
|
|
3181
3273
|
/**
|
|
3182
3274
|
* Checks whether the certificate matches the given host name.
|
|
3275
|
+
*
|
|
3276
|
+
* If the certificate matches the given host name, the matching subject name is
|
|
3277
|
+
* returned. The returned name might be an exact match (e.g., `foo.example.com`)
|
|
3278
|
+
* or it might contain wildcards (e.g., `*.example.com`). Because host name
|
|
3279
|
+
* comparisons are case-insensitive, the returned subject name might also differ
|
|
3280
|
+
* from the given `name` in capitalization.
|
|
3281
|
+
*
|
|
3282
|
+
* If the `'subject'` option is undefined or set to `'default'`, the certificate
|
|
3283
|
+
* subject is only considered if the subject alternative name extension either does
|
|
3284
|
+
* not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS").
|
|
3285
|
+
*
|
|
3286
|
+
* If the `'subject'` option is set to `'always'` and if the subject alternative
|
|
3287
|
+
* name extension either does not exist or does not contain a matching DNS name,
|
|
3288
|
+
* the certificate subject is considered.
|
|
3289
|
+
*
|
|
3290
|
+
* If the `'subject'` option is set to `'never'`, the certificate subject is never
|
|
3291
|
+
* considered, even if the certificate contains no subject alternative names.
|
|
3183
3292
|
* @since v15.6.0
|
|
3184
|
-
* @return Returns
|
|
3293
|
+
* @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.
|
|
3185
3294
|
*/
|
|
3186
3295
|
checkHost(name: string, options?: X509CheckOptions): string | undefined;
|
|
3187
3296
|
/**
|
|
3188
3297
|
* Checks whether the certificate matches the given IP address (IPv4 or IPv6).
|
|
3298
|
+
*
|
|
3299
|
+
* Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they
|
|
3300
|
+
* must match the given `ip` address exactly. Other subject alternative names as
|
|
3301
|
+
* well as the subject field of the certificate are ignored.
|
|
3189
3302
|
* @since v15.6.0
|
|
3190
3303
|
* @return Returns `ip` if the certificate matches, `undefined` if it does not.
|
|
3191
3304
|
*/
|
|
@@ -3329,8 +3442,521 @@ declare module 'crypto' {
|
|
|
3329
3442
|
* @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.
|
|
3330
3443
|
*/
|
|
3331
3444
|
function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean;
|
|
3445
|
+
/**
|
|
3446
|
+
* Load and set the `engine` for some or all OpenSSL functions (selected by flags).
|
|
3447
|
+
*
|
|
3448
|
+
* `engine` could be either an id or a path to the engine's shared library.
|
|
3449
|
+
*
|
|
3450
|
+
* The optional `flags` argument uses `ENGINE_METHOD_ALL` by default.
|
|
3451
|
+
* The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`):
|
|
3452
|
+
*
|
|
3453
|
+
* - `crypto.constants.ENGINE_METHOD_RSA`
|
|
3454
|
+
* - `crypto.constants.ENGINE_METHOD_DSA`
|
|
3455
|
+
* - `crypto.constants.ENGINE_METHOD_DH`
|
|
3456
|
+
* - `crypto.constants.ENGINE_METHOD_RAND`
|
|
3457
|
+
* - `crypto.constants.ENGINE_METHOD_EC`
|
|
3458
|
+
* - `crypto.constants.ENGINE_METHOD_CIPHERS`
|
|
3459
|
+
* - `crypto.constants.ENGINE_METHOD_DIGESTS`
|
|
3460
|
+
* - `crypto.constants.ENGINE_METHOD_PKEY_METHS`
|
|
3461
|
+
* - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS`
|
|
3462
|
+
* - `crypto.constants.ENGINE_METHOD_ALL`
|
|
3463
|
+
* - `crypto.constants.ENGINE_METHOD_NONE`
|
|
3464
|
+
*
|
|
3465
|
+
* The flags below are deprecated in OpenSSL-1.1.0.
|
|
3466
|
+
*
|
|
3467
|
+
* - `crypto.constants.ENGINE_METHOD_ECDH`
|
|
3468
|
+
* - `crypto.constants.ENGINE_METHOD_ECDSA`
|
|
3469
|
+
* - `crypto.constants.ENGINE_METHOD_STORE`
|
|
3470
|
+
* @since v0.11.11
|
|
3471
|
+
* @param [flags=crypto.constants.ENGINE_METHOD_ALL]
|
|
3472
|
+
*/
|
|
3473
|
+
function setEngine(engine: string, flags?: number): void;
|
|
3474
|
+
/**
|
|
3475
|
+
* A convenient alias for `crypto.webcrypto.getRandomValues()`.
|
|
3476
|
+
* This implementation is not compliant with the Web Crypto spec,
|
|
3477
|
+
* to write web-compatible code use `crypto.webcrypto.getRandomValues()` instead.
|
|
3478
|
+
* @since v17.4.0
|
|
3479
|
+
* @returns Returns `typedArray`.
|
|
3480
|
+
*/
|
|
3481
|
+
function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
|
|
3482
|
+
/**
|
|
3483
|
+
* A convenient alias for `crypto.webcrypto.subtle`.
|
|
3484
|
+
* @since v17.4.0
|
|
3485
|
+
*/
|
|
3486
|
+
const subtle: webcrypto.SubtleCrypto;
|
|
3487
|
+
/**
|
|
3488
|
+
* An implementation of the Web Crypto API standard.
|
|
3489
|
+
*
|
|
3490
|
+
* See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details.
|
|
3491
|
+
* @since v15.0.0
|
|
3492
|
+
*/
|
|
3493
|
+
const webcrypto: webcrypto.Crypto;
|
|
3332
3494
|
namespace webcrypto {
|
|
3333
|
-
|
|
3495
|
+
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
3496
|
+
type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki';
|
|
3497
|
+
type KeyType = 'private' | 'public' | 'secret';
|
|
3498
|
+
type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey';
|
|
3499
|
+
type AlgorithmIdentifier = Algorithm | string;
|
|
3500
|
+
type HashAlgorithmIdentifier = AlgorithmIdentifier;
|
|
3501
|
+
type NamedCurve = string;
|
|
3502
|
+
type BigInteger = Uint8Array;
|
|
3503
|
+
interface AesCbcParams extends Algorithm {
|
|
3504
|
+
iv: BufferSource;
|
|
3505
|
+
}
|
|
3506
|
+
interface AesCtrParams extends Algorithm {
|
|
3507
|
+
counter: BufferSource;
|
|
3508
|
+
length: number;
|
|
3509
|
+
}
|
|
3510
|
+
interface AesDerivedKeyParams extends Algorithm {
|
|
3511
|
+
length: number;
|
|
3512
|
+
}
|
|
3513
|
+
interface AesGcmParams extends Algorithm {
|
|
3514
|
+
additionalData?: BufferSource;
|
|
3515
|
+
iv: BufferSource;
|
|
3516
|
+
tagLength?: number;
|
|
3517
|
+
}
|
|
3518
|
+
interface AesKeyAlgorithm extends KeyAlgorithm {
|
|
3519
|
+
length: number;
|
|
3520
|
+
}
|
|
3521
|
+
interface AesKeyGenParams extends Algorithm {
|
|
3522
|
+
length: number;
|
|
3523
|
+
}
|
|
3524
|
+
interface Algorithm {
|
|
3525
|
+
name: string;
|
|
3526
|
+
}
|
|
3527
|
+
interface EcKeyAlgorithm extends KeyAlgorithm {
|
|
3528
|
+
namedCurve: NamedCurve;
|
|
3529
|
+
}
|
|
3530
|
+
interface EcKeyGenParams extends Algorithm {
|
|
3531
|
+
namedCurve: NamedCurve;
|
|
3532
|
+
}
|
|
3533
|
+
interface EcKeyImportParams extends Algorithm {
|
|
3534
|
+
namedCurve: NamedCurve;
|
|
3535
|
+
}
|
|
3536
|
+
interface EcdhKeyDeriveParams extends Algorithm {
|
|
3537
|
+
public: CryptoKey;
|
|
3538
|
+
}
|
|
3539
|
+
interface EcdsaParams extends Algorithm {
|
|
3540
|
+
hash: HashAlgorithmIdentifier;
|
|
3541
|
+
}
|
|
3542
|
+
interface Ed448Params extends Algorithm {
|
|
3543
|
+
context?: BufferSource;
|
|
3544
|
+
}
|
|
3545
|
+
interface HkdfParams extends Algorithm {
|
|
3546
|
+
hash: HashAlgorithmIdentifier;
|
|
3547
|
+
info: BufferSource;
|
|
3548
|
+
salt: BufferSource;
|
|
3549
|
+
}
|
|
3550
|
+
interface HmacImportParams extends Algorithm {
|
|
3551
|
+
hash: HashAlgorithmIdentifier;
|
|
3552
|
+
length?: number;
|
|
3553
|
+
}
|
|
3554
|
+
interface HmacKeyAlgorithm extends KeyAlgorithm {
|
|
3555
|
+
hash: KeyAlgorithm;
|
|
3556
|
+
length: number;
|
|
3557
|
+
}
|
|
3558
|
+
interface HmacKeyGenParams extends Algorithm {
|
|
3559
|
+
hash: HashAlgorithmIdentifier;
|
|
3560
|
+
length?: number;
|
|
3561
|
+
}
|
|
3562
|
+
interface JsonWebKey {
|
|
3563
|
+
alg?: string;
|
|
3564
|
+
crv?: string;
|
|
3565
|
+
d?: string;
|
|
3566
|
+
dp?: string;
|
|
3567
|
+
dq?: string;
|
|
3568
|
+
e?: string;
|
|
3569
|
+
ext?: boolean;
|
|
3570
|
+
k?: string;
|
|
3571
|
+
key_ops?: string[];
|
|
3572
|
+
kty?: string;
|
|
3573
|
+
n?: string;
|
|
3574
|
+
oth?: RsaOtherPrimesInfo[];
|
|
3575
|
+
p?: string;
|
|
3576
|
+
q?: string;
|
|
3577
|
+
qi?: string;
|
|
3578
|
+
use?: string;
|
|
3579
|
+
x?: string;
|
|
3580
|
+
y?: string;
|
|
3581
|
+
}
|
|
3582
|
+
interface KeyAlgorithm {
|
|
3583
|
+
name: string;
|
|
3584
|
+
}
|
|
3585
|
+
interface Pbkdf2Params extends Algorithm {
|
|
3586
|
+
hash: HashAlgorithmIdentifier;
|
|
3587
|
+
iterations: number;
|
|
3588
|
+
salt: BufferSource;
|
|
3589
|
+
}
|
|
3590
|
+
interface RsaHashedImportParams extends Algorithm {
|
|
3591
|
+
hash: HashAlgorithmIdentifier;
|
|
3592
|
+
}
|
|
3593
|
+
interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
|
|
3594
|
+
hash: KeyAlgorithm;
|
|
3595
|
+
}
|
|
3596
|
+
interface RsaHashedKeyGenParams extends RsaKeyGenParams {
|
|
3597
|
+
hash: HashAlgorithmIdentifier;
|
|
3598
|
+
}
|
|
3599
|
+
interface RsaKeyAlgorithm extends KeyAlgorithm {
|
|
3600
|
+
modulusLength: number;
|
|
3601
|
+
publicExponent: BigInteger;
|
|
3602
|
+
}
|
|
3603
|
+
interface RsaKeyGenParams extends Algorithm {
|
|
3604
|
+
modulusLength: number;
|
|
3605
|
+
publicExponent: BigInteger;
|
|
3606
|
+
}
|
|
3607
|
+
interface RsaOaepParams extends Algorithm {
|
|
3608
|
+
label?: BufferSource;
|
|
3609
|
+
}
|
|
3610
|
+
interface RsaOtherPrimesInfo {
|
|
3611
|
+
d?: string;
|
|
3612
|
+
r?: string;
|
|
3613
|
+
t?: string;
|
|
3614
|
+
}
|
|
3615
|
+
interface RsaPssParams extends Algorithm {
|
|
3616
|
+
saltLength: number;
|
|
3617
|
+
}
|
|
3618
|
+
/**
|
|
3619
|
+
* Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class.
|
|
3620
|
+
* `Crypto` is a singleton that provides access to the remainder of the crypto API.
|
|
3621
|
+
* @since v15.0.0
|
|
3622
|
+
*/
|
|
3623
|
+
interface Crypto {
|
|
3624
|
+
/**
|
|
3625
|
+
* Provides access to the `SubtleCrypto` API.
|
|
3626
|
+
* @since v15.0.0
|
|
3627
|
+
*/
|
|
3628
|
+
readonly subtle: SubtleCrypto;
|
|
3629
|
+
/**
|
|
3630
|
+
* Generates cryptographically strong random values.
|
|
3631
|
+
* The given `typedArray` is filled with random values, and a reference to `typedArray` is returned.
|
|
3632
|
+
*
|
|
3633
|
+
* The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted.
|
|
3634
|
+
*
|
|
3635
|
+
* An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
|
|
3636
|
+
* @since v15.0.0
|
|
3637
|
+
*/
|
|
3638
|
+
getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(typedArray: T): T;
|
|
3639
|
+
/**
|
|
3640
|
+
* Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
|
|
3641
|
+
* The UUID is generated using a cryptographic pseudorandom number generator.
|
|
3642
|
+
* @since v16.7.0
|
|
3643
|
+
*/
|
|
3644
|
+
randomUUID(): string;
|
|
3645
|
+
CryptoKey: CryptoKeyConstructor;
|
|
3646
|
+
}
|
|
3647
|
+
// This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
|
|
3648
|
+
interface CryptoKeyConstructor {
|
|
3649
|
+
/** Illegal constructor */
|
|
3650
|
+
(_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
|
|
3651
|
+
readonly length: 0;
|
|
3652
|
+
readonly name: 'CryptoKey';
|
|
3653
|
+
readonly prototype: CryptoKey;
|
|
3654
|
+
}
|
|
3655
|
+
/**
|
|
3656
|
+
* @since v15.0.0
|
|
3657
|
+
*/
|
|
3658
|
+
interface CryptoKey {
|
|
3659
|
+
/**
|
|
3660
|
+
* An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters.
|
|
3661
|
+
* @since v15.0.0
|
|
3662
|
+
*/
|
|
3663
|
+
readonly algorithm: KeyAlgorithm;
|
|
3664
|
+
/**
|
|
3665
|
+
* When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`.
|
|
3666
|
+
* @since v15.0.0
|
|
3667
|
+
*/
|
|
3668
|
+
readonly extractable: boolean;
|
|
3669
|
+
/**
|
|
3670
|
+
* A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key.
|
|
3671
|
+
* @since v15.0.0
|
|
3672
|
+
*/
|
|
3673
|
+
readonly type: KeyType;
|
|
3674
|
+
/**
|
|
3675
|
+
* An array of strings identifying the operations for which the key may be used.
|
|
3676
|
+
*
|
|
3677
|
+
* The possible usages are:
|
|
3678
|
+
* - `'encrypt'` - The key may be used to encrypt data.
|
|
3679
|
+
* - `'decrypt'` - The key may be used to decrypt data.
|
|
3680
|
+
* - `'sign'` - The key may be used to generate digital signatures.
|
|
3681
|
+
* - `'verify'` - The key may be used to verify digital signatures.
|
|
3682
|
+
* - `'deriveKey'` - The key may be used to derive a new key.
|
|
3683
|
+
* - `'deriveBits'` - The key may be used to derive bits.
|
|
3684
|
+
* - `'wrapKey'` - The key may be used to wrap another key.
|
|
3685
|
+
* - `'unwrapKey'` - The key may be used to unwrap another key.
|
|
3686
|
+
*
|
|
3687
|
+
* Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`).
|
|
3688
|
+
* @since v15.0.0
|
|
3689
|
+
*/
|
|
3690
|
+
readonly usages: KeyUsage[];
|
|
3691
|
+
}
|
|
3692
|
+
/**
|
|
3693
|
+
* The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair.
|
|
3694
|
+
* @since v15.0.0
|
|
3695
|
+
*/
|
|
3696
|
+
interface CryptoKeyPair {
|
|
3697
|
+
/**
|
|
3698
|
+
* A {@link CryptoKey} whose type will be `'private'`.
|
|
3699
|
+
* @since v15.0.0
|
|
3700
|
+
*/
|
|
3701
|
+
privateKey: CryptoKey;
|
|
3702
|
+
/**
|
|
3703
|
+
* A {@link CryptoKey} whose type will be `'public'`.
|
|
3704
|
+
* @since v15.0.0
|
|
3705
|
+
*/
|
|
3706
|
+
publicKey: CryptoKey;
|
|
3707
|
+
}
|
|
3708
|
+
/**
|
|
3709
|
+
* @since v15.0.0
|
|
3710
|
+
*/
|
|
3711
|
+
interface SubtleCrypto {
|
|
3712
|
+
/**
|
|
3713
|
+
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
3714
|
+
* `subtle.decrypt()` attempts to decipher the provided `data`. If successful,
|
|
3715
|
+
* the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
|
|
3716
|
+
*
|
|
3717
|
+
* The algorithms currently supported include:
|
|
3718
|
+
*
|
|
3719
|
+
* - `'RSA-OAEP'`
|
|
3720
|
+
* - `'AES-CTR'`
|
|
3721
|
+
* - `'AES-CBC'`
|
|
3722
|
+
* - `'AES-GCM'`
|
|
3723
|
+
* @since v15.0.0
|
|
3724
|
+
*/
|
|
3725
|
+
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
3726
|
+
/**
|
|
3727
|
+
* Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
|
|
3728
|
+
* `subtle.deriveBits()` attempts to generate `length` bits.
|
|
3729
|
+
* The Node.js implementation requires that `length` is a multiple of `8`.
|
|
3730
|
+
* If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the generated data.
|
|
3731
|
+
*
|
|
3732
|
+
* The algorithms currently supported include:
|
|
3733
|
+
*
|
|
3734
|
+
* - `'ECDH'`
|
|
3735
|
+
* - `'X25519'`
|
|
3736
|
+
* - `'X448'`
|
|
3737
|
+
* - `'HKDF'`
|
|
3738
|
+
* - `'PBKDF2'`
|
|
3739
|
+
* @since v15.0.0
|
|
3740
|
+
*/
|
|
3741
|
+
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
|
|
3742
|
+
/**
|
|
3743
|
+
* Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
|
|
3744
|
+
* `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
|
|
3745
|
+
*
|
|
3746
|
+
* Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
|
|
3747
|
+
* then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
|
|
3748
|
+
*
|
|
3749
|
+
* The algorithms currently supported include:
|
|
3750
|
+
*
|
|
3751
|
+
* - `'ECDH'`
|
|
3752
|
+
* - `'X25519'`
|
|
3753
|
+
* - `'X448'`
|
|
3754
|
+
* - `'HKDF'`
|
|
3755
|
+
* - `'PBKDF2'`
|
|
3756
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3757
|
+
* @since v15.0.0
|
|
3758
|
+
*/
|
|
3759
|
+
deriveKey(
|
|
3760
|
+
algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
3761
|
+
baseKey: CryptoKey,
|
|
3762
|
+
derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params,
|
|
3763
|
+
extractable: boolean,
|
|
3764
|
+
keyUsages: ReadonlyArray<KeyUsage>
|
|
3765
|
+
): Promise<CryptoKey>;
|
|
3766
|
+
/**
|
|
3767
|
+
* Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
|
|
3768
|
+
* If successful, the returned promise is resolved with an `<ArrayBuffer>` containing the computed digest.
|
|
3769
|
+
*
|
|
3770
|
+
* If `algorithm` is provided as a `<string>`, it must be one of:
|
|
3771
|
+
*
|
|
3772
|
+
* - `'SHA-1'`
|
|
3773
|
+
* - `'SHA-256'`
|
|
3774
|
+
* - `'SHA-384'`
|
|
3775
|
+
* - `'SHA-512'`
|
|
3776
|
+
*
|
|
3777
|
+
* If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
|
|
3778
|
+
* @since v15.0.0
|
|
3779
|
+
*/
|
|
3780
|
+
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
|
3781
|
+
/**
|
|
3782
|
+
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|
|
3783
|
+
* `subtle.encrypt()` attempts to encipher `data`. If successful,
|
|
3784
|
+
* the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
|
|
3785
|
+
*
|
|
3786
|
+
* The algorithms currently supported include:
|
|
3787
|
+
*
|
|
3788
|
+
* - `'RSA-OAEP'`
|
|
3789
|
+
* - `'AES-CTR'`
|
|
3790
|
+
* - `'AES-CBC'`
|
|
3791
|
+
* - `'AES-GCM'`
|
|
3792
|
+
* @since v15.0.0
|
|
3793
|
+
*/
|
|
3794
|
+
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
3795
|
+
/**
|
|
3796
|
+
* Exports the given key into the specified format, if supported.
|
|
3797
|
+
*
|
|
3798
|
+
* If the `<CryptoKey>` is not extractable, the returned promise will reject.
|
|
3799
|
+
*
|
|
3800
|
+
* When `format` is either `'pkcs8'` or `'spki'` and the export is successful,
|
|
3801
|
+
* the returned promise will be resolved with an `<ArrayBuffer>` containing the exported key data.
|
|
3802
|
+
*
|
|
3803
|
+
* When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
|
|
3804
|
+
* JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
|
|
3805
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3806
|
+
* @returns `<Promise>` containing `<ArrayBuffer>`.
|
|
3807
|
+
* @since v15.0.0
|
|
3808
|
+
*/
|
|
3809
|
+
exportKey(format: 'jwk', key: CryptoKey): Promise<JsonWebKey>;
|
|
3810
|
+
exportKey(format: Exclude<KeyFormat, 'jwk'>, key: CryptoKey): Promise<ArrayBuffer>;
|
|
3811
|
+
/**
|
|
3812
|
+
* Using the method and parameters provided in `algorithm`,
|
|
3813
|
+
* `subtle.generateKey()` attempts to generate new keying material.
|
|
3814
|
+
* Depending the method used, the method may generate either a single `<CryptoKey>` or a `<CryptoKeyPair>`.
|
|
3815
|
+
*
|
|
3816
|
+
* The `<CryptoKeyPair>` (public and private key) generating algorithms supported include:
|
|
3817
|
+
*
|
|
3818
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3819
|
+
* - `'RSA-PSS'`
|
|
3820
|
+
* - `'RSA-OAEP'`
|
|
3821
|
+
* - `'ECDSA'`
|
|
3822
|
+
* - `'Ed25519'`
|
|
3823
|
+
* - `'Ed448'`
|
|
3824
|
+
* - `'ECDH'`
|
|
3825
|
+
* - `'X25519'`
|
|
3826
|
+
* - `'X448'`
|
|
3827
|
+
* The `<CryptoKey>` (secret key) generating algorithms supported include:
|
|
3828
|
+
*
|
|
3829
|
+
* - `'HMAC'`
|
|
3830
|
+
* - `'AES-CTR'`
|
|
3831
|
+
* - `'AES-CBC'`
|
|
3832
|
+
* - `'AES-GCM'`
|
|
3833
|
+
* - `'AES-KW'`
|
|
3834
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3835
|
+
* @since v15.0.0
|
|
3836
|
+
*/
|
|
3837
|
+
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
|
3838
|
+
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
3839
|
+
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
|
3840
|
+
/**
|
|
3841
|
+
* The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
|
|
3842
|
+
* to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
|
|
3843
|
+
* If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
|
|
3844
|
+
*
|
|
3845
|
+
* If importing a `'PBKDF2'` key, `extractable` must be `false`.
|
|
3846
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3847
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3848
|
+
* @since v15.0.0
|
|
3849
|
+
*/
|
|
3850
|
+
importKey(
|
|
3851
|
+
format: 'jwk',
|
|
3852
|
+
keyData: JsonWebKey,
|
|
3853
|
+
algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
|
|
3854
|
+
extractable: boolean,
|
|
3855
|
+
keyUsages: ReadonlyArray<KeyUsage>
|
|
3856
|
+
): Promise<CryptoKey>;
|
|
3857
|
+
importKey(
|
|
3858
|
+
format: Exclude<KeyFormat, 'jwk'>,
|
|
3859
|
+
keyData: BufferSource,
|
|
3860
|
+
algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
|
|
3861
|
+
extractable: boolean,
|
|
3862
|
+
keyUsages: KeyUsage[]
|
|
3863
|
+
): Promise<CryptoKey>;
|
|
3864
|
+
/**
|
|
3865
|
+
* Using the method and parameters given by `algorithm` and the keying material provided by `key`,
|
|
3866
|
+
* `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful,
|
|
3867
|
+
* the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
|
|
3868
|
+
*
|
|
3869
|
+
* The algorithms currently supported include:
|
|
3870
|
+
*
|
|
3871
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3872
|
+
* - `'RSA-PSS'`
|
|
3873
|
+
* - `'ECDSA'`
|
|
3874
|
+
* - `'Ed25519'`
|
|
3875
|
+
* - `'Ed448'`
|
|
3876
|
+
* - `'HMAC'`
|
|
3877
|
+
* @since v15.0.0
|
|
3878
|
+
*/
|
|
3879
|
+
sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
3880
|
+
/**
|
|
3881
|
+
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
3882
|
+
* The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
|
|
3883
|
+
* It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
|
|
3884
|
+
* then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
|
|
3885
|
+
* If successful, the returned promise is resolved with a `<CryptoKey>` object.
|
|
3886
|
+
*
|
|
3887
|
+
* The wrapping algorithms currently supported include:
|
|
3888
|
+
*
|
|
3889
|
+
* - `'RSA-OAEP'`
|
|
3890
|
+
* - `'AES-CTR'`
|
|
3891
|
+
* - `'AES-CBC'`
|
|
3892
|
+
* - `'AES-GCM'`
|
|
3893
|
+
* - `'AES-KW'`
|
|
3894
|
+
*
|
|
3895
|
+
* The unwrapped key algorithms supported include:
|
|
3896
|
+
*
|
|
3897
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3898
|
+
* - `'RSA-PSS'`
|
|
3899
|
+
* - `'RSA-OAEP'`
|
|
3900
|
+
* - `'ECDSA'`
|
|
3901
|
+
* - `'Ed25519'`
|
|
3902
|
+
* - `'Ed448'`
|
|
3903
|
+
* - `'ECDH'`
|
|
3904
|
+
* - `'X25519'`
|
|
3905
|
+
* - `'X448'`
|
|
3906
|
+
* - `'HMAC'`
|
|
3907
|
+
* - `'AES-CTR'`
|
|
3908
|
+
* - `'AES-CBC'`
|
|
3909
|
+
* - `'AES-GCM'`
|
|
3910
|
+
* - `'AES-KW'`
|
|
3911
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3912
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3913
|
+
* @since v15.0.0
|
|
3914
|
+
*/
|
|
3915
|
+
unwrapKey(
|
|
3916
|
+
format: KeyFormat,
|
|
3917
|
+
wrappedKey: BufferSource,
|
|
3918
|
+
unwrappingKey: CryptoKey,
|
|
3919
|
+
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
|
|
3920
|
+
unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
|
|
3921
|
+
extractable: boolean,
|
|
3922
|
+
keyUsages: KeyUsage[]
|
|
3923
|
+
): Promise<CryptoKey>;
|
|
3924
|
+
/**
|
|
3925
|
+
* Using the method and parameters given in `algorithm` and the keying material provided by `key`,
|
|
3926
|
+
* `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`.
|
|
3927
|
+
* The returned promise is resolved with either `true` or `false`.
|
|
3928
|
+
*
|
|
3929
|
+
* The algorithms currently supported include:
|
|
3930
|
+
*
|
|
3931
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3932
|
+
* - `'RSA-PSS'`
|
|
3933
|
+
* - `'ECDSA'`
|
|
3934
|
+
* - `'Ed25519'`
|
|
3935
|
+
* - `'Ed448'`
|
|
3936
|
+
* - `'HMAC'`
|
|
3937
|
+
* @since v15.0.0
|
|
3938
|
+
*/
|
|
3939
|
+
verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<boolean>;
|
|
3940
|
+
/**
|
|
3941
|
+
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
3942
|
+
* The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
|
|
3943
|
+
* then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
|
|
3944
|
+
* It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
|
|
3945
|
+
* then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
|
|
3946
|
+
* If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the encrypted key data.
|
|
3947
|
+
*
|
|
3948
|
+
* The wrapping algorithms currently supported include:
|
|
3949
|
+
*
|
|
3950
|
+
* - `'RSA-OAEP'`
|
|
3951
|
+
* - `'AES-CTR'`
|
|
3952
|
+
* - `'AES-CBC'`
|
|
3953
|
+
* - `'AES-GCM'`
|
|
3954
|
+
* - `'AES-KW'`
|
|
3955
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3956
|
+
* @since v15.0.0
|
|
3957
|
+
*/
|
|
3958
|
+
wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise<ArrayBuffer>;
|
|
3959
|
+
}
|
|
3334
3960
|
}
|
|
3335
3961
|
}
|
|
3336
3962
|
declare module 'node:crypto' {
|