aws-delivlib 14.4.2 → 14.4.3
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/lib/publishing/github/node_modules/.yarn-integrity +42 -36
- package/lib/publishing/github/node_modules/@octokit/app/dist-node/index.js +146 -106
- package/lib/publishing/github/node_modules/@octokit/app/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/each-installation.js +34 -23
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/each-repository.js +46 -38
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/get-installation-octokit.js +16 -13
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/index.js +76 -63
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/middleware/node/index.js +48 -41
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/middleware/node/on-unhandled-request-default.js +12 -7
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/webhooks.js +44 -51
- package/lib/publishing/github/node_modules/@octokit/app/dist-types/each-installation.d.ts +6 -3
- package/lib/publishing/github/node_modules/@octokit/app/dist-types/each-repository.d.ts +1 -0
- package/lib/publishing/github/node_modules/@octokit/app/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/app/dist-web/index.js +306 -0
- package/lib/publishing/github/node_modules/@octokit/app/dist-web/index.js.map +7 -0
- package/lib/publishing/github/node_modules/@octokit/app/package.json +22 -21
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-node/index.js +239 -180
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/auth.js +27 -24
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/cache.js +73 -66
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/get-app-authentication.js +28 -21
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/get-installation-authentication.js +96 -74
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/hook.js +79 -75
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/index.js +51 -39
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/requires-app-auth.js +30 -47
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/to-token-authentication.js +29 -11
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/auth.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/cache.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/get-app-authentication.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/get-installation-authentication.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/hook.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/index.d.ts +2 -2
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/to-token-authentication.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/types.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-web/index.js +405 -360
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/package.json +24 -25
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-node/index.js +15 -17
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-src/version.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-types/types.d.ts +17 -17
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-web/index.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-web/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/package.json +3 -3
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-node/index.js +23 -31
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-src/version.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-types/types.d.ts +12 -12
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-web/index.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-web/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/package.json +5 -5
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/README.md +23 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-node/index.js +40 -39
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/auth.js +8 -0
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/get-authentication.js +3 -0
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/index.js +2 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/version.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-types/hook.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-types/types.d.ts +38 -34
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-web/index.js +14 -2
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-web/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/package.json +5 -5
- package/lib/publishing/github/node_modules/@octokit/auth-token/README.md +5 -10
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-node/index.js +44 -20
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/auth.js +13 -17
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/hook.js +10 -4
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/index.js +16 -11
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js +8 -10
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/auth.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/hook.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/index.d.ts +2 -2
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/types.d.ts +13 -13
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-web/index.js +42 -45
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/auth-token/package.json +23 -27
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-node/index.js +47 -22
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/auth.js +8 -5
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/hook.js +33 -24
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/index.js +12 -7
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/is-abuse-limit-error.js +8 -5
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/is-rate-limit-error.js +11 -9
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-types/index.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-types/types.d.ts +9 -9
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-web/index.js +62 -50
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/package.json +22 -23
- package/lib/publishing/github/node_modules/@octokit/core/README.md +4 -4
- package/lib/publishing/github/node_modules/@octokit/core/dist-node/index.js +119 -100
- package/lib/publishing/github/node_modules/@octokit/core/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/core/dist-src/index.js +114 -112
- package/lib/publishing/github/node_modules/@octokit/core/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/core/dist-types/types.d.ts +7 -7
- package/lib/publishing/github/node_modules/@octokit/core/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/core/dist-web/index.js +124 -122
- package/lib/publishing/github/node_modules/@octokit/core/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/core/package.json +26 -27
- package/lib/publishing/github/node_modules/@octokit/endpoint/README.md +3 -3
- package/lib/publishing/github/node_modules/@octokit/endpoint/dist-node/index.js +22 -62
- package/lib/publishing/github/node_modules/@octokit/endpoint/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/endpoint/dist-src/version.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/endpoint/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/endpoint/dist-web/index.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/endpoint/dist-web/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/endpoint/package.json +4 -4
- package/lib/publishing/github/node_modules/@octokit/graphql/README.md +1 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-node/index.js +81 -39
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/error.js +17 -17
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/graphql.js +55 -44
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/index.js +17 -12
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/with-defaults.js +12 -9
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/error.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/graphql.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/index.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/types.d.ts +7 -7
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/with-defaults.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-web/index.js +103 -90
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/package.json +23 -24
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-node/index.js +290 -263
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/add-event-handler.js +13 -10
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/emit-event.js +13 -10
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/index.js +108 -64
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/check-token.js +14 -11
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/create-token.js +27 -24
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/delete-authorization.js +43 -40
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/delete-token.js +32 -29
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/get-oauth-client-code.js +5 -2
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/get-user-octokit.js +29 -24
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/get-web-flow-authorization-url.js +16 -28
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/refresh-token.js +34 -29
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/reset-token.js +58 -55
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/scope-token.js +34 -29
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/aws-lambda/api-gateway-v2-parse-request.js +14 -11
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/aws-lambda/api-gateway-v2-send-response.js +9 -6
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/aws-lambda/api-gateway-v2.js +21 -13
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/handle-request.js +217 -210
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/node/index.js +30 -20
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/node/parse-request.js +13 -13
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/node/send-response.js +6 -3
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/on-unhandled-request-default.js +11 -8
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/web-worker/index.js +31 -19
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/web-worker/parse-request.js +11 -9
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/web-worker/send-response.js +8 -5
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/oauth-app-octokit.js +5 -2
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-types/middleware/web-worker/index.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-app/package.json +20 -20
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-node/index.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-src/version.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/check-token.d.ts +4 -4
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/create-device-code.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/delete-authorization.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/delete-token.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/exchange-device-code.d.ts +11 -11
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/exchange-web-flow-code.d.ts +4 -4
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/get-web-flow-authorization-url.d.ts +4 -4
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/refresh-token.d.ts +2 -2
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/reset-token.d.ts +4 -4
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/scope-token.d.ts +8 -8
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/types.d.ts +9 -9
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-methods/package.json +7 -7
- package/lib/publishing/github/node_modules/@octokit/openapi-types/package.json +2 -2
- package/lib/publishing/github/node_modules/@octokit/openapi-types/types.d.ts +77450 -13127
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js +292 -57
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/compose-paginate.js +5 -2
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js +226 -213
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/index.js +17 -12
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/iterator.js +36 -37
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/normalize-paginated-list-response.js +29 -45
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/paginate.js +31 -21
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/paginating-endpoints.js +14 -9
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/compose-paginate.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts +183 -111
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/index.d.ts +3 -4
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/iterator.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/normalize-paginated-list-response.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/paginate.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/types.d.ts +29 -29
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js +334 -334
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/package.json +24 -26
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js +99 -39
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +197 -77
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types.d.ts +1419 -661
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts +359 -119
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js +198 -78
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/package.json +9 -9
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-node/index.js +80 -35
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/error-request.js +12 -13
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/index.js +29 -22
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/wrap-request.js +31 -15
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-types/error-request.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-types/wrap-request.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-web/index.js +68 -54
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-retry/package.json +21 -22
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-node/index.js +18 -11
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-src/index.js +21 -14
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-src/version.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-types/index.d.ts +6 -0
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-types/types.d.ts +13 -12
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-web/index.js +22 -15
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-web/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-throttling/package.json +7 -7
- package/lib/publishing/github/node_modules/@octokit/request/README.md +3 -3
- package/lib/publishing/github/node_modules/@octokit/request/dist-node/index.js +105 -77
- package/lib/publishing/github/node_modules/@octokit/request/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js +111 -108
- package/lib/publishing/github/node_modules/@octokit/request/dist-src/get-buffer-response.js +5 -2
- package/lib/publishing/github/node_modules/@octokit/request/dist-src/index.js +7 -4
- package/lib/publishing/github/node_modules/@octokit/request/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/request/dist-src/with-defaults.js +23 -18
- package/lib/publishing/github/node_modules/@octokit/request/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/request/dist-web/index.js +148 -138
- package/lib/publishing/github/node_modules/@octokit/request/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/request/package.json +23 -24
- package/lib/publishing/github/node_modules/@octokit/request-error/dist-node/index.js +10 -19
- package/lib/publishing/github/node_modules/@octokit/request-error/dist-node/index.js.map +1 -1
- package/lib/publishing/github/node_modules/@octokit/request-error/dist-types/types.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/request-error/package.json +4 -4
- package/lib/publishing/github/node_modules/@octokit/tsconfig/LICENSE +7 -0
- package/lib/publishing/github/node_modules/@octokit/tsconfig/README.md +31 -0
- package/lib/publishing/github/node_modules/@octokit/tsconfig/package.json +28 -0
- package/lib/publishing/github/node_modules/@octokit/types/dist-node/index.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-src/VERSION.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/EndpointDefaults.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/EndpointOptions.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/Fetch.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/GetResponseTypeFromEndpointMethod.d.ts +4 -4
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestError.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestHeaders.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestMethod.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestOptions.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestParameters.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/ResponseHeaders.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/Route.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/Signal.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/Url.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/VERSION.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts +464 -332
- package/lib/publishing/github/node_modules/@octokit/types/dist-web/index.js +1 -1
- package/lib/publishing/github/node_modules/@octokit/types/package.json +10 -10
- package/lib/publishing/github/node_modules/@octokit/webhooks/README.md +68 -64
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-node/index.js +467 -97
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/createLogger.js +11 -6
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/index.js +23 -16
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/on.js +31 -22
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/receive.js +51 -49
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/remove-listener.js +18 -15
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/wrap-error-handler.js +17 -18
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/generated/webhook-names.js +262 -254
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/index.js +40 -22
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/get-missing-headers.js +8 -6
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/get-payload.js +27 -22
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/index.js +19 -6
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/middleware.js +86 -72
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/on-unhandled-request-default.js +12 -7
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/sign.js +8 -2
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/to-normalized-json-string.js +8 -8
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/verify-and-receive.js +22 -16
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/verify.js +9 -2
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/event-handler/on.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/event-handler/remove-listener.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/generated/webhook-names.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/index.d.ts +14 -4
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/get-missing-headers.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/get-payload.d.ts +3 -3
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/index.d.ts +2 -2
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/middleware.d.ts +4 -4
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/on-unhandled-request-default.d.ts +2 -2
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/types.d.ts +5 -4
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/to-normalized-json-string.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/types.d.ts +12 -11
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/verify-and-receive.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-web/index.js +609 -533
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/package.json +20 -22
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/README.md +84 -3
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-node/index.js +89 -48
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/index.js +22 -2
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/node/sign.js +19 -16
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/node/verify.js +18 -14
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/types.js +8 -5
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/utils.js +5 -2
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/web.js +62 -44
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/index.d.ts +3 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/node/sign.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/types.d.ts +2 -2
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/web.d.ts +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-web/index.js +71 -53
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-methods/package.json +36 -25
- package/lib/publishing/github/node_modules/@octokit/webhooks-types/package.json +1 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks-types/schema.d.ts +670 -35
- package/lib/publishing/github/node_modules/@types/aws-lambda/README.md +2 -2
- package/lib/publishing/github/node_modules/@types/aws-lambda/index.d.ts +3 -2
- package/lib/publishing/github/node_modules/@types/aws-lambda/package.json +3 -8
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/amplify-resolver.d.ts +38 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +75 -1
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +4 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/codecommit.d.ts +36 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +8 -4
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-sms-sender.d.ts +49 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +1 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +11 -1
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +26 -1
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/msk.d.ts +7 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/self-managed-kafka.d.ts +27 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/sns.d.ts +2 -2
- package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/sqs.d.ts +1 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/README.md +1 -1
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/index.d.ts +14 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/README.md +2 -2
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/assert.d.ts +135 -75
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/async_hooks.d.ts +67 -38
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/buffer.d.ts +220 -101
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/child_process.d.ts +87 -58
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/cluster.d.ts +25 -29
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/console.d.ts +5 -5
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/crypto.d.ts +873 -249
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dgram.d.ts +16 -16
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns/promises.d.ts +52 -8
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns.d.ts +27 -18
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dom-events.d.ts +126 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/domain.d.ts +6 -5
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/events.d.ts +166 -93
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs/promises.d.ts +149 -74
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs.d.ts +288 -121
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.d.ts +22 -13
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http.d.ts +453 -125
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http2.d.ts +74 -46
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/https.d.ts +103 -53
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/index.d.ts +6 -2
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/inspector.d.ts +20 -16
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/module.d.ts +6 -4
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/net.d.ts +106 -16
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/os.d.ts +36 -14
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/package.json +15 -3
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/path.d.ts +37 -26
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/perf_hooks.d.ts +96 -15
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/process.d.ts +53 -50
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/punycode.d.ts +1 -1
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/querystring.d.ts +6 -6
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline/promises.d.ts +145 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline.d.ts +51 -175
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/repl.d.ts +21 -21
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream/consumers.d.ts +2 -14
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream.d.ts +983 -824
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/string_decoder.d.ts +6 -6
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/test.d.ts +1052 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers/promises.d.ts +26 -1
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers.d.ts +125 -4
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tls.d.ts +149 -50
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/trace_events.d.ts +30 -9
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/buffer.d.ts +2351 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/crypto.d.ts +3961 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/fs.d.ts +4043 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/net.d.ts +886 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/process.d.ts +1485 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/tty.d.ts +205 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tty.d.ts +7 -6
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/url.d.ts +66 -56
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/util.d.ts +528 -70
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/v8.d.ts +271 -14
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/vm.d.ts +421 -34
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/wasi.d.ts +13 -19
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/worker_threads.d.ts +81 -37
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/zlib.d.ts +11 -11
- package/lib/publishing/github/node_modules/@types/jsonwebtoken/package.json +3 -3
- package/lib/publishing/github/node_modules/@types/node/README.md +1 -1
- package/lib/publishing/github/node_modules/@types/node/child_process.d.ts +41 -2
- package/lib/publishing/github/node_modules/@types/node/crypto.d.ts +77 -7
- package/lib/publishing/github/node_modules/@types/node/fs/promises.d.ts +15 -12
- package/lib/publishing/github/node_modules/@types/node/globals.d.ts +5 -3
- package/lib/publishing/github/node_modules/@types/node/http.d.ts +142 -53
- package/lib/publishing/github/node_modules/@types/node/http2.d.ts +1 -2
- package/lib/publishing/github/node_modules/@types/node/https.d.ts +192 -62
- package/lib/publishing/github/node_modules/@types/node/index.d.ts +1 -1
- package/lib/publishing/github/node_modules/@types/node/inspector.d.ts +1 -1
- package/lib/publishing/github/node_modules/@types/node/net.d.ts +1 -0
- package/lib/publishing/github/node_modules/@types/node/os.d.ts +1 -0
- package/lib/publishing/github/node_modules/@types/node/package.json +10 -3
- package/lib/publishing/github/node_modules/@types/node/path.d.ts +32 -21
- package/lib/publishing/github/node_modules/@types/node/stream.d.ts +99 -0
- package/lib/publishing/github/node_modules/@types/node/tls.d.ts +13 -13
- package/lib/publishing/github/node_modules/@types/node/ts4.8/assert.d.ts +128 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/async_hooks.d.ts +229 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/buffer.d.ts +89 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/child_process.d.ts +553 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/cluster.d.ts +265 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/console.d.ts +142 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/crypto.d.ts +1283 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/dgram.d.ts +144 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/dns.d.ts +387 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/domain.d.ts +27 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/events.d.ts +82 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/fs/promises.d.ts +572 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/fs.d.ts +2281 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/globals.d.ts +746 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/http.d.ts +580 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/http2.d.ts +961 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/https.d.ts +272 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/index.d.ts +53 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/inspector.d.ts +3051 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/module.d.ts +56 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/net.d.ts +309 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/os.d.ts +243 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/path.d.ts +168 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/perf_hooks.d.ts +274 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/process.d.ts +413 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/punycode.d.ts +78 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/querystring.d.ts +31 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/readline.d.ts +174 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/repl.d.ts +398 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/stream.d.ts +458 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/string_decoder.d.ts +10 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/timers.d.ts +19 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/tls.d.ts +784 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/trace_events.d.ts +64 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/tty.d.ts +69 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/url.d.ts +177 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/util.d.ts +216 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/v8.d.ts +190 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/vm.d.ts +155 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/wasi.d.ts +89 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/worker_threads.d.ts +241 -0
- package/lib/publishing/github/node_modules/@types/node/ts4.8/zlib.d.ts +364 -0
- package/lib/publishing/github/node_modules/@types/node/url.d.ts +28 -0
- package/lib/publishing/github/node_modules/before-after-hook/README.md +1 -3
- package/lib/publishing/github/node_modules/before-after-hook/index.d.ts +48 -48
- package/lib/publishing/github/node_modules/before-after-hook/index.js +43 -39
- package/lib/publishing/github/node_modules/before-after-hook/package.json +15 -10
- package/lib/publishing/github/node_modules/lru-cache/LICENSE +1 -1
- package/lib/publishing/github/node_modules/lru-cache/README.md +1127 -104
- package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.d.ts +834 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.d.ts.map +1 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.js +1395 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.js.map +1 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.min.js +2 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.min.js.map +7 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/cjs/package.json +3 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.d.ts +834 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.d.ts.map +1 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.js +1391 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.js.map +1 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.min.js +2 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.min.js.map +7 -0
- package/lib/publishing/github/node_modules/lru-cache/dist/mjs/package.json +3 -0
- package/lib/publishing/github/node_modules/lru-cache/package.json +86 -12
- package/lib/publishing/github/node_modules/node-fetch/README.md +43 -0
- package/lib/publishing/github/node_modules/node-fetch/browser.js +7 -7
- package/lib/publishing/github/node_modules/node-fetch/lib/index.es.js +92 -2
- package/lib/publishing/github/node_modules/node-fetch/lib/index.js +92 -2
- package/lib/publishing/github/node_modules/node-fetch/lib/index.mjs +92 -2
- package/lib/publishing/github/node_modules/node-fetch/package.json +16 -3
- package/lib/publishing/github/node_modules/octokit/README.md +4 -4
- package/lib/publishing/github/node_modules/octokit/dist-node/index.js +60 -33
- package/lib/publishing/github/node_modules/octokit/dist-node/index.js.map +7 -1
- package/lib/publishing/github/node_modules/octokit/dist-src/app.js +8 -3
- package/lib/publishing/github/node_modules/octokit/dist-src/index.js +8 -2
- package/lib/publishing/github/node_modules/octokit/dist-src/octokit.js +28 -20
- package/lib/publishing/github/node_modules/octokit/dist-src/version.js +4 -1
- package/lib/publishing/github/node_modules/octokit/dist-types/app.d.ts +2 -2
- package/lib/publishing/github/node_modules/octokit/dist-types/octokit.d.ts +1 -1
- package/lib/publishing/github/node_modules/octokit/dist-types/version.d.ts +1 -1
- package/lib/publishing/github/node_modules/octokit/dist-web/index.js +46 -34
- package/lib/publishing/github/node_modules/octokit/dist-web/index.js.map +7 -1
- package/lib/publishing/github/node_modules/octokit/package.json +26 -28
- package/lib/publishing/github/node_modules/semver/README.md +67 -0
- package/lib/publishing/github/node_modules/semver/bin/semver.js +16 -2
- package/lib/publishing/github/node_modules/semver/classes/comparator.js +37 -33
- package/lib/publishing/github/node_modules/semver/classes/range.js +6 -2
- package/lib/publishing/github/node_modules/semver/classes/semver.js +27 -14
- package/lib/publishing/github/node_modules/semver/functions/diff.js +48 -17
- package/lib/publishing/github/node_modules/semver/functions/inc.js +3 -2
- package/lib/publishing/github/node_modules/semver/functions/parse.js +5 -22
- package/lib/publishing/github/node_modules/semver/index.js +1 -0
- package/lib/publishing/github/node_modules/semver/internal/constants.js +15 -2
- package/lib/publishing/github/node_modules/semver/internal/parse-options.js +14 -10
- package/lib/publishing/github/node_modules/semver/node_modules/lru-cache/LICENSE +15 -0
- package/lib/publishing/github/node_modules/semver/node_modules/lru-cache/README.md +166 -0
- package/lib/publishing/github/node_modules/semver/node_modules/lru-cache/package.json +34 -0
- package/lib/publishing/github/node_modules/semver/package.json +7 -6
- package/lib/publishing/github/node_modules/semver/ranges/intersects.js +1 -1
- package/lib/publishing/github/node_modules/semver/ranges/subset.js +6 -3
- package/lib/publishing/github/node_modules/typescript/lib/tsc.js +8 -3
- package/lib/publishing/github/node_modules/typescript/lib/tsserver.js +13 -3
- package/lib/publishing/github/node_modules/typescript/lib/tsserverlibrary.js +13 -3
- package/lib/publishing/github/node_modules/typescript/lib/typescript.js +13 -3
- package/lib/publishing/github/node_modules/typescript/lib/typescriptServices.js +13 -3
- package/lib/publishing/github/node_modules/typescript/lib/typingsInstaller.js +13 -3
- package/lib/publishing/github/node_modules/typescript/package.json +1 -1
- package/lib/publishing/github/package-lock.json +675 -0
- package/lib/publishing/github/package.json +1 -1
- package/lib/publishing/github/publish.sh +3 -1
- package/package.json +1 -1
- package/lib/publishing/github/node_modules/@octokit/app/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/core/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/types.js +0 -1
- package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/types.js +0 -1
- package/lib/publishing/github/node_modules/@types/lru-cache/LICENSE +0 -21
- package/lib/publishing/github/node_modules/@types/lru-cache/README.md +0 -16
- package/lib/publishing/github/node_modules/@types/lru-cache/index.d.ts +0 -193
- package/lib/publishing/github/node_modules/@types/lru-cache/package.json +0 -30
- package/lib/publishing/github/yarn.lock +0 -473
- /package/lib/publishing/github/node_modules/{lru-cache → semver/node_modules/lru-cache}/index.js +0 -0
package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/crypto.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `crypto` module provides cryptographic functionality that includes a
|
|
3
|
-
* wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify
|
|
2
|
+
* The `node:crypto` module provides cryptographic functionality that includes a
|
|
3
|
+
* set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify
|
|
4
|
+
* functions.
|
|
4
5
|
*
|
|
5
6
|
* ```js
|
|
6
|
-
* const { createHmac } = await import('crypto');
|
|
7
|
+
* const { createHmac } = await import('node:crypto');
|
|
7
8
|
*
|
|
8
9
|
* const secret = 'abcdefg';
|
|
9
10
|
* const hash = createHmac('sha256', secret)
|
|
@@ -13,47 +14,73 @@
|
|
|
13
14
|
* // Prints:
|
|
14
15
|
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
|
15
16
|
* ```
|
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
17
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js)
|
|
17
18
|
*/
|
|
18
19
|
declare module 'crypto' {
|
|
19
20
|
import * as stream from 'node:stream';
|
|
20
21
|
import { PeerCertificate } from 'node:tls';
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* SPKAC is a Certificate Signing Request mechanism originally implemented by
|
|
24
|
+
* Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
|
|
25
|
+
*
|
|
26
|
+
* `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
|
|
27
|
+
* should not use this element anymore.
|
|
28
|
+
*
|
|
29
|
+
* The `node:crypto` module provides the `Certificate` class for working with SPKAC
|
|
30
|
+
* data. The most common usage is handling output generated by the HTML5`<keygen>` element. Node.js uses [OpenSSL's SPKAC
|
|
31
|
+
* implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally.
|
|
32
|
+
* @since v0.11.8
|
|
33
|
+
*/
|
|
34
|
+
class Certificate {
|
|
22
35
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
36
|
+
* ```js
|
|
37
|
+
* const { Certificate } = await import('node:crypto');
|
|
38
|
+
* const spkac = getSpkacSomehow();
|
|
39
|
+
* const challenge = Certificate.exportChallenge(spkac);
|
|
40
|
+
* console.log(challenge.toString('utf8'));
|
|
41
|
+
* // Prints: the challenge as a UTF8 string
|
|
42
|
+
* ```
|
|
43
|
+
* @since v9.0.0
|
|
44
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
45
|
+
* @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
|
|
27
46
|
*/
|
|
28
|
-
exportChallenge(spkac: BinaryLike): Buffer;
|
|
47
|
+
static exportChallenge(spkac: BinaryLike): Buffer;
|
|
29
48
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
49
|
+
* ```js
|
|
50
|
+
* const { Certificate } = await import('node:crypto');
|
|
51
|
+
* const spkac = getSpkacSomehow();
|
|
52
|
+
* const publicKey = Certificate.exportPublicKey(spkac);
|
|
53
|
+
* console.log(publicKey);
|
|
54
|
+
* // Prints: the public key as <Buffer ...>
|
|
55
|
+
* ```
|
|
56
|
+
* @since v9.0.0
|
|
57
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
58
|
+
* @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
|
|
35
59
|
*/
|
|
36
|
-
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
60
|
+
static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
37
61
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
62
|
+
* ```js
|
|
63
|
+
* import { Buffer } from 'node:buffer';
|
|
64
|
+
* const { Certificate } = await import('node:crypto');
|
|
65
|
+
*
|
|
66
|
+
* const spkac = getSpkacSomehow();
|
|
67
|
+
* console.log(Certificate.verifySpkac(Buffer.from(spkac)));
|
|
68
|
+
* // Prints: true or false
|
|
69
|
+
* ```
|
|
70
|
+
* @since v9.0.0
|
|
71
|
+
* @param encoding The `encoding` of the `spkac` string.
|
|
72
|
+
* @return `true` if the given `spkac` data structure is valid, `false` otherwise.
|
|
42
73
|
*/
|
|
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;
|
|
74
|
+
static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
50
75
|
/**
|
|
76
|
+
* @deprecated
|
|
51
77
|
* @param spkac
|
|
52
78
|
* @returns The challenge component of the `spkac` data structure,
|
|
53
79
|
* which includes a public key and a challenge.
|
|
54
80
|
*/
|
|
55
81
|
exportChallenge(spkac: BinaryLike): Buffer;
|
|
56
82
|
/**
|
|
83
|
+
* @deprecated
|
|
57
84
|
* @param spkac
|
|
58
85
|
* @param encoding The encoding of the spkac string.
|
|
59
86
|
* @returns The public key component of the `spkac` data structure,
|
|
@@ -61,14 +88,15 @@ declare module 'crypto' {
|
|
|
61
88
|
*/
|
|
62
89
|
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
63
90
|
/**
|
|
91
|
+
* @deprecated
|
|
64
92
|
* @param spkac
|
|
65
93
|
* @returns `true` if the given `spkac` data structure is valid,
|
|
66
94
|
* `false` otherwise.
|
|
67
95
|
*/
|
|
68
96
|
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
69
|
-
}
|
|
97
|
+
}
|
|
70
98
|
namespace constants {
|
|
71
|
-
// https://nodejs.org/dist/latest-
|
|
99
|
+
// https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants
|
|
72
100
|
const OPENSSL_VERSION_NUMBER: number;
|
|
73
101
|
/** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
|
|
74
102
|
const SSL_OP_ALL: number;
|
|
@@ -84,18 +112,8 @@ declare module 'crypto' {
|
|
|
84
112
|
const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
|
|
85
113
|
/** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */
|
|
86
114
|
const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
|
|
87
|
-
/** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */
|
|
88
|
-
const SSL_OP_EPHEMERAL_RSA: number;
|
|
89
115
|
/** Allows initial connection to servers that do not support RI. */
|
|
90
116
|
const SSL_OP_LEGACY_SERVER_CONNECT: number;
|
|
91
|
-
const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
|
|
92
|
-
const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
|
|
93
|
-
/** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */
|
|
94
|
-
const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
|
|
95
|
-
const SSL_OP_NETSCAPE_CA_DN_BUG: number;
|
|
96
|
-
const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
|
|
97
|
-
const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
|
|
98
|
-
const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
|
|
99
117
|
/** Instructs OpenSSL to disable support for SSL/TLS compression. */
|
|
100
118
|
const SSL_OP_NO_COMPRESSION: number;
|
|
101
119
|
const SSL_OP_NO_QUERY_MTU: number;
|
|
@@ -107,16 +125,6 @@ declare module 'crypto' {
|
|
|
107
125
|
const SSL_OP_NO_TLSv1: number;
|
|
108
126
|
const SSL_OP_NO_TLSv1_1: number;
|
|
109
127
|
const SSL_OP_NO_TLSv1_2: number;
|
|
110
|
-
const SSL_OP_PKCS1_CHECK_1: number;
|
|
111
|
-
const SSL_OP_PKCS1_CHECK_2: number;
|
|
112
|
-
/** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */
|
|
113
|
-
const SSL_OP_SINGLE_DH_USE: number;
|
|
114
|
-
/** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */
|
|
115
|
-
const SSL_OP_SINGLE_ECDH_USE: number;
|
|
116
|
-
const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
|
|
117
|
-
const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
|
|
118
|
-
const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
|
|
119
|
-
const SSL_OP_TLS_D5_BUG: number;
|
|
120
128
|
/** Instructs OpenSSL to disable version rollback attack detection. */
|
|
121
129
|
const SSL_OP_TLS_ROLLBACK_BUG: number;
|
|
122
130
|
const ENGINE_METHOD_RSA: number;
|
|
@@ -134,7 +142,6 @@ declare module 'crypto' {
|
|
|
134
142
|
const DH_CHECK_P_NOT_PRIME: number;
|
|
135
143
|
const DH_UNABLE_TO_CHECK_GENERATOR: number;
|
|
136
144
|
const DH_NOT_SUITABLE_GENERATOR: number;
|
|
137
|
-
const ALPN_ENABLED: number;
|
|
138
145
|
const RSA_PKCS1_PADDING: number;
|
|
139
146
|
const RSA_SSLV23_PADDING: number;
|
|
140
147
|
const RSA_NO_PADDING: number;
|
|
@@ -172,19 +179,19 @@ declare module 'crypto' {
|
|
|
172
179
|
*
|
|
173
180
|
* The `algorithm` is dependent on the available algorithms supported by the
|
|
174
181
|
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
175
|
-
* On recent releases of OpenSSL, `openssl list -digest-algorithms`
|
|
182
|
+
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
176
183
|
* display the available digest algorithms.
|
|
177
184
|
*
|
|
178
185
|
* Example: generating the sha256 sum of a file
|
|
179
186
|
*
|
|
180
187
|
* ```js
|
|
181
188
|
* import {
|
|
182
|
-
* createReadStream
|
|
183
|
-
* } from 'fs';
|
|
184
|
-
* import { argv } from 'process';
|
|
189
|
+
* createReadStream,
|
|
190
|
+
* } from 'node:fs';
|
|
191
|
+
* import { argv } from 'node:process';
|
|
185
192
|
* const {
|
|
186
|
-
* createHash
|
|
187
|
-
* } = await import('crypto');
|
|
193
|
+
* createHash,
|
|
194
|
+
* } = await import('node:crypto');
|
|
188
195
|
*
|
|
189
196
|
* const filename = argv[2];
|
|
190
197
|
*
|
|
@@ -212,7 +219,7 @@ declare module 'crypto' {
|
|
|
212
219
|
*
|
|
213
220
|
* The `algorithm` is dependent on the available algorithms supported by the
|
|
214
221
|
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
|
215
|
-
* On recent releases of OpenSSL, `openssl list -digest-algorithms`
|
|
222
|
+
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
|
216
223
|
* display the available digest algorithms.
|
|
217
224
|
*
|
|
218
225
|
* The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
|
|
@@ -222,12 +229,12 @@ declare module 'crypto' {
|
|
|
222
229
|
*
|
|
223
230
|
* ```js
|
|
224
231
|
* import {
|
|
225
|
-
* createReadStream
|
|
226
|
-
* } from 'fs';
|
|
227
|
-
* import { argv } from 'process';
|
|
232
|
+
* createReadStream,
|
|
233
|
+
* } from 'node:fs';
|
|
234
|
+
* import { argv } from 'node:process';
|
|
228
235
|
* const {
|
|
229
|
-
* createHmac
|
|
230
|
-
* } = await import('crypto');
|
|
236
|
+
* createHmac,
|
|
237
|
+
* } = await import('node:crypto');
|
|
231
238
|
*
|
|
232
239
|
* const filename = argv[2];
|
|
233
240
|
*
|
|
@@ -270,8 +277,8 @@ declare module 'crypto' {
|
|
|
270
277
|
*
|
|
271
278
|
* ```js
|
|
272
279
|
* const {
|
|
273
|
-
* createHash
|
|
274
|
-
* } = await import('crypto');
|
|
280
|
+
* createHash,
|
|
281
|
+
* } = await import('node:crypto');
|
|
275
282
|
*
|
|
276
283
|
* const hash = createHash('sha256');
|
|
277
284
|
*
|
|
@@ -293,9 +300,9 @@ declare module 'crypto' {
|
|
|
293
300
|
* Example: Using `Hash` and piped streams:
|
|
294
301
|
*
|
|
295
302
|
* ```js
|
|
296
|
-
* import { createReadStream } from 'fs';
|
|
297
|
-
* import { stdout } from 'process';
|
|
298
|
-
* const { createHash } = await import('crypto');
|
|
303
|
+
* import { createReadStream } from 'node:fs';
|
|
304
|
+
* import { stdout } from 'node:process';
|
|
305
|
+
* const { createHash } = await import('node:crypto');
|
|
299
306
|
*
|
|
300
307
|
* const hash = createHash('sha256');
|
|
301
308
|
*
|
|
@@ -307,8 +314,8 @@ declare module 'crypto' {
|
|
|
307
314
|
*
|
|
308
315
|
* ```js
|
|
309
316
|
* const {
|
|
310
|
-
* createHash
|
|
311
|
-
* } = await import('crypto');
|
|
317
|
+
* createHash,
|
|
318
|
+
* } = await import('node:crypto');
|
|
312
319
|
*
|
|
313
320
|
* const hash = createHash('sha256');
|
|
314
321
|
*
|
|
@@ -335,8 +342,8 @@ declare module 'crypto' {
|
|
|
335
342
|
* ```js
|
|
336
343
|
* // Calculate a rolling hash.
|
|
337
344
|
* const {
|
|
338
|
-
* createHash
|
|
339
|
-
* } = await import('crypto');
|
|
345
|
+
* createHash,
|
|
346
|
+
* } = await import('node:crypto');
|
|
340
347
|
*
|
|
341
348
|
* const hash = createHash('sha256');
|
|
342
349
|
*
|
|
@@ -395,8 +402,8 @@ declare module 'crypto' {
|
|
|
395
402
|
*
|
|
396
403
|
* ```js
|
|
397
404
|
* const {
|
|
398
|
-
* createHmac
|
|
399
|
-
* } = await import('crypto');
|
|
405
|
+
* createHmac,
|
|
406
|
+
* } = await import('node:crypto');
|
|
400
407
|
*
|
|
401
408
|
* const hmac = createHmac('sha256', 'a secret');
|
|
402
409
|
*
|
|
@@ -418,11 +425,11 @@ declare module 'crypto' {
|
|
|
418
425
|
* Example: Using `Hmac` and piped streams:
|
|
419
426
|
*
|
|
420
427
|
* ```js
|
|
421
|
-
* import { createReadStream } from 'fs';
|
|
422
|
-
* import { stdout } from 'process';
|
|
428
|
+
* import { createReadStream } from 'node:fs';
|
|
429
|
+
* import { stdout } from 'node:process';
|
|
423
430
|
* const {
|
|
424
|
-
* createHmac
|
|
425
|
-
* } = await import('crypto');
|
|
431
|
+
* createHmac,
|
|
432
|
+
* } = await import('node:crypto');
|
|
426
433
|
*
|
|
427
434
|
* const hmac = createHmac('sha256', 'a secret');
|
|
428
435
|
*
|
|
@@ -434,8 +441,8 @@ declare module 'crypto' {
|
|
|
434
441
|
*
|
|
435
442
|
* ```js
|
|
436
443
|
* const {
|
|
437
|
-
* createHmac
|
|
438
|
-
* } = await import('crypto');
|
|
444
|
+
* createHmac,
|
|
445
|
+
* } = await import('node:crypto');
|
|
439
446
|
*
|
|
440
447
|
* const hmac = createHmac('sha256', 'a secret');
|
|
441
448
|
*
|
|
@@ -529,9 +536,6 @@ declare module 'crypto' {
|
|
|
529
536
|
*/
|
|
530
537
|
namedCurve?: string | undefined;
|
|
531
538
|
}
|
|
532
|
-
interface JwkKeyExportOptions {
|
|
533
|
-
format: 'jwk';
|
|
534
|
-
}
|
|
535
539
|
/**
|
|
536
540
|
* Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
|
|
537
541
|
* and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject`
|
|
@@ -551,13 +555,13 @@ declare module 'crypto' {
|
|
|
551
555
|
* Example: Converting a `CryptoKey` instance to a `KeyObject`:
|
|
552
556
|
*
|
|
553
557
|
* ```js
|
|
554
|
-
* const {
|
|
555
|
-
* const { subtle } =
|
|
558
|
+
* const { KeyObject } = await import('node:crypto');
|
|
559
|
+
* const { subtle } = globalThis.crypto;
|
|
556
560
|
*
|
|
557
561
|
* const key = await subtle.generateKey({
|
|
558
562
|
* name: 'HMAC',
|
|
559
563
|
* hash: 'SHA-256',
|
|
560
|
-
* length: 256
|
|
564
|
+
* length: 256,
|
|
561
565
|
* }, true, ['sign', 'verify']);
|
|
562
566
|
*
|
|
563
567
|
* const keyObject = KeyObject.from(key);
|
|
@@ -662,17 +666,22 @@ declare module 'crypto' {
|
|
|
662
666
|
* Creates and returns a `Cipher` object that uses the given `algorithm` and`password`.
|
|
663
667
|
*
|
|
664
668
|
* The `options` argument controls stream behavior and is optional except when a
|
|
665
|
-
* cipher in CCM or OCB mode
|
|
669
|
+
* 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
670
|
* 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
671
|
* tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
|
|
672
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
668
673
|
*
|
|
669
674
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
670
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
675
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
671
676
|
* display the available cipher algorithms.
|
|
672
677
|
*
|
|
673
678
|
* The `password` is used to derive the cipher key and initialization vector (IV).
|
|
674
679
|
* The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`.
|
|
675
680
|
*
|
|
681
|
+
* **This function is semantically insecure for all**
|
|
682
|
+
* **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,**
|
|
683
|
+
* **GCM, or CCM).**
|
|
684
|
+
*
|
|
676
685
|
* The implementation of `crypto.createCipher()` derives keys using the OpenSSL
|
|
677
686
|
* function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one
|
|
678
687
|
* iteration, and no salt. The lack of salt allows dictionary attacks as the same
|
|
@@ -700,12 +709,13 @@ declare module 'crypto' {
|
|
|
700
709
|
* initialization vector (`iv`).
|
|
701
710
|
*
|
|
702
711
|
* The `options` argument controls stream behavior and is optional except when a
|
|
703
|
-
* cipher in CCM or OCB mode
|
|
712
|
+
* 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
713
|
* 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
714
|
* tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
|
|
715
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
706
716
|
*
|
|
707
717
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
708
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
718
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
709
719
|
* display the available cipher algorithms.
|
|
710
720
|
*
|
|
711
721
|
* 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
|
|
@@ -747,8 +757,8 @@ declare module 'crypto' {
|
|
|
747
757
|
* const {
|
|
748
758
|
* scrypt,
|
|
749
759
|
* randomFill,
|
|
750
|
-
* createCipheriv
|
|
751
|
-
* } = await import('crypto');
|
|
760
|
+
* createCipheriv,
|
|
761
|
+
* } = await import('node:crypto');
|
|
752
762
|
*
|
|
753
763
|
* const algorithm = 'aes-192-cbc';
|
|
754
764
|
* const password = 'Password used to generate key';
|
|
@@ -782,17 +792,17 @@ declare module 'crypto' {
|
|
|
782
792
|
* import {
|
|
783
793
|
* createReadStream,
|
|
784
794
|
* createWriteStream,
|
|
785
|
-
* } from 'fs';
|
|
795
|
+
* } from 'node:fs';
|
|
786
796
|
*
|
|
787
797
|
* import {
|
|
788
|
-
* pipeline
|
|
789
|
-
* } from 'stream';
|
|
798
|
+
* pipeline,
|
|
799
|
+
* } from 'node:stream';
|
|
790
800
|
*
|
|
791
801
|
* const {
|
|
792
802
|
* scrypt,
|
|
793
803
|
* randomFill,
|
|
794
|
-
* createCipheriv
|
|
795
|
-
* } = await import('crypto');
|
|
804
|
+
* createCipheriv,
|
|
805
|
+
* } = await import('node:crypto');
|
|
796
806
|
*
|
|
797
807
|
* const algorithm = 'aes-192-cbc';
|
|
798
808
|
* const password = 'Password used to generate key';
|
|
@@ -823,8 +833,8 @@ declare module 'crypto' {
|
|
|
823
833
|
* const {
|
|
824
834
|
* scrypt,
|
|
825
835
|
* randomFill,
|
|
826
|
-
* createCipheriv
|
|
827
|
-
* } = await import('crypto');
|
|
836
|
+
* createCipheriv,
|
|
837
|
+
* } = await import('node:crypto');
|
|
828
838
|
*
|
|
829
839
|
* const algorithm = 'aes-192-cbc';
|
|
830
840
|
* const password = 'Password used to generate key';
|
|
@@ -925,8 +935,13 @@ declare module 'crypto' {
|
|
|
925
935
|
* Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key).
|
|
926
936
|
*
|
|
927
937
|
* The `options` argument controls stream behavior and is optional except when a
|
|
928
|
-
* cipher in CCM or OCB mode
|
|
938
|
+
* 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
939
|
* authentication tag in bytes, see `CCM mode`.
|
|
940
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
941
|
+
*
|
|
942
|
+
* **This function is semantically insecure for all**
|
|
943
|
+
* **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,**
|
|
944
|
+
* **GCM, or CCM).**
|
|
930
945
|
*
|
|
931
946
|
* The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
|
|
932
947
|
* 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 +966,13 @@ declare module 'crypto' {
|
|
|
951
966
|
* Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`).
|
|
952
967
|
*
|
|
953
968
|
* The `options` argument controls stream behavior and is optional except when a
|
|
954
|
-
* cipher in CCM or OCB mode
|
|
969
|
+
* 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
970
|
* 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
971
|
* to those with the specified length.
|
|
972
|
+
* For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
|
|
957
973
|
*
|
|
958
974
|
* The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
|
|
959
|
-
* recent OpenSSL releases, `openssl list -cipher-algorithms`
|
|
975
|
+
* recent OpenSSL releases, `openssl list -cipher-algorithms` will
|
|
960
976
|
* display the available cipher algorithms.
|
|
961
977
|
*
|
|
962
978
|
* 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
|
|
@@ -995,11 +1011,11 @@ declare module 'crypto' {
|
|
|
995
1011
|
* Example: Using `Decipher` objects as streams:
|
|
996
1012
|
*
|
|
997
1013
|
* ```js
|
|
998
|
-
* import { Buffer } from 'buffer';
|
|
1014
|
+
* import { Buffer } from 'node:buffer';
|
|
999
1015
|
* const {
|
|
1000
1016
|
* scryptSync,
|
|
1001
|
-
* createDecipheriv
|
|
1002
|
-
* } = await import('crypto');
|
|
1017
|
+
* createDecipheriv,
|
|
1018
|
+
* } = await import('node:crypto');
|
|
1003
1019
|
*
|
|
1004
1020
|
* const algorithm = 'aes-192-cbc';
|
|
1005
1021
|
* const password = 'Password used to generate key';
|
|
@@ -1014,6 +1030,7 @@ declare module 'crypto' {
|
|
|
1014
1030
|
*
|
|
1015
1031
|
* let decrypted = '';
|
|
1016
1032
|
* decipher.on('readable', () => {
|
|
1033
|
+
* let chunk;
|
|
1017
1034
|
* while (null !== (chunk = decipher.read())) {
|
|
1018
1035
|
* decrypted += chunk.toString('utf8');
|
|
1019
1036
|
* }
|
|
@@ -1036,12 +1053,12 @@ declare module 'crypto' {
|
|
|
1036
1053
|
* import {
|
|
1037
1054
|
* createReadStream,
|
|
1038
1055
|
* createWriteStream,
|
|
1039
|
-
* } from 'fs';
|
|
1040
|
-
* import { Buffer } from 'buffer';
|
|
1056
|
+
* } from 'node:fs';
|
|
1057
|
+
* import { Buffer } from 'node:buffer';
|
|
1041
1058
|
* const {
|
|
1042
1059
|
* scryptSync,
|
|
1043
|
-
* createDecipheriv
|
|
1044
|
-
* } = await import('crypto');
|
|
1060
|
+
* createDecipheriv,
|
|
1061
|
+
* } = await import('node:crypto');
|
|
1045
1062
|
*
|
|
1046
1063
|
* const algorithm = 'aes-192-cbc';
|
|
1047
1064
|
* const password = 'Password used to generate key';
|
|
@@ -1061,11 +1078,11 @@ declare module 'crypto' {
|
|
|
1061
1078
|
* Example: Using the `decipher.update()` and `decipher.final()` methods:
|
|
1062
1079
|
*
|
|
1063
1080
|
* ```js
|
|
1064
|
-
* import { Buffer } from 'buffer';
|
|
1081
|
+
* import { Buffer } from 'node:buffer';
|
|
1065
1082
|
* const {
|
|
1066
1083
|
* scryptSync,
|
|
1067
|
-
* createDecipheriv
|
|
1068
|
-
* } = await import('crypto');
|
|
1084
|
+
* createDecipheriv,
|
|
1085
|
+
* } = await import('node:crypto');
|
|
1069
1086
|
*
|
|
1070
1087
|
* const algorithm = 'aes-192-cbc';
|
|
1071
1088
|
* const password = 'Password used to generate key';
|
|
@@ -1162,19 +1179,21 @@ declare module 'crypto' {
|
|
|
1162
1179
|
format?: KeyFormat | undefined;
|
|
1163
1180
|
type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined;
|
|
1164
1181
|
passphrase?: string | Buffer | undefined;
|
|
1182
|
+
encoding?: string | undefined;
|
|
1165
1183
|
}
|
|
1166
1184
|
interface PublicKeyInput {
|
|
1167
1185
|
key: string | Buffer;
|
|
1168
1186
|
format?: KeyFormat | undefined;
|
|
1169
1187
|
type?: 'pkcs1' | 'spki' | undefined;
|
|
1188
|
+
encoding?: string | undefined;
|
|
1170
1189
|
}
|
|
1171
1190
|
/**
|
|
1172
1191
|
* Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
|
|
1173
1192
|
*
|
|
1174
1193
|
* ```js
|
|
1175
1194
|
* const {
|
|
1176
|
-
* generateKey
|
|
1177
|
-
* } = await import('crypto');
|
|
1195
|
+
* generateKey,
|
|
1196
|
+
* } = await import('node:crypto');
|
|
1178
1197
|
*
|
|
1179
1198
|
* generateKey('hmac', { length: 64 }, (err, key) => {
|
|
1180
1199
|
* if (err) throw err;
|
|
@@ -1196,8 +1215,8 @@ declare module 'crypto' {
|
|
|
1196
1215
|
*
|
|
1197
1216
|
* ```js
|
|
1198
1217
|
* const {
|
|
1199
|
-
* generateKeySync
|
|
1200
|
-
* } = await import('crypto');
|
|
1218
|
+
* generateKeySync,
|
|
1219
|
+
* } = await import('node:crypto');
|
|
1201
1220
|
*
|
|
1202
1221
|
* const key = generateKeySync('hmac', { length: 64 });
|
|
1203
1222
|
* console.log(key.export().toString('hex')); // e89..........41e
|
|
@@ -1263,7 +1282,7 @@ declare module 'crypto' {
|
|
|
1263
1282
|
type DSAEncoding = 'der' | 'ieee-p1363';
|
|
1264
1283
|
interface SigningOptions {
|
|
1265
1284
|
/**
|
|
1266
|
-
* @
|
|
1285
|
+
* @see crypto.constants.RSA_PKCS1_PADDING
|
|
1267
1286
|
*/
|
|
1268
1287
|
padding?: number | undefined;
|
|
1269
1288
|
saltLength?: number | undefined;
|
|
@@ -1277,6 +1296,7 @@ declare module 'crypto' {
|
|
|
1277
1296
|
interface VerifyKeyObjectInput extends SigningOptions {
|
|
1278
1297
|
key: KeyObject;
|
|
1279
1298
|
}
|
|
1299
|
+
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1280
1300
|
type KeyLike = string | Buffer | KeyObject;
|
|
1281
1301
|
/**
|
|
1282
1302
|
* The `Sign` class is a utility for generating signatures. It can be used in one
|
|
@@ -1296,11 +1316,11 @@ declare module 'crypto' {
|
|
|
1296
1316
|
* const {
|
|
1297
1317
|
* generateKeyPairSync,
|
|
1298
1318
|
* createSign,
|
|
1299
|
-
* createVerify
|
|
1300
|
-
* } = await import('crypto');
|
|
1319
|
+
* createVerify,
|
|
1320
|
+
* } = await import('node:crypto');
|
|
1301
1321
|
*
|
|
1302
1322
|
* const { privateKey, publicKey } = generateKeyPairSync('ec', {
|
|
1303
|
-
* namedCurve: 'sect239k1'
|
|
1323
|
+
* namedCurve: 'sect239k1',
|
|
1304
1324
|
* });
|
|
1305
1325
|
*
|
|
1306
1326
|
* const sign = createSign('SHA256');
|
|
@@ -1321,8 +1341,8 @@ declare module 'crypto' {
|
|
|
1321
1341
|
* const {
|
|
1322
1342
|
* generateKeyPairSync,
|
|
1323
1343
|
* createSign,
|
|
1324
|
-
* createVerify
|
|
1325
|
-
* } = await import('crypto');
|
|
1344
|
+
* createVerify,
|
|
1345
|
+
* } = await import('node:crypto');
|
|
1326
1346
|
*
|
|
1327
1347
|
* const { privateKey, publicKey } = generateKeyPairSync('rsa', {
|
|
1328
1348
|
* modulusLength: 2048,
|
|
@@ -1431,8 +1451,8 @@ declare module 'crypto' {
|
|
|
1431
1451
|
* be passed instead of a public key.
|
|
1432
1452
|
* @since v0.1.92
|
|
1433
1453
|
*/
|
|
1434
|
-
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
|
|
1435
|
-
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
|
|
1454
|
+
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean;
|
|
1455
|
+
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
|
|
1436
1456
|
}
|
|
1437
1457
|
/**
|
|
1438
1458
|
* Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
|
|
@@ -1450,10 +1470,10 @@ declare module 'crypto' {
|
|
|
1450
1470
|
* @param [generator=2]
|
|
1451
1471
|
* @param generatorEncoding The `encoding` of the `generator` string.
|
|
1452
1472
|
*/
|
|
1453
|
-
function createDiffieHellman(primeLength: number, generator?: number
|
|
1454
|
-
function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
|
|
1455
|
-
function createDiffieHellman(prime: string,
|
|
1456
|
-
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator
|
|
1473
|
+
function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
|
|
1474
|
+
function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman;
|
|
1475
|
+
function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
|
|
1476
|
+
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman;
|
|
1457
1477
|
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
|
|
1458
1478
|
/**
|
|
1459
1479
|
* The `DiffieHellman` class is a utility for creating Diffie-Hellman key
|
|
@@ -1462,11 +1482,11 @@ declare module 'crypto' {
|
|
|
1462
1482
|
* Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function.
|
|
1463
1483
|
*
|
|
1464
1484
|
* ```js
|
|
1465
|
-
* import assert from 'assert';
|
|
1485
|
+
* import assert from 'node:assert';
|
|
1466
1486
|
*
|
|
1467
1487
|
* const {
|
|
1468
|
-
* createDiffieHellman
|
|
1469
|
-
* } = await import('crypto');
|
|
1488
|
+
* createDiffieHellman,
|
|
1489
|
+
* } = await import('node:crypto');
|
|
1470
1490
|
*
|
|
1471
1491
|
* // Generate Alice's keys...
|
|
1472
1492
|
* const alice = createDiffieHellman(2048);
|
|
@@ -1510,9 +1530,9 @@ declare module 'crypto' {
|
|
|
1510
1530
|
* @param inputEncoding The `encoding` of an `otherPublicKey` string.
|
|
1511
1531
|
* @param outputEncoding The `encoding` of the return value.
|
|
1512
1532
|
*/
|
|
1513
|
-
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
|
|
1514
|
-
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
|
|
1515
|
-
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
1533
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
|
|
1534
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
|
|
1535
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string;
|
|
1516
1536
|
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
|
|
1517
1537
|
/**
|
|
1518
1538
|
* Returns the Diffie-Hellman prime in the specified `encoding`.
|
|
@@ -1572,7 +1592,7 @@ declare module 'crypto' {
|
|
|
1572
1592
|
* A bit field containing any warnings and/or errors resulting from a check
|
|
1573
1593
|
* performed during initialization of the `DiffieHellman` object.
|
|
1574
1594
|
*
|
|
1575
|
-
* The following values are valid for this property (as defined in `constants`module):
|
|
1595
|
+
* The following values are valid for this property (as defined in `node:constants` module):
|
|
1576
1596
|
*
|
|
1577
1597
|
* * `DH_CHECK_P_NOT_SAFE_PRIME`
|
|
1578
1598
|
* * `DH_CHECK_P_NOT_PRIME`
|
|
@@ -1582,11 +1602,41 @@ declare module 'crypto' {
|
|
|
1582
1602
|
*/
|
|
1583
1603
|
verifyError: number;
|
|
1584
1604
|
}
|
|
1605
|
+
/**
|
|
1606
|
+
* The `DiffieHellmanGroup` class takes a well-known modp group as its argument.
|
|
1607
|
+
* It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation.
|
|
1608
|
+
* In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods.
|
|
1609
|
+
*
|
|
1610
|
+
* ```js
|
|
1611
|
+
* const { createDiffieHellmanGroup } = await import('node:crypto');
|
|
1612
|
+
* const dh = createDiffieHellmanGroup('modp1');
|
|
1613
|
+
* ```
|
|
1614
|
+
* 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):
|
|
1615
|
+
* ```bash
|
|
1616
|
+
* $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
|
|
1617
|
+
* modp1 # 768 bits
|
|
1618
|
+
* modp2 # 1024 bits
|
|
1619
|
+
* modp5 # 1536 bits
|
|
1620
|
+
* modp14 # 2048 bits
|
|
1621
|
+
* modp15 # etc.
|
|
1622
|
+
* modp16
|
|
1623
|
+
* modp17
|
|
1624
|
+
* modp18
|
|
1625
|
+
* ```
|
|
1626
|
+
* @since v0.7.5
|
|
1627
|
+
*/
|
|
1628
|
+
const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
|
|
1629
|
+
interface DiffieHellmanGroupConstructor {
|
|
1630
|
+
new (name: string): DiffieHellmanGroup;
|
|
1631
|
+
(name: string): DiffieHellmanGroup;
|
|
1632
|
+
readonly prototype: DiffieHellmanGroup;
|
|
1633
|
+
}
|
|
1634
|
+
type DiffieHellmanGroup = Omit<DiffieHellman, 'setPublicKey' | 'setPrivateKey'>;
|
|
1585
1635
|
/**
|
|
1586
1636
|
* Creates a predefined `DiffieHellmanGroup` key exchange object. The
|
|
1587
|
-
* supported groups are
|
|
1588
|
-
*
|
|
1589
|
-
* returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing
|
|
1637
|
+
* supported groups are listed in the documentation for `DiffieHellmanGroup`.
|
|
1638
|
+
*
|
|
1639
|
+
* The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing
|
|
1590
1640
|
* the keys (with `diffieHellman.setPublicKey()`, for example). The
|
|
1591
1641
|
* advantage of using this method is that the parties do not have to
|
|
1592
1642
|
* generate nor exchange a group modulus beforehand, saving both processor
|
|
@@ -1596,8 +1646,8 @@ declare module 'crypto' {
|
|
|
1596
1646
|
*
|
|
1597
1647
|
* ```js
|
|
1598
1648
|
* const {
|
|
1599
|
-
* getDiffieHellman
|
|
1600
|
-
* } = await import('crypto');
|
|
1649
|
+
* getDiffieHellman,
|
|
1650
|
+
* } = await import('node:crypto');
|
|
1601
1651
|
* const alice = getDiffieHellman('modp14');
|
|
1602
1652
|
* const bob = getDiffieHellman('modp14');
|
|
1603
1653
|
*
|
|
@@ -1612,7 +1662,12 @@ declare module 'crypto' {
|
|
|
1612
1662
|
* ```
|
|
1613
1663
|
* @since v0.7.5
|
|
1614
1664
|
*/
|
|
1615
|
-
function getDiffieHellman(groupName: string):
|
|
1665
|
+
function getDiffieHellman(groupName: string): DiffieHellmanGroup;
|
|
1666
|
+
/**
|
|
1667
|
+
* An alias for {@link getDiffieHellman}
|
|
1668
|
+
* @since v0.9.3
|
|
1669
|
+
*/
|
|
1670
|
+
function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
|
|
1616
1671
|
/**
|
|
1617
1672
|
* Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
|
1618
1673
|
* implementation. A selected HMAC digest algorithm specified by `digest` is
|
|
@@ -1622,9 +1677,6 @@ declare module 'crypto' {
|
|
|
1622
1677
|
* otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be
|
|
1623
1678
|
* thrown if any of the input arguments specify invalid values or types.
|
|
1624
1679
|
*
|
|
1625
|
-
* If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated,
|
|
1626
|
-
* please specify a `digest` explicitly.
|
|
1627
|
-
*
|
|
1628
1680
|
* The `iterations` argument must be a number set as high as possible. The
|
|
1629
1681
|
* higher the number of iterations, the more secure the derived key will be,
|
|
1630
1682
|
* but will take a longer amount of time to complete.
|
|
@@ -1636,8 +1688,8 @@ declare module 'crypto' {
|
|
|
1636
1688
|
*
|
|
1637
1689
|
* ```js
|
|
1638
1690
|
* const {
|
|
1639
|
-
* pbkdf2
|
|
1640
|
-
* } = await import('crypto');
|
|
1691
|
+
* pbkdf2,
|
|
1692
|
+
* } = await import('node:crypto');
|
|
1641
1693
|
*
|
|
1642
1694
|
* pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
|
|
1643
1695
|
* if (err) throw err;
|
|
@@ -1645,18 +1697,6 @@ declare module 'crypto' {
|
|
|
1645
1697
|
* });
|
|
1646
1698
|
* ```
|
|
1647
1699
|
*
|
|
1648
|
-
* The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been
|
|
1649
|
-
* deprecated and use should be avoided.
|
|
1650
|
-
*
|
|
1651
|
-
* ```js
|
|
1652
|
-
* import crypto from 'crypto';
|
|
1653
|
-
* crypto.DEFAULT_ENCODING = 'hex';
|
|
1654
|
-
* crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {
|
|
1655
|
-
* if (err) throw err;
|
|
1656
|
-
* console.log(derivedKey); // '3745e48...aa39b34'
|
|
1657
|
-
* });
|
|
1658
|
-
* ```
|
|
1659
|
-
*
|
|
1660
1700
|
* An array of supported digest functions can be retrieved using {@link getHashes}.
|
|
1661
1701
|
*
|
|
1662
1702
|
* This API uses libuv's threadpool, which can have surprising and
|
|
@@ -1672,9 +1712,6 @@ declare module 'crypto' {
|
|
|
1672
1712
|
* If an error occurs an `Error` will be thrown, otherwise the derived key will be
|
|
1673
1713
|
* returned as a `Buffer`.
|
|
1674
1714
|
*
|
|
1675
|
-
* If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated,
|
|
1676
|
-
* please specify a `digest` explicitly.
|
|
1677
|
-
*
|
|
1678
1715
|
* The `iterations` argument must be a number set as high as possible. The
|
|
1679
1716
|
* higher the number of iterations, the more secure the derived key will be,
|
|
1680
1717
|
* but will take a longer amount of time to complete.
|
|
@@ -1686,23 +1723,13 @@ declare module 'crypto' {
|
|
|
1686
1723
|
*
|
|
1687
1724
|
* ```js
|
|
1688
1725
|
* const {
|
|
1689
|
-
* pbkdf2Sync
|
|
1690
|
-
* } = await import('crypto');
|
|
1726
|
+
* pbkdf2Sync,
|
|
1727
|
+
* } = await import('node:crypto');
|
|
1691
1728
|
*
|
|
1692
1729
|
* const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
|
|
1693
1730
|
* console.log(key.toString('hex')); // '3745e48...08d59ae'
|
|
1694
1731
|
* ```
|
|
1695
1732
|
*
|
|
1696
|
-
* The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use
|
|
1697
|
-
* should be avoided.
|
|
1698
|
-
*
|
|
1699
|
-
* ```js
|
|
1700
|
-
* import crypto from 'crypto';
|
|
1701
|
-
* crypto.DEFAULT_ENCODING = 'hex';
|
|
1702
|
-
* const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
|
|
1703
|
-
* console.log(key); // '3745e48...aa39b34'
|
|
1704
|
-
* ```
|
|
1705
|
-
*
|
|
1706
1733
|
* An array of supported digest functions can be retrieved using {@link getHashes}.
|
|
1707
1734
|
* @since v0.9.3
|
|
1708
1735
|
*/
|
|
@@ -1718,8 +1745,8 @@ declare module 'crypto' {
|
|
|
1718
1745
|
* ```js
|
|
1719
1746
|
* // Asynchronous
|
|
1720
1747
|
* const {
|
|
1721
|
-
* randomBytes
|
|
1722
|
-
* } = await import('crypto');
|
|
1748
|
+
* randomBytes,
|
|
1749
|
+
* } = await import('node:crypto');
|
|
1723
1750
|
*
|
|
1724
1751
|
* randomBytes(256, (err, buf) => {
|
|
1725
1752
|
* if (err) throw err;
|
|
@@ -1734,8 +1761,8 @@ declare module 'crypto' {
|
|
|
1734
1761
|
* ```js
|
|
1735
1762
|
* // Synchronous
|
|
1736
1763
|
* const {
|
|
1737
|
-
* randomBytes
|
|
1738
|
-
* } = await import('crypto');
|
|
1764
|
+
* randomBytes,
|
|
1765
|
+
* } = await import('node:crypto');
|
|
1739
1766
|
*
|
|
1740
1767
|
* const buf = randomBytes(256);
|
|
1741
1768
|
* console.log(
|
|
@@ -1776,8 +1803,8 @@ declare module 'crypto' {
|
|
|
1776
1803
|
* ```js
|
|
1777
1804
|
* // Asynchronous
|
|
1778
1805
|
* const {
|
|
1779
|
-
* randomInt
|
|
1780
|
-
* } = await import('crypto');
|
|
1806
|
+
* randomInt,
|
|
1807
|
+
* } = await import('node:crypto');
|
|
1781
1808
|
*
|
|
1782
1809
|
* randomInt(3, (err, n) => {
|
|
1783
1810
|
* if (err) throw err;
|
|
@@ -1788,8 +1815,8 @@ declare module 'crypto' {
|
|
|
1788
1815
|
* ```js
|
|
1789
1816
|
* // Synchronous
|
|
1790
1817
|
* const {
|
|
1791
|
-
* randomInt
|
|
1792
|
-
* } = await import('crypto');
|
|
1818
|
+
* randomInt,
|
|
1819
|
+
* } = await import('node:crypto');
|
|
1793
1820
|
*
|
|
1794
1821
|
* const n = randomInt(3);
|
|
1795
1822
|
* console.log(`Random number chosen from (0, 1, 2): ${n}`);
|
|
@@ -1798,8 +1825,8 @@ declare module 'crypto' {
|
|
|
1798
1825
|
* ```js
|
|
1799
1826
|
* // With `min` argument
|
|
1800
1827
|
* const {
|
|
1801
|
-
* randomInt
|
|
1802
|
-
* } = await import('crypto');
|
|
1828
|
+
* randomInt,
|
|
1829
|
+
* } = await import('node:crypto');
|
|
1803
1830
|
*
|
|
1804
1831
|
* const n = randomInt(1, 7);
|
|
1805
1832
|
* console.log(`The dice rolled: ${n}`);
|
|
@@ -1817,8 +1844,8 @@ declare module 'crypto' {
|
|
|
1817
1844
|
* Synchronous version of {@link randomFill}.
|
|
1818
1845
|
*
|
|
1819
1846
|
* ```js
|
|
1820
|
-
* import { Buffer } from 'buffer';
|
|
1821
|
-
* const { randomFillSync } = await import('crypto');
|
|
1847
|
+
* import { Buffer } from 'node:buffer';
|
|
1848
|
+
* const { randomFillSync } = await import('node:crypto');
|
|
1822
1849
|
*
|
|
1823
1850
|
* const buf = Buffer.alloc(10);
|
|
1824
1851
|
* console.log(randomFillSync(buf).toString('hex'));
|
|
@@ -1834,8 +1861,8 @@ declare module 'crypto' {
|
|
|
1834
1861
|
* Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`.
|
|
1835
1862
|
*
|
|
1836
1863
|
* ```js
|
|
1837
|
-
* import { Buffer } from 'buffer';
|
|
1838
|
-
* const { randomFillSync } = await import('crypto');
|
|
1864
|
+
* import { Buffer } from 'node:buffer';
|
|
1865
|
+
* const { randomFillSync } = await import('node:crypto');
|
|
1839
1866
|
*
|
|
1840
1867
|
* const a = new Uint32Array(10);
|
|
1841
1868
|
* console.log(Buffer.from(randomFillSync(a).buffer,
|
|
@@ -1863,8 +1890,8 @@ declare module 'crypto' {
|
|
|
1863
1890
|
* If the `callback` function is not provided, an error will be thrown.
|
|
1864
1891
|
*
|
|
1865
1892
|
* ```js
|
|
1866
|
-
* import { Buffer } from 'buffer';
|
|
1867
|
-
* const { randomFill } = await import('crypto');
|
|
1893
|
+
* import { Buffer } from 'node:buffer';
|
|
1894
|
+
* const { randomFill } = await import('node:crypto');
|
|
1868
1895
|
*
|
|
1869
1896
|
* const buf = Buffer.alloc(10);
|
|
1870
1897
|
* randomFill(buf, (err, buf) => {
|
|
@@ -1893,8 +1920,8 @@ declare module 'crypto' {
|
|
|
1893
1920
|
* distribution and have no meaningful lower or upper bounds.
|
|
1894
1921
|
*
|
|
1895
1922
|
* ```js
|
|
1896
|
-
* import { Buffer } from 'buffer';
|
|
1897
|
-
* const { randomFill } = await import('crypto');
|
|
1923
|
+
* import { Buffer } from 'node:buffer';
|
|
1924
|
+
* const { randomFill } = await import('node:crypto');
|
|
1898
1925
|
*
|
|
1899
1926
|
* const a = new Uint32Array(10);
|
|
1900
1927
|
* randomFill(a, (err, buf) => {
|
|
@@ -1960,8 +1987,8 @@ declare module 'crypto' {
|
|
|
1960
1987
|
*
|
|
1961
1988
|
* ```js
|
|
1962
1989
|
* const {
|
|
1963
|
-
* scrypt
|
|
1964
|
-
* } = await import('crypto');
|
|
1990
|
+
* scrypt,
|
|
1991
|
+
* } = await import('node:crypto');
|
|
1965
1992
|
*
|
|
1966
1993
|
* // Using the factory defaults.
|
|
1967
1994
|
* scrypt('password', 'salt', 64, (err, derivedKey) => {
|
|
@@ -1996,8 +2023,8 @@ declare module 'crypto' {
|
|
|
1996
2023
|
*
|
|
1997
2024
|
* ```js
|
|
1998
2025
|
* const {
|
|
1999
|
-
* scryptSync
|
|
2000
|
-
* } = await import('crypto');
|
|
2026
|
+
* scryptSync,
|
|
2027
|
+
* } = await import('node:crypto');
|
|
2001
2028
|
* // Using the factory defaults.
|
|
2002
2029
|
*
|
|
2003
2030
|
* const key1 = scryptSync('password', 'salt', 64);
|
|
@@ -2068,8 +2095,8 @@ declare module 'crypto' {
|
|
|
2068
2095
|
/**
|
|
2069
2096
|
* ```js
|
|
2070
2097
|
* const {
|
|
2071
|
-
* getCiphers
|
|
2072
|
-
* } = await import('crypto');
|
|
2098
|
+
* getCiphers,
|
|
2099
|
+
* } = await import('node:crypto');
|
|
2073
2100
|
*
|
|
2074
2101
|
* console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]
|
|
2075
2102
|
* ```
|
|
@@ -2080,8 +2107,8 @@ declare module 'crypto' {
|
|
|
2080
2107
|
/**
|
|
2081
2108
|
* ```js
|
|
2082
2109
|
* const {
|
|
2083
|
-
* getCurves
|
|
2084
|
-
* } = await import('crypto');
|
|
2110
|
+
* getCurves,
|
|
2111
|
+
* } = await import('node:crypto');
|
|
2085
2112
|
*
|
|
2086
2113
|
* console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]
|
|
2087
2114
|
* ```
|
|
@@ -2094,11 +2121,18 @@ declare module 'crypto' {
|
|
|
2094
2121
|
* @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
2122
|
*/
|
|
2096
2123
|
function getFips(): 1 | 0;
|
|
2124
|
+
/**
|
|
2125
|
+
* Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build.
|
|
2126
|
+
* Throws an error if FIPS mode is not available.
|
|
2127
|
+
* @since v10.0.0
|
|
2128
|
+
* @param bool `true` to enable FIPS mode.
|
|
2129
|
+
*/
|
|
2130
|
+
function setFips(bool: boolean): void;
|
|
2097
2131
|
/**
|
|
2098
2132
|
* ```js
|
|
2099
2133
|
* const {
|
|
2100
|
-
* getHashes
|
|
2101
|
-
* } = await import('crypto');
|
|
2134
|
+
* getHashes,
|
|
2135
|
+
* } = await import('node:crypto');
|
|
2102
2136
|
*
|
|
2103
2137
|
* console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]
|
|
2104
2138
|
* ```
|
|
@@ -2113,11 +2147,11 @@ declare module 'crypto' {
|
|
|
2113
2147
|
* Instances of the `ECDH` class can be created using the {@link createECDH} function.
|
|
2114
2148
|
*
|
|
2115
2149
|
* ```js
|
|
2116
|
-
* import assert from 'assert';
|
|
2150
|
+
* import assert from 'node:assert';
|
|
2117
2151
|
*
|
|
2118
2152
|
* const {
|
|
2119
|
-
* createECDH
|
|
2120
|
-
* } = await import('crypto');
|
|
2153
|
+
* createECDH,
|
|
2154
|
+
* } = await import('node:crypto');
|
|
2121
2155
|
*
|
|
2122
2156
|
* // Generate Alice's keys...
|
|
2123
2157
|
* const alice = createECDH('secp521r1');
|
|
@@ -2158,8 +2192,8 @@ declare module 'crypto' {
|
|
|
2158
2192
|
* ```js
|
|
2159
2193
|
* const {
|
|
2160
2194
|
* createECDH,
|
|
2161
|
-
* ECDH
|
|
2162
|
-
* } = await import('crypto');
|
|
2195
|
+
* ECDH,
|
|
2196
|
+
* } = await import('node:crypto');
|
|
2163
2197
|
*
|
|
2164
2198
|
* const ecdh = createECDH('secp256k1');
|
|
2165
2199
|
* ecdh.generateKeys();
|
|
@@ -2241,7 +2275,7 @@ declare module 'crypto' {
|
|
|
2241
2275
|
* @param [format='uncompressed']
|
|
2242
2276
|
* @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
|
|
2243
2277
|
*/
|
|
2244
|
-
getPublicKey(): Buffer;
|
|
2278
|
+
getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer;
|
|
2245
2279
|
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2246
2280
|
/**
|
|
2247
2281
|
* Sets the EC Diffie-Hellman private key.
|
|
@@ -2266,28 +2300,33 @@ declare module 'crypto' {
|
|
|
2266
2300
|
*/
|
|
2267
2301
|
function createECDH(curveName: string): ECDH;
|
|
2268
2302
|
/**
|
|
2269
|
-
* This function
|
|
2270
|
-
*
|
|
2303
|
+
* This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time
|
|
2304
|
+
* algorithm.
|
|
2305
|
+
*
|
|
2306
|
+
* This function does not leak timing information that
|
|
2271
2307
|
* would allow an attacker to guess one of the values. This is suitable for
|
|
2272
2308
|
* comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
|
|
2273
2309
|
*
|
|
2274
2310
|
* `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
|
|
2275
|
-
* must have the same byte length.
|
|
2311
|
+
* must have the same byte length. An error is thrown if `a` and `b` have
|
|
2312
|
+
* different byte lengths.
|
|
2276
2313
|
*
|
|
2277
2314
|
* If at least one of `a` and `b` is a `TypedArray` with more than one byte per
|
|
2278
2315
|
* entry, such as `Uint16Array`, the result will be computed using the platform
|
|
2279
2316
|
* byte order.
|
|
2280
2317
|
*
|
|
2318
|
+
* **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754**
|
|
2319
|
+
* **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point**
|
|
2320
|
+
* **numbers `x` and `y` are equal.**
|
|
2321
|
+
*
|
|
2281
2322
|
* Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code
|
|
2282
2323
|
* is timing-safe. Care should be taken to ensure that the surrounding code does
|
|
2283
2324
|
* not introduce timing vulnerabilities.
|
|
2284
2325
|
* @since v6.6.0
|
|
2285
2326
|
*/
|
|
2286
2327
|
function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
|
|
2287
|
-
/** @deprecated since v10.0.0 */
|
|
2288
|
-
const DEFAULT_ENCODING: BufferEncoding;
|
|
2289
2328
|
type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
|
|
2290
|
-
type KeyFormat = 'pem' | 'der';
|
|
2329
|
+
type KeyFormat = 'pem' | 'der' | 'jwk';
|
|
2291
2330
|
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
2292
2331
|
format: T;
|
|
2293
2332
|
cipher?: string | undefined;
|
|
@@ -2483,8 +2522,8 @@ declare module 'crypto' {
|
|
|
2483
2522
|
*
|
|
2484
2523
|
* ```js
|
|
2485
2524
|
* const {
|
|
2486
|
-
* generateKeyPairSync
|
|
2487
|
-
* } = await import('crypto');
|
|
2525
|
+
* generateKeyPairSync,
|
|
2526
|
+
* } = await import('node:crypto');
|
|
2488
2527
|
*
|
|
2489
2528
|
* const {
|
|
2490
2529
|
* publicKey,
|
|
@@ -2493,14 +2532,14 @@ declare module 'crypto' {
|
|
|
2493
2532
|
* modulusLength: 4096,
|
|
2494
2533
|
* publicKeyEncoding: {
|
|
2495
2534
|
* type: 'spki',
|
|
2496
|
-
* format: 'pem'
|
|
2535
|
+
* format: 'pem',
|
|
2497
2536
|
* },
|
|
2498
2537
|
* privateKeyEncoding: {
|
|
2499
2538
|
* type: 'pkcs8',
|
|
2500
2539
|
* format: 'pem',
|
|
2501
2540
|
* cipher: 'aes-256-cbc',
|
|
2502
|
-
* passphrase: 'top secret'
|
|
2503
|
-
* }
|
|
2541
|
+
* passphrase: 'top secret',
|
|
2542
|
+
* },
|
|
2504
2543
|
* });
|
|
2505
2544
|
* ```
|
|
2506
2545
|
*
|
|
@@ -2562,21 +2601,21 @@ declare module 'crypto' {
|
|
|
2562
2601
|
*
|
|
2563
2602
|
* ```js
|
|
2564
2603
|
* const {
|
|
2565
|
-
* generateKeyPair
|
|
2566
|
-
* } = await import('crypto');
|
|
2604
|
+
* generateKeyPair,
|
|
2605
|
+
* } = await import('node:crypto');
|
|
2567
2606
|
*
|
|
2568
2607
|
* generateKeyPair('rsa', {
|
|
2569
2608
|
* modulusLength: 4096,
|
|
2570
2609
|
* publicKeyEncoding: {
|
|
2571
2610
|
* type: 'spki',
|
|
2572
|
-
* format: 'pem'
|
|
2611
|
+
* format: 'pem',
|
|
2573
2612
|
* },
|
|
2574
2613
|
* privateKeyEncoding: {
|
|
2575
2614
|
* type: 'pkcs8',
|
|
2576
2615
|
* format: 'pem',
|
|
2577
2616
|
* cipher: 'aes-256-cbc',
|
|
2578
|
-
* passphrase: 'top secret'
|
|
2579
|
-
* }
|
|
2617
|
+
* passphrase: 'top secret',
|
|
2618
|
+
* },
|
|
2580
2619
|
* }, (err, publicKey, privateKey) => {
|
|
2581
2620
|
* // Handle errors and use the generated key pair.
|
|
2582
2621
|
* });
|
|
@@ -2898,11 +2937,16 @@ declare module 'crypto' {
|
|
|
2898
2937
|
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
2899
2938
|
* @since v12.0.0
|
|
2900
2939
|
*/
|
|
2901
|
-
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
|
|
2902
2940
|
function verify(
|
|
2903
2941
|
algorithm: string | null | undefined,
|
|
2904
2942
|
data: NodeJS.ArrayBufferView,
|
|
2905
|
-
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
|
|
2943
|
+
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
2944
|
+
signature: NodeJS.ArrayBufferView
|
|
2945
|
+
): boolean;
|
|
2946
|
+
function verify(
|
|
2947
|
+
algorithm: string | null | undefined,
|
|
2948
|
+
data: NodeJS.ArrayBufferView,
|
|
2949
|
+
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
2906
2950
|
signature: NodeJS.ArrayBufferView,
|
|
2907
2951
|
callback: (error: Error | null, result: boolean) => void
|
|
2908
2952
|
): void;
|
|
@@ -2972,10 +3016,10 @@ declare module 'crypto' {
|
|
|
2972
3016
|
* of the input arguments specify invalid values or types.
|
|
2973
3017
|
*
|
|
2974
3018
|
* ```js
|
|
2975
|
-
* import { Buffer } from 'buffer';
|
|
3019
|
+
* import { Buffer } from 'node:buffer';
|
|
2976
3020
|
* const {
|
|
2977
|
-
* hkdf
|
|
2978
|
-
* } = await import('crypto');
|
|
3021
|
+
* hkdf,
|
|
3022
|
+
* } = await import('node:crypto');
|
|
2979
3023
|
*
|
|
2980
3024
|
* hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {
|
|
2981
3025
|
* if (err) throw err;
|
|
@@ -2984,7 +3028,7 @@ declare module 'crypto' {
|
|
|
2984
3028
|
* ```
|
|
2985
3029
|
* @since v15.0.0
|
|
2986
3030
|
* @param digest The digest algorithm to use.
|
|
2987
|
-
* @param ikm The input keying material.
|
|
3031
|
+
* @param ikm The input keying material. Must be provided but can be zero-length.
|
|
2988
3032
|
* @param salt The salt value. Must be provided but can be zero-length.
|
|
2989
3033
|
* @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
|
|
2990
3034
|
* @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
|
|
@@ -3001,17 +3045,17 @@ declare module 'crypto' {
|
|
|
3001
3045
|
* types, or if the derived key cannot be generated.
|
|
3002
3046
|
*
|
|
3003
3047
|
* ```js
|
|
3004
|
-
* import { Buffer } from 'buffer';
|
|
3048
|
+
* import { Buffer } from 'node:buffer';
|
|
3005
3049
|
* const {
|
|
3006
|
-
* hkdfSync
|
|
3007
|
-
* } = await import('crypto');
|
|
3050
|
+
* hkdfSync,
|
|
3051
|
+
* } = await import('node:crypto');
|
|
3008
3052
|
*
|
|
3009
3053
|
* const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);
|
|
3010
3054
|
* console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
|
|
3011
3055
|
* ```
|
|
3012
3056
|
* @since v15.0.0
|
|
3013
3057
|
* @param digest The digest algorithm to use.
|
|
3014
|
-
* @param ikm The input keying material.
|
|
3058
|
+
* @param ikm The input keying material. Must be provided but can be zero-length.
|
|
3015
3059
|
* @param salt The salt value. Must be provided but can be zero-length.
|
|
3016
3060
|
* @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
|
|
3017
3061
|
* @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
|
|
@@ -3051,40 +3095,41 @@ declare module 'crypto' {
|
|
|
3051
3095
|
*/
|
|
3052
3096
|
disableEntropyCache?: boolean | undefined;
|
|
3053
3097
|
}
|
|
3098
|
+
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
3054
3099
|
/**
|
|
3055
3100
|
* Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
|
|
3056
3101
|
* cryptographic pseudorandom number generator.
|
|
3057
3102
|
* @since v15.6.0, v14.17.0
|
|
3058
3103
|
*/
|
|
3059
|
-
function randomUUID(options?: RandomUUIDOptions):
|
|
3104
|
+
function randomUUID(options?: RandomUUIDOptions): UUID;
|
|
3060
3105
|
interface X509CheckOptions {
|
|
3061
3106
|
/**
|
|
3062
3107
|
* @default 'always'
|
|
3063
3108
|
*/
|
|
3064
|
-
subject
|
|
3109
|
+
subject?: 'always' | 'default' | 'never';
|
|
3065
3110
|
/**
|
|
3066
3111
|
* @default true
|
|
3067
3112
|
*/
|
|
3068
|
-
wildcards
|
|
3113
|
+
wildcards?: boolean;
|
|
3069
3114
|
/**
|
|
3070
3115
|
* @default true
|
|
3071
3116
|
*/
|
|
3072
|
-
partialWildcards
|
|
3117
|
+
partialWildcards?: boolean;
|
|
3073
3118
|
/**
|
|
3074
3119
|
* @default false
|
|
3075
3120
|
*/
|
|
3076
|
-
multiLabelWildcards
|
|
3121
|
+
multiLabelWildcards?: boolean;
|
|
3077
3122
|
/**
|
|
3078
3123
|
* @default false
|
|
3079
3124
|
*/
|
|
3080
|
-
singleLabelSubdomains
|
|
3125
|
+
singleLabelSubdomains?: boolean;
|
|
3081
3126
|
}
|
|
3082
3127
|
/**
|
|
3083
3128
|
* Encapsulates an X509 certificate and provides read-only access to
|
|
3084
3129
|
* its information.
|
|
3085
3130
|
*
|
|
3086
3131
|
* ```js
|
|
3087
|
-
* const { X509Certificate } = await import('crypto');
|
|
3132
|
+
* const { X509Certificate } = await import('node:crypto');
|
|
3088
3133
|
*
|
|
3089
3134
|
* const x509 = new X509Certificate('{... pem encoded cert ...}');
|
|
3090
3135
|
*
|
|
@@ -3094,12 +3139,16 @@ declare module 'crypto' {
|
|
|
3094
3139
|
*/
|
|
3095
3140
|
class X509Certificate {
|
|
3096
3141
|
/**
|
|
3097
|
-
* Will be \`true\` if this is a Certificate Authority (
|
|
3142
|
+
* Will be \`true\` if this is a Certificate Authority (CA) certificate.
|
|
3098
3143
|
* @since v15.6.0
|
|
3099
3144
|
*/
|
|
3100
3145
|
readonly ca: boolean;
|
|
3101
3146
|
/**
|
|
3102
3147
|
* The SHA-1 fingerprint of this certificate.
|
|
3148
|
+
*
|
|
3149
|
+
* Because SHA-1 is cryptographically broken and because the security of SHA-1 is
|
|
3150
|
+
* significantly worse than that of algorithms that are commonly used to sign
|
|
3151
|
+
* certificates, consider using `x509.fingerprint256` instead.
|
|
3103
3152
|
* @since v15.6.0
|
|
3104
3153
|
*/
|
|
3105
3154
|
readonly fingerprint: string;
|
|
@@ -3110,23 +3159,53 @@ declare module 'crypto' {
|
|
|
3110
3159
|
readonly fingerprint256: string;
|
|
3111
3160
|
/**
|
|
3112
3161
|
* The SHA-512 fingerprint of this certificate.
|
|
3113
|
-
*
|
|
3162
|
+
*
|
|
3163
|
+
* Because computing the SHA-256 fingerprint is usually faster and because it is
|
|
3164
|
+
* only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be
|
|
3165
|
+
* a better choice. While SHA-512 presumably provides a higher level of security in
|
|
3166
|
+
* general, the security of SHA-256 matches that of most algorithms that are
|
|
3167
|
+
* commonly used to sign certificates.
|
|
3168
|
+
* @since v17.2.0, v16.14.0
|
|
3114
3169
|
*/
|
|
3115
|
-
|
|
3170
|
+
readonly fingerprint512: string;
|
|
3116
3171
|
/**
|
|
3117
3172
|
* The complete subject of this certificate.
|
|
3118
3173
|
* @since v15.6.0
|
|
3119
3174
|
*/
|
|
3120
3175
|
readonly subject: string;
|
|
3121
3176
|
/**
|
|
3122
|
-
* The subject alternative name specified for this certificate
|
|
3123
|
-
*
|
|
3177
|
+
* The subject alternative name specified for this certificate.
|
|
3178
|
+
*
|
|
3179
|
+
* This is a comma-separated list of subject alternative names. Each entry begins
|
|
3180
|
+
* with a string identifying the kind of the subject alternative name followed by
|
|
3181
|
+
* a colon and the value associated with the entry.
|
|
3182
|
+
*
|
|
3183
|
+
* Earlier versions of Node.js incorrectly assumed that it is safe to split this
|
|
3184
|
+
* property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However,
|
|
3185
|
+
* both malicious and legitimate certificates can contain subject alternative names
|
|
3186
|
+
* that include this sequence when represented as a string.
|
|
3187
|
+
*
|
|
3188
|
+
* After the prefix denoting the type of the entry, the remainder of each entry
|
|
3189
|
+
* might be enclosed in quotes to indicate that the value is a JSON string literal.
|
|
3190
|
+
* For backward compatibility, Node.js only uses JSON string literals within this
|
|
3191
|
+
* property when necessary to avoid ambiguity. Third-party code should be prepared
|
|
3192
|
+
* to handle both possible entry formats.
|
|
3124
3193
|
* @since v15.6.0
|
|
3125
3194
|
*/
|
|
3126
3195
|
readonly subjectAltName: string | undefined;
|
|
3127
3196
|
/**
|
|
3128
|
-
*
|
|
3129
|
-
*
|
|
3197
|
+
* A textual representation of the certificate's authority information access
|
|
3198
|
+
* extension.
|
|
3199
|
+
*
|
|
3200
|
+
* This is a line feed separated list of access descriptions. Each line begins with
|
|
3201
|
+
* the access method and the kind of the access location, followed by a colon and
|
|
3202
|
+
* the value associated with the access location.
|
|
3203
|
+
*
|
|
3204
|
+
* After the prefix denoting the access method and the kind of the access location,
|
|
3205
|
+
* the remainder of each line might be enclosed in quotes to indicate that the
|
|
3206
|
+
* value is a JSON string literal. For backward compatibility, Node.js only uses
|
|
3207
|
+
* JSON string literals within this property when necessary to avoid ambiguity.
|
|
3208
|
+
* Third-party code should be prepared to handle both possible entry formats.
|
|
3130
3209
|
* @since v15.6.0
|
|
3131
3210
|
*/
|
|
3132
3211
|
readonly infoAccess: string | undefined;
|
|
@@ -3158,6 +3237,10 @@ declare module 'crypto' {
|
|
|
3158
3237
|
readonly raw: Buffer;
|
|
3159
3238
|
/**
|
|
3160
3239
|
* The serial number of this certificate.
|
|
3240
|
+
*
|
|
3241
|
+
* Serial numbers are assigned by certificate authorities and do not uniquely
|
|
3242
|
+
* identify certificates. Consider using `x509.fingerprint256` as a unique
|
|
3243
|
+
* identifier instead.
|
|
3161
3244
|
* @since v15.6.0
|
|
3162
3245
|
*/
|
|
3163
3246
|
readonly serialNumber: string;
|
|
@@ -3174,18 +3257,50 @@ declare module 'crypto' {
|
|
|
3174
3257
|
constructor(buffer: BinaryLike);
|
|
3175
3258
|
/**
|
|
3176
3259
|
* Checks whether the certificate matches the given email address.
|
|
3260
|
+
*
|
|
3261
|
+
* If the `'subject'` option is undefined or set to `'default'`, the certificate
|
|
3262
|
+
* subject is only considered if the subject alternative name extension either does
|
|
3263
|
+
* not exist or does not contain any email addresses.
|
|
3264
|
+
*
|
|
3265
|
+
* If the `'subject'` option is set to `'always'` and if the subject alternative
|
|
3266
|
+
* name extension either does not exist or does not contain a matching email
|
|
3267
|
+
* address, the certificate subject is considered.
|
|
3268
|
+
*
|
|
3269
|
+
* If the `'subject'` option is set to `'never'`, the certificate subject is never
|
|
3270
|
+
* considered, even if the certificate contains no subject alternative names.
|
|
3177
3271
|
* @since v15.6.0
|
|
3178
3272
|
* @return Returns `email` if the certificate matches, `undefined` if it does not.
|
|
3179
3273
|
*/
|
|
3180
3274
|
checkEmail(email: string, options?: Pick<X509CheckOptions, 'subject'>): string | undefined;
|
|
3181
3275
|
/**
|
|
3182
3276
|
* Checks whether the certificate matches the given host name.
|
|
3277
|
+
*
|
|
3278
|
+
* If the certificate matches the given host name, the matching subject name is
|
|
3279
|
+
* returned. The returned name might be an exact match (e.g., `foo.example.com`)
|
|
3280
|
+
* or it might contain wildcards (e.g., `*.example.com`). Because host name
|
|
3281
|
+
* comparisons are case-insensitive, the returned subject name might also differ
|
|
3282
|
+
* from the given `name` in capitalization.
|
|
3283
|
+
*
|
|
3284
|
+
* If the `'subject'` option is undefined or set to `'default'`, the certificate
|
|
3285
|
+
* subject is only considered if the subject alternative name extension either does
|
|
3286
|
+
* 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").
|
|
3287
|
+
*
|
|
3288
|
+
* If the `'subject'` option is set to `'always'` and if the subject alternative
|
|
3289
|
+
* name extension either does not exist or does not contain a matching DNS name,
|
|
3290
|
+
* the certificate subject is considered.
|
|
3291
|
+
*
|
|
3292
|
+
* If the `'subject'` option is set to `'never'`, the certificate subject is never
|
|
3293
|
+
* considered, even if the certificate contains no subject alternative names.
|
|
3183
3294
|
* @since v15.6.0
|
|
3184
|
-
* @return Returns
|
|
3295
|
+
* @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.
|
|
3185
3296
|
*/
|
|
3186
3297
|
checkHost(name: string, options?: X509CheckOptions): string | undefined;
|
|
3187
3298
|
/**
|
|
3188
3299
|
* Checks whether the certificate matches the given IP address (IPv4 or IPv6).
|
|
3300
|
+
*
|
|
3301
|
+
* Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they
|
|
3302
|
+
* must match the given `ip` address exactly. Other subject alternative names as
|
|
3303
|
+
* well as the subject field of the certificate are ignored.
|
|
3189
3304
|
* @since v15.6.0
|
|
3190
3305
|
* @return Returns `ip` if the certificate matches, `undefined` if it does not.
|
|
3191
3306
|
*/
|
|
@@ -3307,7 +3422,7 @@ declare module 'crypto' {
|
|
|
3307
3422
|
interface CheckPrimeOptions {
|
|
3308
3423
|
/**
|
|
3309
3424
|
* The number of Miller-Rabin probabilistic primality iterations to perform.
|
|
3310
|
-
* When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most 2
|
|
3425
|
+
* When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input.
|
|
3311
3426
|
* Care must be used when selecting a number of checks.
|
|
3312
3427
|
* Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details.
|
|
3313
3428
|
*
|
|
@@ -3329,8 +3444,517 @@ declare module 'crypto' {
|
|
|
3329
3444
|
* @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.
|
|
3330
3445
|
*/
|
|
3331
3446
|
function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean;
|
|
3447
|
+
/**
|
|
3448
|
+
* Load and set the `engine` for some or all OpenSSL functions (selected by flags).
|
|
3449
|
+
*
|
|
3450
|
+
* `engine` could be either an id or a path to the engine's shared library.
|
|
3451
|
+
*
|
|
3452
|
+
* The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`):
|
|
3453
|
+
*
|
|
3454
|
+
* * `crypto.constants.ENGINE_METHOD_RSA`
|
|
3455
|
+
* * `crypto.constants.ENGINE_METHOD_DSA`
|
|
3456
|
+
* * `crypto.constants.ENGINE_METHOD_DH`
|
|
3457
|
+
* * `crypto.constants.ENGINE_METHOD_RAND`
|
|
3458
|
+
* * `crypto.constants.ENGINE_METHOD_EC`
|
|
3459
|
+
* * `crypto.constants.ENGINE_METHOD_CIPHERS`
|
|
3460
|
+
* * `crypto.constants.ENGINE_METHOD_DIGESTS`
|
|
3461
|
+
* * `crypto.constants.ENGINE_METHOD_PKEY_METHS`
|
|
3462
|
+
* * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS`
|
|
3463
|
+
* * `crypto.constants.ENGINE_METHOD_ALL`
|
|
3464
|
+
* * `crypto.constants.ENGINE_METHOD_NONE`
|
|
3465
|
+
* @since v0.11.11
|
|
3466
|
+
* @param flags
|
|
3467
|
+
*/
|
|
3468
|
+
function setEngine(engine: string, flags?: number): void;
|
|
3469
|
+
/**
|
|
3470
|
+
* A convenient alias for {@link webcrypto.getRandomValues}. This
|
|
3471
|
+
* implementation is not compliant with the Web Crypto spec, to write
|
|
3472
|
+
* web-compatible code use {@link webcrypto.getRandomValues} instead.
|
|
3473
|
+
* @since v17.4.0
|
|
3474
|
+
* @return Returns `typedArray`.
|
|
3475
|
+
*/
|
|
3476
|
+
function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
|
|
3477
|
+
/**
|
|
3478
|
+
* A convenient alias for `crypto.webcrypto.subtle`.
|
|
3479
|
+
* @since v17.4.0
|
|
3480
|
+
*/
|
|
3481
|
+
const subtle: webcrypto.SubtleCrypto;
|
|
3482
|
+
/**
|
|
3483
|
+
* An implementation of the Web Crypto API standard.
|
|
3484
|
+
*
|
|
3485
|
+
* See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details.
|
|
3486
|
+
* @since v15.0.0
|
|
3487
|
+
*/
|
|
3488
|
+
const webcrypto: webcrypto.Crypto;
|
|
3332
3489
|
namespace webcrypto {
|
|
3333
|
-
|
|
3490
|
+
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
3491
|
+
type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki';
|
|
3492
|
+
type KeyType = 'private' | 'public' | 'secret';
|
|
3493
|
+
type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey';
|
|
3494
|
+
type AlgorithmIdentifier = Algorithm | string;
|
|
3495
|
+
type HashAlgorithmIdentifier = AlgorithmIdentifier;
|
|
3496
|
+
type NamedCurve = string;
|
|
3497
|
+
type BigInteger = Uint8Array;
|
|
3498
|
+
interface AesCbcParams extends Algorithm {
|
|
3499
|
+
iv: BufferSource;
|
|
3500
|
+
}
|
|
3501
|
+
interface AesCtrParams extends Algorithm {
|
|
3502
|
+
counter: BufferSource;
|
|
3503
|
+
length: number;
|
|
3504
|
+
}
|
|
3505
|
+
interface AesDerivedKeyParams extends Algorithm {
|
|
3506
|
+
length: number;
|
|
3507
|
+
}
|
|
3508
|
+
interface AesGcmParams extends Algorithm {
|
|
3509
|
+
additionalData?: BufferSource;
|
|
3510
|
+
iv: BufferSource;
|
|
3511
|
+
tagLength?: number;
|
|
3512
|
+
}
|
|
3513
|
+
interface AesKeyAlgorithm extends KeyAlgorithm {
|
|
3514
|
+
length: number;
|
|
3515
|
+
}
|
|
3516
|
+
interface AesKeyGenParams extends Algorithm {
|
|
3517
|
+
length: number;
|
|
3518
|
+
}
|
|
3519
|
+
interface Algorithm {
|
|
3520
|
+
name: string;
|
|
3521
|
+
}
|
|
3522
|
+
interface EcKeyAlgorithm extends KeyAlgorithm {
|
|
3523
|
+
namedCurve: NamedCurve;
|
|
3524
|
+
}
|
|
3525
|
+
interface EcKeyGenParams extends Algorithm {
|
|
3526
|
+
namedCurve: NamedCurve;
|
|
3527
|
+
}
|
|
3528
|
+
interface EcKeyImportParams extends Algorithm {
|
|
3529
|
+
namedCurve: NamedCurve;
|
|
3530
|
+
}
|
|
3531
|
+
interface EcdhKeyDeriveParams extends Algorithm {
|
|
3532
|
+
public: CryptoKey;
|
|
3533
|
+
}
|
|
3534
|
+
interface EcdsaParams extends Algorithm {
|
|
3535
|
+
hash: HashAlgorithmIdentifier;
|
|
3536
|
+
}
|
|
3537
|
+
interface Ed448Params extends Algorithm {
|
|
3538
|
+
context?: BufferSource;
|
|
3539
|
+
}
|
|
3540
|
+
interface HkdfParams extends Algorithm {
|
|
3541
|
+
hash: HashAlgorithmIdentifier;
|
|
3542
|
+
info: BufferSource;
|
|
3543
|
+
salt: BufferSource;
|
|
3544
|
+
}
|
|
3545
|
+
interface HmacImportParams extends Algorithm {
|
|
3546
|
+
hash: HashAlgorithmIdentifier;
|
|
3547
|
+
length?: number;
|
|
3548
|
+
}
|
|
3549
|
+
interface HmacKeyAlgorithm extends KeyAlgorithm {
|
|
3550
|
+
hash: KeyAlgorithm;
|
|
3551
|
+
length: number;
|
|
3552
|
+
}
|
|
3553
|
+
interface HmacKeyGenParams extends Algorithm {
|
|
3554
|
+
hash: HashAlgorithmIdentifier;
|
|
3555
|
+
length?: number;
|
|
3556
|
+
}
|
|
3557
|
+
interface JsonWebKey {
|
|
3558
|
+
alg?: string;
|
|
3559
|
+
crv?: string;
|
|
3560
|
+
d?: string;
|
|
3561
|
+
dp?: string;
|
|
3562
|
+
dq?: string;
|
|
3563
|
+
e?: string;
|
|
3564
|
+
ext?: boolean;
|
|
3565
|
+
k?: string;
|
|
3566
|
+
key_ops?: string[];
|
|
3567
|
+
kty?: string;
|
|
3568
|
+
n?: string;
|
|
3569
|
+
oth?: RsaOtherPrimesInfo[];
|
|
3570
|
+
p?: string;
|
|
3571
|
+
q?: string;
|
|
3572
|
+
qi?: string;
|
|
3573
|
+
use?: string;
|
|
3574
|
+
x?: string;
|
|
3575
|
+
y?: string;
|
|
3576
|
+
}
|
|
3577
|
+
interface KeyAlgorithm {
|
|
3578
|
+
name: string;
|
|
3579
|
+
}
|
|
3580
|
+
interface Pbkdf2Params extends Algorithm {
|
|
3581
|
+
hash: HashAlgorithmIdentifier;
|
|
3582
|
+
iterations: number;
|
|
3583
|
+
salt: BufferSource;
|
|
3584
|
+
}
|
|
3585
|
+
interface RsaHashedImportParams extends Algorithm {
|
|
3586
|
+
hash: HashAlgorithmIdentifier;
|
|
3587
|
+
}
|
|
3588
|
+
interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
|
|
3589
|
+
hash: KeyAlgorithm;
|
|
3590
|
+
}
|
|
3591
|
+
interface RsaHashedKeyGenParams extends RsaKeyGenParams {
|
|
3592
|
+
hash: HashAlgorithmIdentifier;
|
|
3593
|
+
}
|
|
3594
|
+
interface RsaKeyAlgorithm extends KeyAlgorithm {
|
|
3595
|
+
modulusLength: number;
|
|
3596
|
+
publicExponent: BigInteger;
|
|
3597
|
+
}
|
|
3598
|
+
interface RsaKeyGenParams extends Algorithm {
|
|
3599
|
+
modulusLength: number;
|
|
3600
|
+
publicExponent: BigInteger;
|
|
3601
|
+
}
|
|
3602
|
+
interface RsaOaepParams extends Algorithm {
|
|
3603
|
+
label?: BufferSource;
|
|
3604
|
+
}
|
|
3605
|
+
interface RsaOtherPrimesInfo {
|
|
3606
|
+
d?: string;
|
|
3607
|
+
r?: string;
|
|
3608
|
+
t?: string;
|
|
3609
|
+
}
|
|
3610
|
+
interface RsaPssParams extends Algorithm {
|
|
3611
|
+
saltLength: number;
|
|
3612
|
+
}
|
|
3613
|
+
/**
|
|
3614
|
+
* Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class.
|
|
3615
|
+
* `Crypto` is a singleton that provides access to the remainder of the crypto API.
|
|
3616
|
+
* @since v15.0.0
|
|
3617
|
+
*/
|
|
3618
|
+
interface Crypto {
|
|
3619
|
+
/**
|
|
3620
|
+
* Provides access to the `SubtleCrypto` API.
|
|
3621
|
+
* @since v15.0.0
|
|
3622
|
+
*/
|
|
3623
|
+
readonly subtle: SubtleCrypto;
|
|
3624
|
+
/**
|
|
3625
|
+
* Generates cryptographically strong random values.
|
|
3626
|
+
* The given `typedArray` is filled with random values, and a reference to `typedArray` is returned.
|
|
3627
|
+
*
|
|
3628
|
+
* The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted.
|
|
3629
|
+
*
|
|
3630
|
+
* An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
|
|
3631
|
+
* @since v15.0.0
|
|
3632
|
+
*/
|
|
3633
|
+
getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(typedArray: T): T;
|
|
3634
|
+
/**
|
|
3635
|
+
* Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
|
|
3636
|
+
* The UUID is generated using a cryptographic pseudorandom number generator.
|
|
3637
|
+
* @since v16.7.0
|
|
3638
|
+
*/
|
|
3639
|
+
randomUUID(): UUID;
|
|
3640
|
+
CryptoKey: CryptoKeyConstructor;
|
|
3641
|
+
}
|
|
3642
|
+
// This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
|
|
3643
|
+
interface CryptoKeyConstructor {
|
|
3644
|
+
/** Illegal constructor */
|
|
3645
|
+
(_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
|
|
3646
|
+
readonly length: 0;
|
|
3647
|
+
readonly name: 'CryptoKey';
|
|
3648
|
+
readonly prototype: CryptoKey;
|
|
3649
|
+
}
|
|
3650
|
+
/**
|
|
3651
|
+
* @since v15.0.0
|
|
3652
|
+
*/
|
|
3653
|
+
interface CryptoKey {
|
|
3654
|
+
/**
|
|
3655
|
+
* An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters.
|
|
3656
|
+
* @since v15.0.0
|
|
3657
|
+
*/
|
|
3658
|
+
readonly algorithm: KeyAlgorithm;
|
|
3659
|
+
/**
|
|
3660
|
+
* When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`.
|
|
3661
|
+
* @since v15.0.0
|
|
3662
|
+
*/
|
|
3663
|
+
readonly extractable: boolean;
|
|
3664
|
+
/**
|
|
3665
|
+
* A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key.
|
|
3666
|
+
* @since v15.0.0
|
|
3667
|
+
*/
|
|
3668
|
+
readonly type: KeyType;
|
|
3669
|
+
/**
|
|
3670
|
+
* An array of strings identifying the operations for which the key may be used.
|
|
3671
|
+
*
|
|
3672
|
+
* The possible usages are:
|
|
3673
|
+
* - `'encrypt'` - The key may be used to encrypt data.
|
|
3674
|
+
* - `'decrypt'` - The key may be used to decrypt data.
|
|
3675
|
+
* - `'sign'` - The key may be used to generate digital signatures.
|
|
3676
|
+
* - `'verify'` - The key may be used to verify digital signatures.
|
|
3677
|
+
* - `'deriveKey'` - The key may be used to derive a new key.
|
|
3678
|
+
* - `'deriveBits'` - The key may be used to derive bits.
|
|
3679
|
+
* - `'wrapKey'` - The key may be used to wrap another key.
|
|
3680
|
+
* - `'unwrapKey'` - The key may be used to unwrap another key.
|
|
3681
|
+
*
|
|
3682
|
+
* Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`).
|
|
3683
|
+
* @since v15.0.0
|
|
3684
|
+
*/
|
|
3685
|
+
readonly usages: KeyUsage[];
|
|
3686
|
+
}
|
|
3687
|
+
/**
|
|
3688
|
+
* The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair.
|
|
3689
|
+
* @since v15.0.0
|
|
3690
|
+
*/
|
|
3691
|
+
interface CryptoKeyPair {
|
|
3692
|
+
/**
|
|
3693
|
+
* A {@link CryptoKey} whose type will be `'private'`.
|
|
3694
|
+
* @since v15.0.0
|
|
3695
|
+
*/
|
|
3696
|
+
privateKey: CryptoKey;
|
|
3697
|
+
/**
|
|
3698
|
+
* A {@link CryptoKey} whose type will be `'public'`.
|
|
3699
|
+
* @since v15.0.0
|
|
3700
|
+
*/
|
|
3701
|
+
publicKey: CryptoKey;
|
|
3702
|
+
}
|
|
3703
|
+
/**
|
|
3704
|
+
* @since v15.0.0
|
|
3705
|
+
*/
|
|
3706
|
+
interface SubtleCrypto {
|
|
3707
|
+
/**
|
|
3708
|
+
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
3709
|
+
* `subtle.decrypt()` attempts to decipher the provided `data`. If successful,
|
|
3710
|
+
* the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
|
|
3711
|
+
*
|
|
3712
|
+
* The algorithms currently supported include:
|
|
3713
|
+
*
|
|
3714
|
+
* - `'RSA-OAEP'`
|
|
3715
|
+
* - `'AES-CTR'`
|
|
3716
|
+
* - `'AES-CBC'`
|
|
3717
|
+
* - `'AES-GCM'`
|
|
3718
|
+
* @since v15.0.0
|
|
3719
|
+
*/
|
|
3720
|
+
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
3721
|
+
/**
|
|
3722
|
+
* Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
|
|
3723
|
+
* `subtle.deriveBits()` attempts to generate `length` bits.
|
|
3724
|
+
* The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
|
|
3725
|
+
* When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
|
|
3726
|
+
* for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
|
|
3727
|
+
* If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the generated data.
|
|
3728
|
+
*
|
|
3729
|
+
* The algorithms currently supported include:
|
|
3730
|
+
*
|
|
3731
|
+
* - `'ECDH'`
|
|
3732
|
+
* - `'X25519'`
|
|
3733
|
+
* - `'X448'`
|
|
3734
|
+
* - `'HKDF'`
|
|
3735
|
+
* - `'PBKDF2'`
|
|
3736
|
+
* @since v15.0.0
|
|
3737
|
+
*/
|
|
3738
|
+
deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise<ArrayBuffer>;
|
|
3739
|
+
deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
|
|
3740
|
+
/**
|
|
3741
|
+
* Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
|
|
3742
|
+
* `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
|
|
3743
|
+
*
|
|
3744
|
+
* Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
|
|
3745
|
+
* then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
|
|
3746
|
+
*
|
|
3747
|
+
* The algorithms currently supported include:
|
|
3748
|
+
*
|
|
3749
|
+
* - `'ECDH'`
|
|
3750
|
+
* - `'X25519'`
|
|
3751
|
+
* - `'X448'`
|
|
3752
|
+
* - `'HKDF'`
|
|
3753
|
+
* - `'PBKDF2'`
|
|
3754
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3755
|
+
* @since v15.0.0
|
|
3756
|
+
*/
|
|
3757
|
+
deriveKey(
|
|
3758
|
+
algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
3759
|
+
baseKey: CryptoKey,
|
|
3760
|
+
derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params,
|
|
3761
|
+
extractable: boolean,
|
|
3762
|
+
keyUsages: ReadonlyArray<KeyUsage>
|
|
3763
|
+
): Promise<CryptoKey>;
|
|
3764
|
+
/**
|
|
3765
|
+
* Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
|
|
3766
|
+
* If successful, the returned promise is resolved with an `<ArrayBuffer>` containing the computed digest.
|
|
3767
|
+
*
|
|
3768
|
+
* If `algorithm` is provided as a `<string>`, it must be one of:
|
|
3769
|
+
*
|
|
3770
|
+
* - `'SHA-1'`
|
|
3771
|
+
* - `'SHA-256'`
|
|
3772
|
+
* - `'SHA-384'`
|
|
3773
|
+
* - `'SHA-512'`
|
|
3774
|
+
*
|
|
3775
|
+
* If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
|
|
3776
|
+
* @since v15.0.0
|
|
3777
|
+
*/
|
|
3778
|
+
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
|
3779
|
+
/**
|
|
3780
|
+
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|
|
3781
|
+
* `subtle.encrypt()` attempts to encipher `data`. If successful,
|
|
3782
|
+
* the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
|
|
3783
|
+
*
|
|
3784
|
+
* The algorithms currently supported include:
|
|
3785
|
+
*
|
|
3786
|
+
* - `'RSA-OAEP'`
|
|
3787
|
+
* - `'AES-CTR'`
|
|
3788
|
+
* - `'AES-CBC'`
|
|
3789
|
+
* - `'AES-GCM'`
|
|
3790
|
+
* @since v15.0.0
|
|
3791
|
+
*/
|
|
3792
|
+
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
3793
|
+
/**
|
|
3794
|
+
* Exports the given key into the specified format, if supported.
|
|
3795
|
+
*
|
|
3796
|
+
* If the `<CryptoKey>` is not extractable, the returned promise will reject.
|
|
3797
|
+
*
|
|
3798
|
+
* When `format` is either `'pkcs8'` or `'spki'` and the export is successful,
|
|
3799
|
+
* the returned promise will be resolved with an `<ArrayBuffer>` containing the exported key data.
|
|
3800
|
+
*
|
|
3801
|
+
* When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
|
|
3802
|
+
* JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
|
|
3803
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3804
|
+
* @returns `<Promise>` containing `<ArrayBuffer>`.
|
|
3805
|
+
* @since v15.0.0
|
|
3806
|
+
*/
|
|
3807
|
+
exportKey(format: 'jwk', key: CryptoKey): Promise<JsonWebKey>;
|
|
3808
|
+
exportKey(format: Exclude<KeyFormat, 'jwk'>, key: CryptoKey): Promise<ArrayBuffer>;
|
|
3809
|
+
/**
|
|
3810
|
+
* Using the method and parameters provided in `algorithm`,
|
|
3811
|
+
* `subtle.generateKey()` attempts to generate new keying material.
|
|
3812
|
+
* Depending the method used, the method may generate either a single `<CryptoKey>` or a `<CryptoKeyPair>`.
|
|
3813
|
+
*
|
|
3814
|
+
* The `<CryptoKeyPair>` (public and private key) generating algorithms supported include:
|
|
3815
|
+
*
|
|
3816
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3817
|
+
* - `'RSA-PSS'`
|
|
3818
|
+
* - `'RSA-OAEP'`
|
|
3819
|
+
* - `'ECDSA'`
|
|
3820
|
+
* - `'Ed25519'`
|
|
3821
|
+
* - `'Ed448'`
|
|
3822
|
+
* - `'ECDH'`
|
|
3823
|
+
* - `'X25519'`
|
|
3824
|
+
* - `'X448'`
|
|
3825
|
+
* The `<CryptoKey>` (secret key) generating algorithms supported include:
|
|
3826
|
+
*
|
|
3827
|
+
* - `'HMAC'`
|
|
3828
|
+
* - `'AES-CTR'`
|
|
3829
|
+
* - `'AES-CBC'`
|
|
3830
|
+
* - `'AES-GCM'`
|
|
3831
|
+
* - `'AES-KW'`
|
|
3832
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3833
|
+
* @since v15.0.0
|
|
3834
|
+
*/
|
|
3835
|
+
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
|
3836
|
+
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
3837
|
+
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
|
3838
|
+
/**
|
|
3839
|
+
* The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
|
|
3840
|
+
* to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
|
|
3841
|
+
* If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
|
|
3842
|
+
*
|
|
3843
|
+
* If importing a `'PBKDF2'` key, `extractable` must be `false`.
|
|
3844
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3845
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3846
|
+
* @since v15.0.0
|
|
3847
|
+
*/
|
|
3848
|
+
importKey(
|
|
3849
|
+
format: 'jwk',
|
|
3850
|
+
keyData: JsonWebKey,
|
|
3851
|
+
algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
|
|
3852
|
+
extractable: boolean,
|
|
3853
|
+
keyUsages: ReadonlyArray<KeyUsage>
|
|
3854
|
+
): Promise<CryptoKey>;
|
|
3855
|
+
importKey(
|
|
3856
|
+
format: Exclude<KeyFormat, 'jwk'>,
|
|
3857
|
+
keyData: BufferSource,
|
|
3858
|
+
algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
|
|
3859
|
+
extractable: boolean,
|
|
3860
|
+
keyUsages: KeyUsage[]
|
|
3861
|
+
): Promise<CryptoKey>;
|
|
3862
|
+
/**
|
|
3863
|
+
* Using the method and parameters given by `algorithm` and the keying material provided by `key`,
|
|
3864
|
+
* `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful,
|
|
3865
|
+
* the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
|
|
3866
|
+
*
|
|
3867
|
+
* The algorithms currently supported include:
|
|
3868
|
+
*
|
|
3869
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3870
|
+
* - `'RSA-PSS'`
|
|
3871
|
+
* - `'ECDSA'`
|
|
3872
|
+
* - `'Ed25519'`
|
|
3873
|
+
* - `'Ed448'`
|
|
3874
|
+
* - `'HMAC'`
|
|
3875
|
+
* @since v15.0.0
|
|
3876
|
+
*/
|
|
3877
|
+
sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
3878
|
+
/**
|
|
3879
|
+
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
3880
|
+
* The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
|
|
3881
|
+
* It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
|
|
3882
|
+
* then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
|
|
3883
|
+
* If successful, the returned promise is resolved with a `<CryptoKey>` object.
|
|
3884
|
+
*
|
|
3885
|
+
* The wrapping algorithms currently supported include:
|
|
3886
|
+
*
|
|
3887
|
+
* - `'RSA-OAEP'`
|
|
3888
|
+
* - `'AES-CTR'`
|
|
3889
|
+
* - `'AES-CBC'`
|
|
3890
|
+
* - `'AES-GCM'`
|
|
3891
|
+
* - `'AES-KW'`
|
|
3892
|
+
*
|
|
3893
|
+
* The unwrapped key algorithms supported include:
|
|
3894
|
+
*
|
|
3895
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3896
|
+
* - `'RSA-PSS'`
|
|
3897
|
+
* - `'RSA-OAEP'`
|
|
3898
|
+
* - `'ECDSA'`
|
|
3899
|
+
* - `'Ed25519'`
|
|
3900
|
+
* - `'Ed448'`
|
|
3901
|
+
* - `'ECDH'`
|
|
3902
|
+
* - `'X25519'`
|
|
3903
|
+
* - `'X448'`
|
|
3904
|
+
* - `'HMAC'`
|
|
3905
|
+
* - `'AES-CTR'`
|
|
3906
|
+
* - `'AES-CBC'`
|
|
3907
|
+
* - `'AES-GCM'`
|
|
3908
|
+
* - `'AES-KW'`
|
|
3909
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3910
|
+
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
3911
|
+
* @since v15.0.0
|
|
3912
|
+
*/
|
|
3913
|
+
unwrapKey(
|
|
3914
|
+
format: KeyFormat,
|
|
3915
|
+
wrappedKey: BufferSource,
|
|
3916
|
+
unwrappingKey: CryptoKey,
|
|
3917
|
+
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
|
|
3918
|
+
unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
|
|
3919
|
+
extractable: boolean,
|
|
3920
|
+
keyUsages: KeyUsage[]
|
|
3921
|
+
): Promise<CryptoKey>;
|
|
3922
|
+
/**
|
|
3923
|
+
* Using the method and parameters given in `algorithm` and the keying material provided by `key`,
|
|
3924
|
+
* `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`.
|
|
3925
|
+
* The returned promise is resolved with either `true` or `false`.
|
|
3926
|
+
*
|
|
3927
|
+
* The algorithms currently supported include:
|
|
3928
|
+
*
|
|
3929
|
+
* - `'RSASSA-PKCS1-v1_5'`
|
|
3930
|
+
* - `'RSA-PSS'`
|
|
3931
|
+
* - `'ECDSA'`
|
|
3932
|
+
* - `'Ed25519'`
|
|
3933
|
+
* - `'Ed448'`
|
|
3934
|
+
* - `'HMAC'`
|
|
3935
|
+
* @since v15.0.0
|
|
3936
|
+
*/
|
|
3937
|
+
verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<boolean>;
|
|
3938
|
+
/**
|
|
3939
|
+
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
3940
|
+
* The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
|
|
3941
|
+
* then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
|
|
3942
|
+
* It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
|
|
3943
|
+
* then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
|
|
3944
|
+
* If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the encrypted key data.
|
|
3945
|
+
*
|
|
3946
|
+
* The wrapping algorithms currently supported include:
|
|
3947
|
+
*
|
|
3948
|
+
* - `'RSA-OAEP'`
|
|
3949
|
+
* - `'AES-CTR'`
|
|
3950
|
+
* - `'AES-CBC'`
|
|
3951
|
+
* - `'AES-GCM'`
|
|
3952
|
+
* - `'AES-KW'`
|
|
3953
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
|
|
3954
|
+
* @since v15.0.0
|
|
3955
|
+
*/
|
|
3956
|
+
wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise<ArrayBuffer>;
|
|
3957
|
+
}
|
|
3334
3958
|
}
|
|
3335
3959
|
}
|
|
3336
3960
|
declare module 'node:crypto' {
|