@contrast/agent-bundle 5.46.0 → 5.47.0
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/README.md +1 -1
- package/node_modules/@contrast/agent/README.md +1 -1
- package/node_modules/@contrast/agent/package.json +12 -12
- package/node_modules/@contrast/agentify/package.json +15 -15
- package/node_modules/@contrast/architecture-components/package.json +5 -5
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/common.js +1 -1
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/handlers.js +23 -10
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/index.js +6 -4
- package/node_modules/@contrast/assess/lib/configuration-analysis/install/apollo-server.js +92 -0
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/express-session.js +2 -2
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/fastify-cookie.js +2 -2
- package/node_modules/@contrast/assess/lib/configuration-analysis/install/graphql-yoga.js +90 -0
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/hapi.js +2 -2
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/koa.js +3 -3
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/string/substring.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/handler.js +9 -2
- package/node_modules/@contrast/assess/lib/dataflow/sources/index.js +2 -0
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/fastify-websocket.js +63 -0
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/http.js +42 -38
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/index.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +76 -48
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-multer.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-routers.js +2 -2
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/{koa2.js → koa.js} +3 -3
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/socket.io.js +80 -0
- package/node_modules/@contrast/assess/lib/index.d.ts +4 -3
- package/node_modules/@contrast/assess/lib/index.js +1 -1
- package/node_modules/@contrast/assess/lib/policy.js +2 -2
- package/node_modules/@contrast/assess/package.json +12 -12
- package/node_modules/@contrast/common/lib/constants.d.ts +12 -4
- package/node_modules/@contrast/common/lib/constants.js +16 -7
- package/node_modules/@contrast/common/lib/types.d.ts +5 -1
- package/node_modules/@contrast/common/package.json +1 -1
- package/node_modules/@contrast/config/lib/common.js +1 -0
- package/node_modules/@contrast/config/lib/options.js +7 -1
- package/node_modules/@contrast/config/package.json +3 -3
- package/node_modules/@contrast/core/package.json +5 -5
- package/node_modules/@contrast/deadzones/package.json +5 -5
- package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +2 -2
- package/node_modules/@contrast/dep-hooks/lib/package-finder.js +3 -2
- package/node_modules/@contrast/dep-hooks/package.json +4 -4
- package/node_modules/@contrast/esm-hooks/README.md +2 -2
- package/node_modules/@contrast/esm-hooks/package.json +6 -6
- package/node_modules/@contrast/instrumentation/package.json +5 -5
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +149 -149
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/index.js +2 -11
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/utils.js +2 -0
- package/node_modules/@contrast/library-analysis/lib/install/library-usage/index.js +3 -1
- package/node_modules/@contrast/library-analysis/lib/util.js +0 -2
- package/node_modules/@contrast/library-analysis/package.json +4 -4
- package/node_modules/@contrast/logger/package.json +3 -3
- package/node_modules/@contrast/metrics/package.json +6 -6
- package/node_modules/@contrast/patcher/package.json +2 -2
- package/node_modules/@contrast/protect/lib/error-handlers/index.js +1 -1
- package/node_modules/@contrast/protect/lib/error-handlers/install/{koa2.js → koa.js} +4 -4
- package/node_modules/@contrast/protect/lib/index.d.ts +1 -1
- package/node_modules/@contrast/protect/lib/input-analysis/index.js +2 -3
- package/node_modules/@contrast/protect/lib/input-analysis/install/koa-bodyparsers.js +92 -0
- package/node_modules/@contrast/protect/lib/input-analysis/install/{koa2.js → koa.js} +5 -5
- package/node_modules/@contrast/protect/package.json +11 -11
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +6 -10
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/routes-observed.js +4 -0
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.d.ts +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +22 -9
- package/node_modules/@contrast/reporter/lib/reporters/file.js +1 -1
- package/node_modules/@contrast/reporter/package.json +6 -6
- package/node_modules/@contrast/rewriter/package.json +5 -5
- package/node_modules/@contrast/route-coverage/lib/index.d.ts +0 -2
- package/node_modules/@contrast/route-coverage/lib/index.js +10 -1
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +16 -1
- package/node_modules/@contrast/route-coverage/lib/install/fastify.js +25 -15
- package/node_modules/@contrast/route-coverage/lib/install/graphql.js +6 -1
- package/node_modules/@contrast/route-coverage/lib/install/koa.js +1 -1
- package/node_modules/@contrast/route-coverage/lib/install/socket.io.js +127 -0
- package/node_modules/@contrast/route-coverage/package.json +8 -8
- package/node_modules/@contrast/scopes/package.json +5 -5
- package/node_modules/@contrast/sec-obs/package.json +9 -9
- package/node_modules/@contrast/sources/lib/index.js +65 -22
- package/node_modules/@contrast/sources/lib/index.test.js +78 -33
- package/node_modules/@contrast/sources/lib/source-info.js +1 -10
- package/node_modules/@contrast/sources/package.json +3 -3
- package/node_modules/@contrast/telemetry/package.json +5 -5
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert.d.ts +37 -2
- package/node_modules/@types/node/buffer.buffer.d.ts +9 -0
- package/node_modules/@types/node/buffer.d.ts +8 -4
- package/node_modules/@types/node/child_process.d.ts +65 -42
- package/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@types/node/crypto.d.ts +1079 -338
- package/node_modules/@types/node/dgram.d.ts +9 -8
- package/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/node/events.d.ts +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +39 -21
- package/node_modules/@types/node/fs.d.ts +104 -87
- package/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +19 -0
- package/node_modules/@types/node/http.d.ts +66 -27
- package/node_modules/@types/node/http2.d.ts +178 -52
- package/node_modules/@types/node/https.d.ts +91 -62
- package/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@types/node/inspector.d.ts +24 -0
- package/node_modules/@types/node/inspector.generated.d.ts +181 -0
- package/node_modules/@types/node/net.d.ts +12 -11
- package/node_modules/@types/node/os.d.ts +14 -3
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@types/node/process.d.ts +12 -23
- package/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@types/node/sqlite.d.ts +119 -10
- package/node_modules/@types/node/stream/consumers.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/node_modules/@types/node/test.d.ts +29 -3
- package/node_modules/@types/node/tls.d.ts +90 -66
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +16 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@types/node/url.d.ts +2 -2
- package/node_modules/@types/node/util.d.ts +12 -3
- package/node_modules/@types/node/v8.d.ts +38 -5
- package/node_modules/@types/node/vm.d.ts +169 -88
- package/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/node/worker_threads.d.ts +76 -1
- package/node_modules/@types/node/zlib.d.ts +25 -24
- package/node_modules/axios/CHANGELOG.md +403 -357
- package/node_modules/axios/README.md +80 -49
- package/node_modules/axios/dist/axios.js +121 -46
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +126 -57
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +126 -57
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +346 -97
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +4 -0
- package/node_modules/axios/index.d.ts +4 -0
- package/node_modules/axios/lib/adapters/adapters.js +85 -40
- package/node_modules/axios/lib/adapters/fetch.js +1 -1
- package/node_modules/axios/lib/adapters/http.js +220 -42
- package/node_modules/axios/lib/core/InterceptorManager.js +1 -1
- package/node_modules/axios/lib/core/mergeConfig.js +4 -4
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +6 -0
- package/node_modules/axios/lib/helpers/bind.js +7 -0
- package/node_modules/axios/lib/helpers/cookies.js +24 -13
- package/node_modules/axios/package.json +9 -4
- package/node_modules/detect-libc/lib/filesystem.js +1 -1
- package/node_modules/detect-libc/package.json +3 -1
- package/node_modules/node-abi/abi_registry.json +12 -2
- package/node_modules/node-abi/package.json +3 -6
- package/node_modules/semver/classes/range.js +1 -0
- package/node_modules/semver/classes/semver.js +19 -5
- package/node_modules/semver/internal/identifiers.js +4 -0
- package/node_modules/semver/package.json +3 -3
- package/node_modules/undici-types/agent.d.ts +1 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +0 -1
- package/node_modules/undici-types/errors.d.ts +5 -15
- package/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/undici-types/interceptors.d.ts +5 -0
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/snapshot-agent.d.ts +5 -3
- package/node_modules/undici-types/webidl.d.ts +82 -21
- package/package.json +3 -3
- package/node_modules/@contrast/protect/lib/input-analysis/install/koa-body5.js +0 -63
- package/node_modules/@contrast/protect/lib/input-analysis/install/koa-bodyparser4.js +0 -64
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/crypto.js)
|
|
18
18
|
*/
|
|
19
19
|
declare module "crypto" {
|
|
20
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
20
21
|
import * as stream from "node:stream";
|
|
21
22
|
import { PeerCertificate } from "node:tls";
|
|
22
23
|
/**
|
|
@@ -44,7 +45,7 @@ declare module "crypto" {
|
|
|
44
45
|
* @param encoding The `encoding` of the `spkac` string.
|
|
45
46
|
* @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
|
|
46
47
|
*/
|
|
47
|
-
static exportChallenge(spkac: BinaryLike):
|
|
48
|
+
static exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
48
49
|
/**
|
|
49
50
|
* ```js
|
|
50
51
|
* const { Certificate } = await import('node:crypto');
|
|
@@ -57,7 +58,7 @@ declare module "crypto" {
|
|
|
57
58
|
* @param encoding The `encoding` of the `spkac` string.
|
|
58
59
|
* @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
|
|
59
60
|
*/
|
|
60
|
-
static exportPublicKey(spkac: BinaryLike, encoding?: string):
|
|
61
|
+
static exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
61
62
|
/**
|
|
62
63
|
* ```js
|
|
63
64
|
* import { Buffer } from 'node:buffer';
|
|
@@ -78,7 +79,7 @@ declare module "crypto" {
|
|
|
78
79
|
* @returns The challenge component of the `spkac` data structure,
|
|
79
80
|
* which includes a public key and a challenge.
|
|
80
81
|
*/
|
|
81
|
-
exportChallenge(spkac: BinaryLike):
|
|
82
|
+
exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
82
83
|
/**
|
|
83
84
|
* @deprecated
|
|
84
85
|
* @param spkac
|
|
@@ -86,7 +87,7 @@ declare module "crypto" {
|
|
|
86
87
|
* @returns The public key component of the `spkac` data structure,
|
|
87
88
|
* which includes a public key and a challenge.
|
|
88
89
|
*/
|
|
89
|
-
exportPublicKey(spkac: BinaryLike, encoding?: string):
|
|
90
|
+
exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
90
91
|
/**
|
|
91
92
|
* @deprecated
|
|
92
93
|
* @param spkac
|
|
@@ -402,7 +403,7 @@ declare module "crypto" {
|
|
|
402
403
|
* @since v0.1.92
|
|
403
404
|
* @param encoding The `encoding` of the return value.
|
|
404
405
|
*/
|
|
405
|
-
digest():
|
|
406
|
+
digest(): NonSharedBuffer;
|
|
406
407
|
digest(encoding: BinaryToTextEncoding): string;
|
|
407
408
|
}
|
|
408
409
|
/**
|
|
@@ -496,7 +497,7 @@ declare module "crypto" {
|
|
|
496
497
|
* @since v0.1.94
|
|
497
498
|
* @param encoding The `encoding` of the return value.
|
|
498
499
|
*/
|
|
499
|
-
digest():
|
|
500
|
+
digest(): NonSharedBuffer;
|
|
500
501
|
digest(encoding: BinaryToTextEncoding): string;
|
|
501
502
|
}
|
|
502
503
|
type KeyObjectType = "secret" | "public" | "private";
|
|
@@ -510,50 +511,50 @@ declare module "crypto" {
|
|
|
510
511
|
format: "jwk";
|
|
511
512
|
}
|
|
512
513
|
interface JsonWebKey {
|
|
513
|
-
crv?: string
|
|
514
|
-
d?: string
|
|
515
|
-
dp?: string
|
|
516
|
-
dq?: string
|
|
517
|
-
e?: string
|
|
518
|
-
k?: string
|
|
519
|
-
kty?: string
|
|
520
|
-
n?: string
|
|
521
|
-
p?: string
|
|
522
|
-
q?: string
|
|
523
|
-
qi?: string
|
|
524
|
-
x?: string
|
|
525
|
-
y?: string
|
|
514
|
+
crv?: string;
|
|
515
|
+
d?: string;
|
|
516
|
+
dp?: string;
|
|
517
|
+
dq?: string;
|
|
518
|
+
e?: string;
|
|
519
|
+
k?: string;
|
|
520
|
+
kty?: string;
|
|
521
|
+
n?: string;
|
|
522
|
+
p?: string;
|
|
523
|
+
q?: string;
|
|
524
|
+
qi?: string;
|
|
525
|
+
x?: string;
|
|
526
|
+
y?: string;
|
|
526
527
|
[key: string]: unknown;
|
|
527
528
|
}
|
|
528
529
|
interface AsymmetricKeyDetails {
|
|
529
530
|
/**
|
|
530
531
|
* Key size in bits (RSA, DSA).
|
|
531
532
|
*/
|
|
532
|
-
modulusLength?: number
|
|
533
|
+
modulusLength?: number;
|
|
533
534
|
/**
|
|
534
535
|
* Public exponent (RSA).
|
|
535
536
|
*/
|
|
536
|
-
publicExponent?: bigint
|
|
537
|
+
publicExponent?: bigint;
|
|
537
538
|
/**
|
|
538
539
|
* Name of the message digest (RSA-PSS).
|
|
539
540
|
*/
|
|
540
|
-
hashAlgorithm?: string
|
|
541
|
+
hashAlgorithm?: string;
|
|
541
542
|
/**
|
|
542
543
|
* Name of the message digest used by MGF1 (RSA-PSS).
|
|
543
544
|
*/
|
|
544
|
-
mgf1HashAlgorithm?: string
|
|
545
|
+
mgf1HashAlgorithm?: string;
|
|
545
546
|
/**
|
|
546
547
|
* Minimal salt length in bytes (RSA-PSS).
|
|
547
548
|
*/
|
|
548
|
-
saltLength?: number
|
|
549
|
+
saltLength?: number;
|
|
549
550
|
/**
|
|
550
551
|
* Size of q in bits (DSA).
|
|
551
552
|
*/
|
|
552
|
-
divisorLength?: number
|
|
553
|
+
divisorLength?: number;
|
|
553
554
|
/**
|
|
554
555
|
* Name of the curve (EC).
|
|
555
556
|
*/
|
|
556
|
-
namedCurve?: string
|
|
557
|
+
namedCurve?: string;
|
|
557
558
|
}
|
|
558
559
|
/**
|
|
559
560
|
* Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
|
|
@@ -591,27 +592,14 @@ declare module "crypto" {
|
|
|
591
592
|
*/
|
|
592
593
|
static from(key: webcrypto.CryptoKey): KeyObject;
|
|
593
594
|
/**
|
|
594
|
-
* For asymmetric keys, this property represents the type of the key.
|
|
595
|
-
* types
|
|
596
|
-
*
|
|
597
|
-
* * `'rsa'` (OID 1.2.840.113549.1.1.1)
|
|
598
|
-
* * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
|
|
599
|
-
* * `'dsa'` (OID 1.2.840.10040.4.1)
|
|
600
|
-
* * `'ec'` (OID 1.2.840.10045.2.1)
|
|
601
|
-
* * `'x25519'` (OID 1.3.101.110)
|
|
602
|
-
* * `'x448'` (OID 1.3.101.111)
|
|
603
|
-
* * `'ed25519'` (OID 1.3.101.112)
|
|
604
|
-
* * `'ed448'` (OID 1.3.101.113)
|
|
605
|
-
* * `'dh'` (OID 1.2.840.113549.1.3.1)
|
|
606
|
-
* * `'ml-dsa-44'` (OID 2.16.840.1.101.3.4.3.17)
|
|
607
|
-
* * `'ml-dsa-65'` (OID 2.16.840.1.101.3.4.3.18)
|
|
608
|
-
* * `'ml-dsa-87'` (OID 2.16.840.1.101.3.4.3.19)
|
|
595
|
+
* For asymmetric keys, this property represents the type of the key. See the
|
|
596
|
+
* supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
|
|
609
597
|
*
|
|
610
598
|
* This property is `undefined` for unrecognized `KeyObject` types and symmetric
|
|
611
599
|
* keys.
|
|
612
600
|
* @since v11.6.0
|
|
613
601
|
*/
|
|
614
|
-
asymmetricKeyType?: KeyType
|
|
602
|
+
asymmetricKeyType?: KeyType;
|
|
615
603
|
/**
|
|
616
604
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
617
605
|
* this object contains information about the key. None of the information obtained
|
|
@@ -625,7 +613,7 @@ declare module "crypto" {
|
|
|
625
613
|
* Other key details might be exposed via this API using additional attributes.
|
|
626
614
|
* @since v15.7.0
|
|
627
615
|
*/
|
|
628
|
-
asymmetricKeyDetails?: AsymmetricKeyDetails
|
|
616
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
629
617
|
/**
|
|
630
618
|
* For symmetric keys, the following encoding options can be used:
|
|
631
619
|
*
|
|
@@ -649,8 +637,8 @@ declare module "crypto" {
|
|
|
649
637
|
* PKCS#1 and SEC1 encryption.
|
|
650
638
|
* @since v11.6.0
|
|
651
639
|
*/
|
|
652
|
-
export(options: KeyExportOptions<"pem">): string |
|
|
653
|
-
export(options?: KeyExportOptions<"der">):
|
|
640
|
+
export(options: KeyExportOptions<"pem">): string | NonSharedBuffer;
|
|
641
|
+
export(options?: KeyExportOptions<"der">): NonSharedBuffer;
|
|
654
642
|
export(options?: JwkKeyExportOptions): JsonWebKey;
|
|
655
643
|
/**
|
|
656
644
|
* Returns `true` or `false` depending on whether the keys have exactly the same
|
|
@@ -664,7 +652,7 @@ declare module "crypto" {
|
|
|
664
652
|
* property is `undefined` for asymmetric keys.
|
|
665
653
|
* @since v11.6.0
|
|
666
654
|
*/
|
|
667
|
-
symmetricKeySize?: number
|
|
655
|
+
symmetricKeySize?: number;
|
|
668
656
|
/**
|
|
669
657
|
* Converts a `KeyObject` instance to a `CryptoKey`.
|
|
670
658
|
* @since 22.10.0
|
|
@@ -899,8 +887,8 @@ declare module "crypto" {
|
|
|
899
887
|
* @param inputEncoding The `encoding` of the data.
|
|
900
888
|
* @param outputEncoding The `encoding` of the return value.
|
|
901
889
|
*/
|
|
902
|
-
update(data: BinaryLike):
|
|
903
|
-
update(data: string, inputEncoding: Encoding):
|
|
890
|
+
update(data: BinaryLike): NonSharedBuffer;
|
|
891
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
904
892
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
905
893
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
906
894
|
/**
|
|
@@ -911,7 +899,7 @@ declare module "crypto" {
|
|
|
911
899
|
* @param outputEncoding The `encoding` of the return value.
|
|
912
900
|
* @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
913
901
|
*/
|
|
914
|
-
final():
|
|
902
|
+
final(): NonSharedBuffer;
|
|
915
903
|
final(outputEncoding: BufferEncoding): string;
|
|
916
904
|
/**
|
|
917
905
|
* When using block encryption algorithms, the `Cipheriv` class will automatically
|
|
@@ -937,7 +925,7 @@ declare module "crypto" {
|
|
|
937
925
|
plaintextLength: number;
|
|
938
926
|
},
|
|
939
927
|
): this;
|
|
940
|
-
getAuthTag():
|
|
928
|
+
getAuthTag(): NonSharedBuffer;
|
|
941
929
|
}
|
|
942
930
|
interface CipherGCM extends Cipheriv {
|
|
943
931
|
setAAD(
|
|
@@ -946,7 +934,7 @@ declare module "crypto" {
|
|
|
946
934
|
plaintextLength: number;
|
|
947
935
|
},
|
|
948
936
|
): this;
|
|
949
|
-
getAuthTag():
|
|
937
|
+
getAuthTag(): NonSharedBuffer;
|
|
950
938
|
}
|
|
951
939
|
interface CipherOCB extends Cipheriv {
|
|
952
940
|
setAAD(
|
|
@@ -955,7 +943,7 @@ declare module "crypto" {
|
|
|
955
943
|
plaintextLength: number;
|
|
956
944
|
},
|
|
957
945
|
): this;
|
|
958
|
-
getAuthTag():
|
|
946
|
+
getAuthTag(): NonSharedBuffer;
|
|
959
947
|
}
|
|
960
948
|
interface CipherChaCha20Poly1305 extends Cipheriv {
|
|
961
949
|
setAAD(
|
|
@@ -964,7 +952,7 @@ declare module "crypto" {
|
|
|
964
952
|
plaintextLength: number;
|
|
965
953
|
},
|
|
966
954
|
): this;
|
|
967
|
-
getAuthTag():
|
|
955
|
+
getAuthTag(): NonSharedBuffer;
|
|
968
956
|
}
|
|
969
957
|
/**
|
|
970
958
|
* Creates and returns a `Decipheriv` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
|
|
@@ -1149,8 +1137,8 @@ declare module "crypto" {
|
|
|
1149
1137
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1150
1138
|
* @param outputEncoding The `encoding` of the return value.
|
|
1151
1139
|
*/
|
|
1152
|
-
update(data: NodeJS.ArrayBufferView):
|
|
1153
|
-
update(data: string, inputEncoding: Encoding):
|
|
1140
|
+
update(data: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
1141
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
1154
1142
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
1155
1143
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
1156
1144
|
/**
|
|
@@ -1161,7 +1149,7 @@ declare module "crypto" {
|
|
|
1161
1149
|
* @param outputEncoding The `encoding` of the return value.
|
|
1162
1150
|
* @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
1163
1151
|
*/
|
|
1164
|
-
final():
|
|
1152
|
+
final(): NonSharedBuffer;
|
|
1165
1153
|
final(outputEncoding: BufferEncoding): string;
|
|
1166
1154
|
/**
|
|
1167
1155
|
* When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
|
|
@@ -1323,6 +1311,7 @@ declare module "crypto" {
|
|
|
1323
1311
|
* @since v0.1.92
|
|
1324
1312
|
* @param options `stream.Writable` options
|
|
1325
1313
|
*/
|
|
1314
|
+
// TODO: signing algorithm type
|
|
1326
1315
|
function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
|
|
1327
1316
|
type DSAEncoding = "der" | "ieee-p1363";
|
|
1328
1317
|
interface SigningOptions {
|
|
@@ -1332,6 +1321,7 @@ declare module "crypto" {
|
|
|
1332
1321
|
padding?: number | undefined;
|
|
1333
1322
|
saltLength?: number | undefined;
|
|
1334
1323
|
dsaEncoding?: DSAEncoding | undefined;
|
|
1324
|
+
context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
1335
1325
|
}
|
|
1336
1326
|
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
1337
1327
|
interface SignKeyObjectInput extends SigningOptions {
|
|
@@ -1433,7 +1423,7 @@ declare module "crypto" {
|
|
|
1433
1423
|
* called. Multiple calls to `sign.sign()` will result in an error being thrown.
|
|
1434
1424
|
* @since v0.1.92
|
|
1435
1425
|
*/
|
|
1436
|
-
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput):
|
|
1426
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
1437
1427
|
sign(
|
|
1438
1428
|
privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
1439
1429
|
outputFormat: BinaryToTextEncoding,
|
|
@@ -1592,7 +1582,7 @@ declare module "crypto" {
|
|
|
1592
1582
|
* @since v0.5.0
|
|
1593
1583
|
* @param encoding The `encoding` of the return value.
|
|
1594
1584
|
*/
|
|
1595
|
-
generateKeys():
|
|
1585
|
+
generateKeys(): NonSharedBuffer;
|
|
1596
1586
|
generateKeys(encoding: BinaryToTextEncoding): string;
|
|
1597
1587
|
/**
|
|
1598
1588
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
@@ -1607,8 +1597,16 @@ declare module "crypto" {
|
|
|
1607
1597
|
* @param inputEncoding The `encoding` of an `otherPublicKey` string.
|
|
1608
1598
|
* @param outputEncoding The `encoding` of the return value.
|
|
1609
1599
|
*/
|
|
1610
|
-
computeSecret(
|
|
1611
|
-
|
|
1600
|
+
computeSecret(
|
|
1601
|
+
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1602
|
+
inputEncoding?: null,
|
|
1603
|
+
outputEncoding?: null,
|
|
1604
|
+
): NonSharedBuffer;
|
|
1605
|
+
computeSecret(
|
|
1606
|
+
otherPublicKey: string,
|
|
1607
|
+
inputEncoding: BinaryToTextEncoding,
|
|
1608
|
+
outputEncoding?: null,
|
|
1609
|
+
): NonSharedBuffer;
|
|
1612
1610
|
computeSecret(
|
|
1613
1611
|
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1614
1612
|
inputEncoding: null,
|
|
@@ -1626,7 +1624,7 @@ declare module "crypto" {
|
|
|
1626
1624
|
* @since v0.5.0
|
|
1627
1625
|
* @param encoding The `encoding` of the return value.
|
|
1628
1626
|
*/
|
|
1629
|
-
getPrime():
|
|
1627
|
+
getPrime(): NonSharedBuffer;
|
|
1630
1628
|
getPrime(encoding: BinaryToTextEncoding): string;
|
|
1631
1629
|
/**
|
|
1632
1630
|
* Returns the Diffie-Hellman generator in the specified `encoding`.
|
|
@@ -1635,7 +1633,7 @@ declare module "crypto" {
|
|
|
1635
1633
|
* @since v0.5.0
|
|
1636
1634
|
* @param encoding The `encoding` of the return value.
|
|
1637
1635
|
*/
|
|
1638
|
-
getGenerator():
|
|
1636
|
+
getGenerator(): NonSharedBuffer;
|
|
1639
1637
|
getGenerator(encoding: BinaryToTextEncoding): string;
|
|
1640
1638
|
/**
|
|
1641
1639
|
* Returns the Diffie-Hellman public key in the specified `encoding`.
|
|
@@ -1644,7 +1642,7 @@ declare module "crypto" {
|
|
|
1644
1642
|
* @since v0.5.0
|
|
1645
1643
|
* @param encoding The `encoding` of the return value.
|
|
1646
1644
|
*/
|
|
1647
|
-
getPublicKey():
|
|
1645
|
+
getPublicKey(): NonSharedBuffer;
|
|
1648
1646
|
getPublicKey(encoding: BinaryToTextEncoding): string;
|
|
1649
1647
|
/**
|
|
1650
1648
|
* Returns the Diffie-Hellman private key in the specified `encoding`.
|
|
@@ -1653,7 +1651,7 @@ declare module "crypto" {
|
|
|
1653
1651
|
* @since v0.5.0
|
|
1654
1652
|
* @param encoding The `encoding` of the return value.
|
|
1655
1653
|
*/
|
|
1656
|
-
getPrivateKey():
|
|
1654
|
+
getPrivateKey(): NonSharedBuffer;
|
|
1657
1655
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
1658
1656
|
/**
|
|
1659
1657
|
* Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected
|
|
@@ -1797,7 +1795,7 @@ declare module "crypto" {
|
|
|
1797
1795
|
iterations: number,
|
|
1798
1796
|
keylen: number,
|
|
1799
1797
|
digest: string,
|
|
1800
|
-
callback: (err: Error | null, derivedKey:
|
|
1798
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
1801
1799
|
): void;
|
|
1802
1800
|
/**
|
|
1803
1801
|
* Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
|
@@ -1834,7 +1832,7 @@ declare module "crypto" {
|
|
|
1834
1832
|
iterations: number,
|
|
1835
1833
|
keylen: number,
|
|
1836
1834
|
digest: string,
|
|
1837
|
-
):
|
|
1835
|
+
): NonSharedBuffer;
|
|
1838
1836
|
/**
|
|
1839
1837
|
* Generates cryptographically strong pseudorandom data. The `size` argument
|
|
1840
1838
|
* is a number indicating the number of bytes to generate.
|
|
@@ -1887,10 +1885,10 @@ declare module "crypto" {
|
|
|
1887
1885
|
* @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
|
|
1888
1886
|
* @return if the `callback` function is not provided.
|
|
1889
1887
|
*/
|
|
1890
|
-
function randomBytes(size: number):
|
|
1891
|
-
function randomBytes(size: number, callback: (err: Error | null, buf:
|
|
1892
|
-
function pseudoRandomBytes(size: number):
|
|
1893
|
-
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf:
|
|
1888
|
+
function randomBytes(size: number): NonSharedBuffer;
|
|
1889
|
+
function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
1890
|
+
function pseudoRandomBytes(size: number): NonSharedBuffer;
|
|
1891
|
+
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
1894
1892
|
/**
|
|
1895
1893
|
* Return a random integer `n` such that `min <= n < max`. This
|
|
1896
1894
|
* implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
|
|
@@ -2120,14 +2118,14 @@ declare module "crypto" {
|
|
|
2120
2118
|
password: BinaryLike,
|
|
2121
2119
|
salt: BinaryLike,
|
|
2122
2120
|
keylen: number,
|
|
2123
|
-
callback: (err: Error | null, derivedKey:
|
|
2121
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
2124
2122
|
): void;
|
|
2125
2123
|
function scrypt(
|
|
2126
2124
|
password: BinaryLike,
|
|
2127
2125
|
salt: BinaryLike,
|
|
2128
2126
|
keylen: number,
|
|
2129
2127
|
options: ScryptOptions,
|
|
2130
|
-
callback: (err: Error | null, derivedKey:
|
|
2128
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
2131
2129
|
): void;
|
|
2132
2130
|
/**
|
|
2133
2131
|
* Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
|
|
@@ -2159,7 +2157,12 @@ declare module "crypto" {
|
|
|
2159
2157
|
* ```
|
|
2160
2158
|
* @since v10.5.0
|
|
2161
2159
|
*/
|
|
2162
|
-
function scryptSync(
|
|
2160
|
+
function scryptSync(
|
|
2161
|
+
password: BinaryLike,
|
|
2162
|
+
salt: BinaryLike,
|
|
2163
|
+
keylen: number,
|
|
2164
|
+
options?: ScryptOptions,
|
|
2165
|
+
): NonSharedBuffer;
|
|
2163
2166
|
interface RsaPublicKey {
|
|
2164
2167
|
key: KeyLike;
|
|
2165
2168
|
padding?: number | undefined;
|
|
@@ -2188,7 +2191,7 @@ declare module "crypto" {
|
|
|
2188
2191
|
function publicEncrypt(
|
|
2189
2192
|
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2190
2193
|
buffer: NodeJS.ArrayBufferView | string,
|
|
2191
|
-
):
|
|
2194
|
+
): NonSharedBuffer;
|
|
2192
2195
|
/**
|
|
2193
2196
|
* Decrypts `buffer` with `key`.`buffer` was previously encrypted using
|
|
2194
2197
|
* the corresponding private key, for example using {@link privateEncrypt}.
|
|
@@ -2203,7 +2206,7 @@ declare module "crypto" {
|
|
|
2203
2206
|
function publicDecrypt(
|
|
2204
2207
|
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2205
2208
|
buffer: NodeJS.ArrayBufferView | string,
|
|
2206
|
-
):
|
|
2209
|
+
): NonSharedBuffer;
|
|
2207
2210
|
/**
|
|
2208
2211
|
* Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
|
|
2209
2212
|
* the corresponding public key, for example using {@link publicEncrypt}.
|
|
@@ -2212,7 +2215,10 @@ declare module "crypto" {
|
|
|
2212
2215
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
|
|
2213
2216
|
* @since v0.11.14
|
|
2214
2217
|
*/
|
|
2215
|
-
function privateDecrypt(
|
|
2218
|
+
function privateDecrypt(
|
|
2219
|
+
privateKey: RsaPrivateKey | KeyLike,
|
|
2220
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2221
|
+
): NonSharedBuffer;
|
|
2216
2222
|
/**
|
|
2217
2223
|
* Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
|
|
2218
2224
|
* the corresponding public key, for example using {@link publicDecrypt}.
|
|
@@ -2221,7 +2227,10 @@ declare module "crypto" {
|
|
|
2221
2227
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
|
|
2222
2228
|
* @since v1.1.0
|
|
2223
2229
|
*/
|
|
2224
|
-
function privateEncrypt(
|
|
2230
|
+
function privateEncrypt(
|
|
2231
|
+
privateKey: RsaPrivateKey | KeyLike,
|
|
2232
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2233
|
+
): NonSharedBuffer;
|
|
2225
2234
|
/**
|
|
2226
2235
|
* ```js
|
|
2227
2236
|
* const {
|
|
@@ -2350,7 +2359,7 @@ declare module "crypto" {
|
|
|
2350
2359
|
inputEncoding?: BinaryToTextEncoding,
|
|
2351
2360
|
outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
|
|
2352
2361
|
format?: "uncompressed" | "compressed" | "hybrid",
|
|
2353
|
-
):
|
|
2362
|
+
): NonSharedBuffer | string;
|
|
2354
2363
|
/**
|
|
2355
2364
|
* Generates private and public EC Diffie-Hellman key values, and returns
|
|
2356
2365
|
* the public key in the specified `format` and `encoding`. This key should be
|
|
@@ -2363,7 +2372,7 @@ declare module "crypto" {
|
|
|
2363
2372
|
* @param encoding The `encoding` of the return value.
|
|
2364
2373
|
* @param [format='uncompressed']
|
|
2365
2374
|
*/
|
|
2366
|
-
generateKeys():
|
|
2375
|
+
generateKeys(): NonSharedBuffer;
|
|
2367
2376
|
generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2368
2377
|
/**
|
|
2369
2378
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
@@ -2382,8 +2391,8 @@ declare module "crypto" {
|
|
|
2382
2391
|
* @param inputEncoding The `encoding` of the `otherPublicKey` string.
|
|
2383
2392
|
* @param outputEncoding The `encoding` of the return value.
|
|
2384
2393
|
*/
|
|
2385
|
-
computeSecret(otherPublicKey: NodeJS.ArrayBufferView):
|
|
2386
|
-
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding):
|
|
2394
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
2395
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer;
|
|
2387
2396
|
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
2388
2397
|
computeSecret(
|
|
2389
2398
|
otherPublicKey: string,
|
|
@@ -2397,7 +2406,7 @@ declare module "crypto" {
|
|
|
2397
2406
|
* @param encoding The `encoding` of the return value.
|
|
2398
2407
|
* @return The EC Diffie-Hellman in the specified `encoding`.
|
|
2399
2408
|
*/
|
|
2400
|
-
getPrivateKey():
|
|
2409
|
+
getPrivateKey(): NonSharedBuffer;
|
|
2401
2410
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
2402
2411
|
/**
|
|
2403
2412
|
* The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
|
|
@@ -2409,7 +2418,7 @@ declare module "crypto" {
|
|
|
2409
2418
|
* @param [format='uncompressed']
|
|
2410
2419
|
* @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
|
|
2411
2420
|
*/
|
|
2412
|
-
getPublicKey(encoding?: null, format?: ECDHKeyFormat):
|
|
2421
|
+
getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
|
|
2413
2422
|
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2414
2423
|
/**
|
|
2415
2424
|
* Sets the EC Diffie-Hellman private key.
|
|
@@ -2460,17 +2469,33 @@ declare module "crypto" {
|
|
|
2460
2469
|
*/
|
|
2461
2470
|
function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
|
|
2462
2471
|
type KeyType =
|
|
2463
|
-
| "
|
|
2464
|
-
| "rsa-pss"
|
|
2472
|
+
| "dh"
|
|
2465
2473
|
| "dsa"
|
|
2466
2474
|
| "ec"
|
|
2467
2475
|
| "ed25519"
|
|
2468
2476
|
| "ed448"
|
|
2469
|
-
| "x25519"
|
|
2470
|
-
| "x448"
|
|
2471
2477
|
| "ml-dsa-44"
|
|
2472
2478
|
| "ml-dsa-65"
|
|
2473
|
-
| "ml-dsa-87"
|
|
2479
|
+
| "ml-dsa-87"
|
|
2480
|
+
| "ml-kem-1024"
|
|
2481
|
+
| "ml-kem-512"
|
|
2482
|
+
| "ml-kem-768"
|
|
2483
|
+
| "rsa-pss"
|
|
2484
|
+
| "rsa"
|
|
2485
|
+
| "slh-dsa-sha2-128f"
|
|
2486
|
+
| "slh-dsa-sha2-128s"
|
|
2487
|
+
| "slh-dsa-sha2-192f"
|
|
2488
|
+
| "slh-dsa-sha2-192s"
|
|
2489
|
+
| "slh-dsa-sha2-256f"
|
|
2490
|
+
| "slh-dsa-sha2-256s"
|
|
2491
|
+
| "slh-dsa-shake-128f"
|
|
2492
|
+
| "slh-dsa-shake-128s"
|
|
2493
|
+
| "slh-dsa-shake-192f"
|
|
2494
|
+
| "slh-dsa-shake-192s"
|
|
2495
|
+
| "slh-dsa-shake-256f"
|
|
2496
|
+
| "slh-dsa-shake-256s"
|
|
2497
|
+
| "x25519"
|
|
2498
|
+
| "x448";
|
|
2474
2499
|
type KeyFormat = "pem" | "der" | "jwk";
|
|
2475
2500
|
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
2476
2501
|
format: T;
|
|
@@ -2486,6 +2511,8 @@ declare module "crypto" {
|
|
|
2486
2511
|
interface X25519KeyPairKeyObjectOptions {}
|
|
2487
2512
|
interface X448KeyPairKeyObjectOptions {}
|
|
2488
2513
|
interface MLDSAKeyPairKeyObjectOptions {}
|
|
2514
|
+
interface MLKEMKeyPairKeyObjectOptions {}
|
|
2515
|
+
interface SLHDSAKeyPairKeyObjectOptions {}
|
|
2489
2516
|
interface ECKeyPairKeyObjectOptions {
|
|
2490
2517
|
/**
|
|
2491
2518
|
* Name of the curve to use
|
|
@@ -2520,15 +2547,15 @@ declare module "crypto" {
|
|
|
2520
2547
|
/**
|
|
2521
2548
|
* Name of the message digest
|
|
2522
2549
|
*/
|
|
2523
|
-
hashAlgorithm?: string;
|
|
2550
|
+
hashAlgorithm?: string | undefined;
|
|
2524
2551
|
/**
|
|
2525
2552
|
* Name of the message digest used by MGF1
|
|
2526
2553
|
*/
|
|
2527
|
-
mgf1HashAlgorithm?: string;
|
|
2554
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2528
2555
|
/**
|
|
2529
2556
|
* Minimal salt length in bytes
|
|
2530
2557
|
*/
|
|
2531
|
-
saltLength?: string;
|
|
2558
|
+
saltLength?: string | undefined;
|
|
2532
2559
|
}
|
|
2533
2560
|
interface DSAKeyPairKeyObjectOptions {
|
|
2534
2561
|
/**
|
|
@@ -2571,15 +2598,15 @@ declare module "crypto" {
|
|
|
2571
2598
|
/**
|
|
2572
2599
|
* Name of the message digest
|
|
2573
2600
|
*/
|
|
2574
|
-
hashAlgorithm?: string;
|
|
2601
|
+
hashAlgorithm?: string | undefined;
|
|
2575
2602
|
/**
|
|
2576
2603
|
* Name of the message digest used by MGF1
|
|
2577
2604
|
*/
|
|
2578
|
-
mgf1HashAlgorithm?: string;
|
|
2605
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2579
2606
|
/**
|
|
2580
2607
|
* Minimal salt length in bytes
|
|
2581
2608
|
*/
|
|
2582
|
-
saltLength?: string;
|
|
2609
|
+
saltLength?: string | undefined;
|
|
2583
2610
|
publicKeyEncoding: {
|
|
2584
2611
|
type: "spki";
|
|
2585
2612
|
format: PubF;
|
|
@@ -2659,6 +2686,24 @@ declare module "crypto" {
|
|
|
2659
2686
|
type: "pkcs8";
|
|
2660
2687
|
};
|
|
2661
2688
|
}
|
|
2689
|
+
interface MLKEMKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2690
|
+
publicKeyEncoding: {
|
|
2691
|
+
type: "spki";
|
|
2692
|
+
format: PubF;
|
|
2693
|
+
};
|
|
2694
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2695
|
+
type: "pkcs8";
|
|
2696
|
+
};
|
|
2697
|
+
}
|
|
2698
|
+
interface SLHDSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2699
|
+
publicKeyEncoding: {
|
|
2700
|
+
type: "spki";
|
|
2701
|
+
format: PubF;
|
|
2702
|
+
};
|
|
2703
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2704
|
+
type: "pkcs8";
|
|
2705
|
+
};
|
|
2706
|
+
}
|
|
2662
2707
|
interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
|
|
2663
2708
|
publicKey: T1;
|
|
2664
2709
|
privateKey: T2;
|
|
@@ -2702,8 +2747,8 @@ declare module "crypto" {
|
|
|
2702
2747
|
* When PEM encoding was selected, the respective key will be a string, otherwise
|
|
2703
2748
|
* it will be a buffer containing the data encoded as DER.
|
|
2704
2749
|
* @since v10.12.0
|
|
2705
|
-
* @param type
|
|
2706
|
-
*
|
|
2750
|
+
* @param type The asymmetric key type to generate. See the
|
|
2751
|
+
* supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
|
|
2707
2752
|
*/
|
|
2708
2753
|
function generateKeyPairSync(
|
|
2709
2754
|
type: "rsa",
|
|
@@ -2712,15 +2757,15 @@ declare module "crypto" {
|
|
|
2712
2757
|
function generateKeyPairSync(
|
|
2713
2758
|
type: "rsa",
|
|
2714
2759
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
2715
|
-
): KeyPairSyncResult<string,
|
|
2760
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2716
2761
|
function generateKeyPairSync(
|
|
2717
2762
|
type: "rsa",
|
|
2718
2763
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
2719
|
-
): KeyPairSyncResult<
|
|
2764
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2720
2765
|
function generateKeyPairSync(
|
|
2721
2766
|
type: "rsa",
|
|
2722
2767
|
options: RSAKeyPairOptions<"der", "der">,
|
|
2723
|
-
): KeyPairSyncResult<
|
|
2768
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2724
2769
|
function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2725
2770
|
function generateKeyPairSync(
|
|
2726
2771
|
type: "rsa-pss",
|
|
@@ -2729,15 +2774,15 @@ declare module "crypto" {
|
|
|
2729
2774
|
function generateKeyPairSync(
|
|
2730
2775
|
type: "rsa-pss",
|
|
2731
2776
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2732
|
-
): KeyPairSyncResult<string,
|
|
2777
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2733
2778
|
function generateKeyPairSync(
|
|
2734
2779
|
type: "rsa-pss",
|
|
2735
2780
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2736
|
-
): KeyPairSyncResult<
|
|
2781
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2737
2782
|
function generateKeyPairSync(
|
|
2738
2783
|
type: "rsa-pss",
|
|
2739
2784
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2740
|
-
): KeyPairSyncResult<
|
|
2785
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2741
2786
|
function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2742
2787
|
function generateKeyPairSync(
|
|
2743
2788
|
type: "dsa",
|
|
@@ -2746,15 +2791,15 @@ declare module "crypto" {
|
|
|
2746
2791
|
function generateKeyPairSync(
|
|
2747
2792
|
type: "dsa",
|
|
2748
2793
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
2749
|
-
): KeyPairSyncResult<string,
|
|
2794
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2750
2795
|
function generateKeyPairSync(
|
|
2751
2796
|
type: "dsa",
|
|
2752
2797
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
2753
|
-
): KeyPairSyncResult<
|
|
2798
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2754
2799
|
function generateKeyPairSync(
|
|
2755
2800
|
type: "dsa",
|
|
2756
2801
|
options: DSAKeyPairOptions<"der", "der">,
|
|
2757
|
-
): KeyPairSyncResult<
|
|
2802
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2758
2803
|
function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2759
2804
|
function generateKeyPairSync(
|
|
2760
2805
|
type: "ec",
|
|
@@ -2763,15 +2808,15 @@ declare module "crypto" {
|
|
|
2763
2808
|
function generateKeyPairSync(
|
|
2764
2809
|
type: "ec",
|
|
2765
2810
|
options: ECKeyPairOptions<"pem", "der">,
|
|
2766
|
-
): KeyPairSyncResult<string,
|
|
2811
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2767
2812
|
function generateKeyPairSync(
|
|
2768
2813
|
type: "ec",
|
|
2769
2814
|
options: ECKeyPairOptions<"der", "pem">,
|
|
2770
|
-
): KeyPairSyncResult<
|
|
2815
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2771
2816
|
function generateKeyPairSync(
|
|
2772
2817
|
type: "ec",
|
|
2773
2818
|
options: ECKeyPairOptions<"der", "der">,
|
|
2774
|
-
): KeyPairSyncResult<
|
|
2819
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2775
2820
|
function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2776
2821
|
function generateKeyPairSync(
|
|
2777
2822
|
type: "ed25519",
|
|
@@ -2780,15 +2825,15 @@ declare module "crypto" {
|
|
|
2780
2825
|
function generateKeyPairSync(
|
|
2781
2826
|
type: "ed25519",
|
|
2782
2827
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
2783
|
-
): KeyPairSyncResult<string,
|
|
2828
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2784
2829
|
function generateKeyPairSync(
|
|
2785
2830
|
type: "ed25519",
|
|
2786
2831
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
2787
|
-
): KeyPairSyncResult<
|
|
2832
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2788
2833
|
function generateKeyPairSync(
|
|
2789
2834
|
type: "ed25519",
|
|
2790
2835
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
2791
|
-
): KeyPairSyncResult<
|
|
2836
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2792
2837
|
function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2793
2838
|
function generateKeyPairSync(
|
|
2794
2839
|
type: "ed448",
|
|
@@ -2797,15 +2842,15 @@ declare module "crypto" {
|
|
|
2797
2842
|
function generateKeyPairSync(
|
|
2798
2843
|
type: "ed448",
|
|
2799
2844
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
2800
|
-
): KeyPairSyncResult<string,
|
|
2845
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2801
2846
|
function generateKeyPairSync(
|
|
2802
2847
|
type: "ed448",
|
|
2803
2848
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
2804
|
-
): KeyPairSyncResult<
|
|
2849
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2805
2850
|
function generateKeyPairSync(
|
|
2806
2851
|
type: "ed448",
|
|
2807
2852
|
options: ED448KeyPairOptions<"der", "der">,
|
|
2808
|
-
): KeyPairSyncResult<
|
|
2853
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2809
2854
|
function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2810
2855
|
function generateKeyPairSync(
|
|
2811
2856
|
type: "x25519",
|
|
@@ -2814,15 +2859,15 @@ declare module "crypto" {
|
|
|
2814
2859
|
function generateKeyPairSync(
|
|
2815
2860
|
type: "x25519",
|
|
2816
2861
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
2817
|
-
): KeyPairSyncResult<string,
|
|
2862
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2818
2863
|
function generateKeyPairSync(
|
|
2819
2864
|
type: "x25519",
|
|
2820
2865
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
2821
|
-
): KeyPairSyncResult<
|
|
2866
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2822
2867
|
function generateKeyPairSync(
|
|
2823
2868
|
type: "x25519",
|
|
2824
2869
|
options: X25519KeyPairOptions<"der", "der">,
|
|
2825
|
-
): KeyPairSyncResult<
|
|
2870
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2826
2871
|
function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2827
2872
|
function generateKeyPairSync(
|
|
2828
2873
|
type: "x448",
|
|
@@ -2831,15 +2876,15 @@ declare module "crypto" {
|
|
|
2831
2876
|
function generateKeyPairSync(
|
|
2832
2877
|
type: "x448",
|
|
2833
2878
|
options: X448KeyPairOptions<"pem", "der">,
|
|
2834
|
-
): KeyPairSyncResult<string,
|
|
2879
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2835
2880
|
function generateKeyPairSync(
|
|
2836
2881
|
type: "x448",
|
|
2837
2882
|
options: X448KeyPairOptions<"der", "pem">,
|
|
2838
|
-
): KeyPairSyncResult<
|
|
2883
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2839
2884
|
function generateKeyPairSync(
|
|
2840
2885
|
type: "x448",
|
|
2841
2886
|
options: X448KeyPairOptions<"der", "der">,
|
|
2842
|
-
): KeyPairSyncResult<
|
|
2887
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2843
2888
|
function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2844
2889
|
function generateKeyPairSync(
|
|
2845
2890
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
@@ -2848,19 +2893,119 @@ declare module "crypto" {
|
|
|
2848
2893
|
function generateKeyPairSync(
|
|
2849
2894
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
2850
2895
|
options: MLDSAKeyPairOptions<"pem", "der">,
|
|
2851
|
-
): KeyPairSyncResult<string,
|
|
2896
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2852
2897
|
function generateKeyPairSync(
|
|
2853
2898
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
2854
2899
|
options: MLDSAKeyPairOptions<"der", "pem">,
|
|
2855
|
-
): KeyPairSyncResult<
|
|
2900
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2856
2901
|
function generateKeyPairSync(
|
|
2857
2902
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
2858
2903
|
options: MLDSAKeyPairOptions<"der", "der">,
|
|
2859
|
-
): KeyPairSyncResult<
|
|
2904
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2860
2905
|
function generateKeyPairSync(
|
|
2861
2906
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
2862
2907
|
options?: MLDSAKeyPairKeyObjectOptions,
|
|
2863
2908
|
): KeyPairKeyObjectResult;
|
|
2909
|
+
function generateKeyPairSync(
|
|
2910
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2911
|
+
options: MLKEMKeyPairOptions<"pem", "pem">,
|
|
2912
|
+
): KeyPairSyncResult<string, string>;
|
|
2913
|
+
function generateKeyPairSync(
|
|
2914
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2915
|
+
options: MLKEMKeyPairOptions<"pem", "der">,
|
|
2916
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2917
|
+
function generateKeyPairSync(
|
|
2918
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2919
|
+
options: MLKEMKeyPairOptions<"der", "pem">,
|
|
2920
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2921
|
+
function generateKeyPairSync(
|
|
2922
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2923
|
+
options: MLKEMKeyPairOptions<"der", "der">,
|
|
2924
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2925
|
+
function generateKeyPairSync(
|
|
2926
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2927
|
+
options?: MLKEMKeyPairKeyObjectOptions,
|
|
2928
|
+
): KeyPairKeyObjectResult;
|
|
2929
|
+
function generateKeyPairSync(
|
|
2930
|
+
type:
|
|
2931
|
+
| "slh-dsa-sha2-128f"
|
|
2932
|
+
| "slh-dsa-sha2-128s"
|
|
2933
|
+
| "slh-dsa-sha2-192f"
|
|
2934
|
+
| "slh-dsa-sha2-192s"
|
|
2935
|
+
| "slh-dsa-sha2-256f"
|
|
2936
|
+
| "slh-dsa-sha2-256s"
|
|
2937
|
+
| "slh-dsa-shake-128f"
|
|
2938
|
+
| "slh-dsa-shake-128s"
|
|
2939
|
+
| "slh-dsa-shake-192f"
|
|
2940
|
+
| "slh-dsa-shake-192s"
|
|
2941
|
+
| "slh-dsa-shake-256f"
|
|
2942
|
+
| "slh-dsa-shake-256s",
|
|
2943
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
2944
|
+
): KeyPairSyncResult<string, string>;
|
|
2945
|
+
function generateKeyPairSync(
|
|
2946
|
+
type:
|
|
2947
|
+
| "slh-dsa-sha2-128f"
|
|
2948
|
+
| "slh-dsa-sha2-128s"
|
|
2949
|
+
| "slh-dsa-sha2-192f"
|
|
2950
|
+
| "slh-dsa-sha2-192s"
|
|
2951
|
+
| "slh-dsa-sha2-256f"
|
|
2952
|
+
| "slh-dsa-sha2-256s"
|
|
2953
|
+
| "slh-dsa-shake-128f"
|
|
2954
|
+
| "slh-dsa-shake-128s"
|
|
2955
|
+
| "slh-dsa-shake-192f"
|
|
2956
|
+
| "slh-dsa-shake-192s"
|
|
2957
|
+
| "slh-dsa-shake-256f"
|
|
2958
|
+
| "slh-dsa-shake-256s",
|
|
2959
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
2960
|
+
): KeyPairSyncResult<string, Buffer>;
|
|
2961
|
+
function generateKeyPairSync(
|
|
2962
|
+
type:
|
|
2963
|
+
| "slh-dsa-sha2-128f"
|
|
2964
|
+
| "slh-dsa-sha2-128s"
|
|
2965
|
+
| "slh-dsa-sha2-192f"
|
|
2966
|
+
| "slh-dsa-sha2-192s"
|
|
2967
|
+
| "slh-dsa-sha2-256f"
|
|
2968
|
+
| "slh-dsa-sha2-256s"
|
|
2969
|
+
| "slh-dsa-shake-128f"
|
|
2970
|
+
| "slh-dsa-shake-128s"
|
|
2971
|
+
| "slh-dsa-shake-192f"
|
|
2972
|
+
| "slh-dsa-shake-192s"
|
|
2973
|
+
| "slh-dsa-shake-256f"
|
|
2974
|
+
| "slh-dsa-shake-256s",
|
|
2975
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
2976
|
+
): KeyPairSyncResult<Buffer, string>;
|
|
2977
|
+
function generateKeyPairSync(
|
|
2978
|
+
type:
|
|
2979
|
+
| "slh-dsa-sha2-128f"
|
|
2980
|
+
| "slh-dsa-sha2-128s"
|
|
2981
|
+
| "slh-dsa-sha2-192f"
|
|
2982
|
+
| "slh-dsa-sha2-192s"
|
|
2983
|
+
| "slh-dsa-sha2-256f"
|
|
2984
|
+
| "slh-dsa-sha2-256s"
|
|
2985
|
+
| "slh-dsa-shake-128f"
|
|
2986
|
+
| "slh-dsa-shake-128s"
|
|
2987
|
+
| "slh-dsa-shake-192f"
|
|
2988
|
+
| "slh-dsa-shake-192s"
|
|
2989
|
+
| "slh-dsa-shake-256f"
|
|
2990
|
+
| "slh-dsa-shake-256s",
|
|
2991
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
2992
|
+
): KeyPairSyncResult<Buffer, Buffer>;
|
|
2993
|
+
function generateKeyPairSync(
|
|
2994
|
+
type:
|
|
2995
|
+
| "slh-dsa-sha2-128f"
|
|
2996
|
+
| "slh-dsa-sha2-128s"
|
|
2997
|
+
| "slh-dsa-sha2-192f"
|
|
2998
|
+
| "slh-dsa-sha2-192s"
|
|
2999
|
+
| "slh-dsa-sha2-256f"
|
|
3000
|
+
| "slh-dsa-sha2-256s"
|
|
3001
|
+
| "slh-dsa-shake-128f"
|
|
3002
|
+
| "slh-dsa-shake-128s"
|
|
3003
|
+
| "slh-dsa-shake-192f"
|
|
3004
|
+
| "slh-dsa-shake-192s"
|
|
3005
|
+
| "slh-dsa-shake-256f"
|
|
3006
|
+
| "slh-dsa-shake-256s",
|
|
3007
|
+
options?: SLHDSAKeyPairKeyObjectOptions,
|
|
3008
|
+
): KeyPairKeyObjectResult;
|
|
2864
3009
|
/**
|
|
2865
3010
|
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
2866
3011
|
* Ed25519, Ed448, X25519, X448, and DH are currently supported.
|
|
@@ -2898,8 +3043,8 @@ declare module "crypto" {
|
|
|
2898
3043
|
* If this method is invoked as its `util.promisify()` ed version, it returns
|
|
2899
3044
|
* a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
|
|
2900
3045
|
* @since v10.12.0
|
|
2901
|
-
* @param type
|
|
2902
|
-
*
|
|
3046
|
+
* @param type The asymmetric key type to generate. See the
|
|
3047
|
+
* supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
|
|
2903
3048
|
*/
|
|
2904
3049
|
function generateKeyPair(
|
|
2905
3050
|
type: "rsa",
|
|
@@ -2909,17 +3054,17 @@ declare module "crypto" {
|
|
|
2909
3054
|
function generateKeyPair(
|
|
2910
3055
|
type: "rsa",
|
|
2911
3056
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
2912
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3057
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2913
3058
|
): void;
|
|
2914
3059
|
function generateKeyPair(
|
|
2915
3060
|
type: "rsa",
|
|
2916
3061
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
2917
|
-
callback: (err: Error | null, publicKey:
|
|
3062
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2918
3063
|
): void;
|
|
2919
3064
|
function generateKeyPair(
|
|
2920
3065
|
type: "rsa",
|
|
2921
3066
|
options: RSAKeyPairOptions<"der", "der">,
|
|
2922
|
-
callback: (err: Error | null, publicKey:
|
|
3067
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2923
3068
|
): void;
|
|
2924
3069
|
function generateKeyPair(
|
|
2925
3070
|
type: "rsa",
|
|
@@ -2934,17 +3079,17 @@ declare module "crypto" {
|
|
|
2934
3079
|
function generateKeyPair(
|
|
2935
3080
|
type: "rsa-pss",
|
|
2936
3081
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2937
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3082
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2938
3083
|
): void;
|
|
2939
3084
|
function generateKeyPair(
|
|
2940
3085
|
type: "rsa-pss",
|
|
2941
3086
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2942
|
-
callback: (err: Error | null, publicKey:
|
|
3087
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2943
3088
|
): void;
|
|
2944
3089
|
function generateKeyPair(
|
|
2945
3090
|
type: "rsa-pss",
|
|
2946
3091
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2947
|
-
callback: (err: Error | null, publicKey:
|
|
3092
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2948
3093
|
): void;
|
|
2949
3094
|
function generateKeyPair(
|
|
2950
3095
|
type: "rsa-pss",
|
|
@@ -2959,17 +3104,17 @@ declare module "crypto" {
|
|
|
2959
3104
|
function generateKeyPair(
|
|
2960
3105
|
type: "dsa",
|
|
2961
3106
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
2962
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3107
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2963
3108
|
): void;
|
|
2964
3109
|
function generateKeyPair(
|
|
2965
3110
|
type: "dsa",
|
|
2966
3111
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
2967
|
-
callback: (err: Error | null, publicKey:
|
|
3112
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2968
3113
|
): void;
|
|
2969
3114
|
function generateKeyPair(
|
|
2970
3115
|
type: "dsa",
|
|
2971
3116
|
options: DSAKeyPairOptions<"der", "der">,
|
|
2972
|
-
callback: (err: Error | null, publicKey:
|
|
3117
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2973
3118
|
): void;
|
|
2974
3119
|
function generateKeyPair(
|
|
2975
3120
|
type: "dsa",
|
|
@@ -2984,17 +3129,17 @@ declare module "crypto" {
|
|
|
2984
3129
|
function generateKeyPair(
|
|
2985
3130
|
type: "ec",
|
|
2986
3131
|
options: ECKeyPairOptions<"pem", "der">,
|
|
2987
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3132
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2988
3133
|
): void;
|
|
2989
3134
|
function generateKeyPair(
|
|
2990
3135
|
type: "ec",
|
|
2991
3136
|
options: ECKeyPairOptions<"der", "pem">,
|
|
2992
|
-
callback: (err: Error | null, publicKey:
|
|
3137
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2993
3138
|
): void;
|
|
2994
3139
|
function generateKeyPair(
|
|
2995
3140
|
type: "ec",
|
|
2996
3141
|
options: ECKeyPairOptions<"der", "der">,
|
|
2997
|
-
callback: (err: Error | null, publicKey:
|
|
3142
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2998
3143
|
): void;
|
|
2999
3144
|
function generateKeyPair(
|
|
3000
3145
|
type: "ec",
|
|
@@ -3009,17 +3154,17 @@ declare module "crypto" {
|
|
|
3009
3154
|
function generateKeyPair(
|
|
3010
3155
|
type: "ed25519",
|
|
3011
3156
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
3012
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3157
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3013
3158
|
): void;
|
|
3014
3159
|
function generateKeyPair(
|
|
3015
3160
|
type: "ed25519",
|
|
3016
3161
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
3017
|
-
callback: (err: Error | null, publicKey:
|
|
3162
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3018
3163
|
): void;
|
|
3019
3164
|
function generateKeyPair(
|
|
3020
3165
|
type: "ed25519",
|
|
3021
3166
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
3022
|
-
callback: (err: Error | null, publicKey:
|
|
3167
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3023
3168
|
): void;
|
|
3024
3169
|
function generateKeyPair(
|
|
3025
3170
|
type: "ed25519",
|
|
@@ -3034,17 +3179,17 @@ declare module "crypto" {
|
|
|
3034
3179
|
function generateKeyPair(
|
|
3035
3180
|
type: "ed448",
|
|
3036
3181
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
3037
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3182
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3038
3183
|
): void;
|
|
3039
3184
|
function generateKeyPair(
|
|
3040
3185
|
type: "ed448",
|
|
3041
3186
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
3042
|
-
callback: (err: Error | null, publicKey:
|
|
3187
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3043
3188
|
): void;
|
|
3044
3189
|
function generateKeyPair(
|
|
3045
3190
|
type: "ed448",
|
|
3046
3191
|
options: ED448KeyPairOptions<"der", "der">,
|
|
3047
|
-
callback: (err: Error | null, publicKey:
|
|
3192
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3048
3193
|
): void;
|
|
3049
3194
|
function generateKeyPair(
|
|
3050
3195
|
type: "ed448",
|
|
@@ -3059,17 +3204,17 @@ declare module "crypto" {
|
|
|
3059
3204
|
function generateKeyPair(
|
|
3060
3205
|
type: "x25519",
|
|
3061
3206
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
3062
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3207
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3063
3208
|
): void;
|
|
3064
3209
|
function generateKeyPair(
|
|
3065
3210
|
type: "x25519",
|
|
3066
3211
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
3067
|
-
callback: (err: Error | null, publicKey:
|
|
3212
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3068
3213
|
): void;
|
|
3069
3214
|
function generateKeyPair(
|
|
3070
3215
|
type: "x25519",
|
|
3071
3216
|
options: X25519KeyPairOptions<"der", "der">,
|
|
3072
|
-
callback: (err: Error | null, publicKey:
|
|
3217
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3073
3218
|
): void;
|
|
3074
3219
|
function generateKeyPair(
|
|
3075
3220
|
type: "x25519",
|
|
@@ -3084,17 +3229,17 @@ declare module "crypto" {
|
|
|
3084
3229
|
function generateKeyPair(
|
|
3085
3230
|
type: "x448",
|
|
3086
3231
|
options: X448KeyPairOptions<"pem", "der">,
|
|
3087
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3232
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3088
3233
|
): void;
|
|
3089
3234
|
function generateKeyPair(
|
|
3090
3235
|
type: "x448",
|
|
3091
3236
|
options: X448KeyPairOptions<"der", "pem">,
|
|
3092
|
-
callback: (err: Error | null, publicKey:
|
|
3237
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3093
3238
|
): void;
|
|
3094
3239
|
function generateKeyPair(
|
|
3095
3240
|
type: "x448",
|
|
3096
3241
|
options: X448KeyPairOptions<"der", "der">,
|
|
3097
|
-
callback: (err: Error | null, publicKey:
|
|
3242
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3098
3243
|
): void;
|
|
3099
3244
|
function generateKeyPair(
|
|
3100
3245
|
type: "x448",
|
|
@@ -3109,23 +3254,133 @@ declare module "crypto" {
|
|
|
3109
3254
|
function generateKeyPair(
|
|
3110
3255
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3111
3256
|
options: MLDSAKeyPairOptions<"pem", "der">,
|
|
3112
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3257
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3113
3258
|
): void;
|
|
3114
3259
|
function generateKeyPair(
|
|
3115
3260
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3116
3261
|
options: MLDSAKeyPairOptions<"der", "pem">,
|
|
3117
|
-
callback: (err: Error | null, publicKey:
|
|
3262
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3118
3263
|
): void;
|
|
3119
3264
|
function generateKeyPair(
|
|
3120
3265
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3121
3266
|
options: MLDSAKeyPairOptions<"der", "der">,
|
|
3122
|
-
callback: (err: Error | null, publicKey:
|
|
3267
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3123
3268
|
): void;
|
|
3124
3269
|
function generateKeyPair(
|
|
3125
3270
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3126
3271
|
options: MLDSAKeyPairKeyObjectOptions | undefined,
|
|
3127
3272
|
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3128
3273
|
): void;
|
|
3274
|
+
function generateKeyPair(
|
|
3275
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3276
|
+
options: MLKEMKeyPairOptions<"pem", "pem">,
|
|
3277
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
3278
|
+
): void;
|
|
3279
|
+
function generateKeyPair(
|
|
3280
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3281
|
+
options: MLKEMKeyPairOptions<"pem", "der">,
|
|
3282
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3283
|
+
): void;
|
|
3284
|
+
function generateKeyPair(
|
|
3285
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3286
|
+
options: MLKEMKeyPairOptions<"der", "pem">,
|
|
3287
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3288
|
+
): void;
|
|
3289
|
+
function generateKeyPair(
|
|
3290
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3291
|
+
options: MLKEMKeyPairOptions<"der", "der">,
|
|
3292
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3293
|
+
): void;
|
|
3294
|
+
function generateKeyPair(
|
|
3295
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3296
|
+
options: MLKEMKeyPairKeyObjectOptions | undefined,
|
|
3297
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3298
|
+
): void;
|
|
3299
|
+
function generateKeyPair(
|
|
3300
|
+
type:
|
|
3301
|
+
| "slh-dsa-sha2-128f"
|
|
3302
|
+
| "slh-dsa-sha2-128s"
|
|
3303
|
+
| "slh-dsa-sha2-192f"
|
|
3304
|
+
| "slh-dsa-sha2-192s"
|
|
3305
|
+
| "slh-dsa-sha2-256f"
|
|
3306
|
+
| "slh-dsa-sha2-256s"
|
|
3307
|
+
| "slh-dsa-shake-128f"
|
|
3308
|
+
| "slh-dsa-shake-128s"
|
|
3309
|
+
| "slh-dsa-shake-192f"
|
|
3310
|
+
| "slh-dsa-shake-192s"
|
|
3311
|
+
| "slh-dsa-shake-256f"
|
|
3312
|
+
| "slh-dsa-shake-256s",
|
|
3313
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
3314
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
3315
|
+
): void;
|
|
3316
|
+
function generateKeyPair(
|
|
3317
|
+
type:
|
|
3318
|
+
| "slh-dsa-sha2-128f"
|
|
3319
|
+
| "slh-dsa-sha2-128s"
|
|
3320
|
+
| "slh-dsa-sha2-192f"
|
|
3321
|
+
| "slh-dsa-sha2-192s"
|
|
3322
|
+
| "slh-dsa-sha2-256f"
|
|
3323
|
+
| "slh-dsa-sha2-256s"
|
|
3324
|
+
| "slh-dsa-shake-128f"
|
|
3325
|
+
| "slh-dsa-shake-128s"
|
|
3326
|
+
| "slh-dsa-shake-192f"
|
|
3327
|
+
| "slh-dsa-shake-192s"
|
|
3328
|
+
| "slh-dsa-shake-256f"
|
|
3329
|
+
| "slh-dsa-shake-256s",
|
|
3330
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
3331
|
+
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
|
3332
|
+
): void;
|
|
3333
|
+
function generateKeyPair(
|
|
3334
|
+
type:
|
|
3335
|
+
| "slh-dsa-sha2-128f"
|
|
3336
|
+
| "slh-dsa-sha2-128s"
|
|
3337
|
+
| "slh-dsa-sha2-192f"
|
|
3338
|
+
| "slh-dsa-sha2-192s"
|
|
3339
|
+
| "slh-dsa-sha2-256f"
|
|
3340
|
+
| "slh-dsa-sha2-256s"
|
|
3341
|
+
| "slh-dsa-shake-128f"
|
|
3342
|
+
| "slh-dsa-shake-128s"
|
|
3343
|
+
| "slh-dsa-shake-192f"
|
|
3344
|
+
| "slh-dsa-shake-192s"
|
|
3345
|
+
| "slh-dsa-shake-256f"
|
|
3346
|
+
| "slh-dsa-shake-256s",
|
|
3347
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
3348
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
|
3349
|
+
): void;
|
|
3350
|
+
function generateKeyPair(
|
|
3351
|
+
type:
|
|
3352
|
+
| "slh-dsa-sha2-128f"
|
|
3353
|
+
| "slh-dsa-sha2-128s"
|
|
3354
|
+
| "slh-dsa-sha2-192f"
|
|
3355
|
+
| "slh-dsa-sha2-192s"
|
|
3356
|
+
| "slh-dsa-sha2-256f"
|
|
3357
|
+
| "slh-dsa-sha2-256s"
|
|
3358
|
+
| "slh-dsa-shake-128f"
|
|
3359
|
+
| "slh-dsa-shake-128s"
|
|
3360
|
+
| "slh-dsa-shake-192f"
|
|
3361
|
+
| "slh-dsa-shake-192s"
|
|
3362
|
+
| "slh-dsa-shake-256f"
|
|
3363
|
+
| "slh-dsa-shake-256s",
|
|
3364
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
3365
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
|
3366
|
+
): void;
|
|
3367
|
+
function generateKeyPair(
|
|
3368
|
+
type:
|
|
3369
|
+
| "slh-dsa-sha2-128f"
|
|
3370
|
+
| "slh-dsa-sha2-128s"
|
|
3371
|
+
| "slh-dsa-sha2-192f"
|
|
3372
|
+
| "slh-dsa-sha2-192s"
|
|
3373
|
+
| "slh-dsa-sha2-256f"
|
|
3374
|
+
| "slh-dsa-sha2-256s"
|
|
3375
|
+
| "slh-dsa-shake-128f"
|
|
3376
|
+
| "slh-dsa-shake-128s"
|
|
3377
|
+
| "slh-dsa-shake-192f"
|
|
3378
|
+
| "slh-dsa-shake-192s"
|
|
3379
|
+
| "slh-dsa-shake-256f"
|
|
3380
|
+
| "slh-dsa-shake-256s",
|
|
3381
|
+
options: SLHDSAKeyPairKeyObjectOptions | undefined,
|
|
3382
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3383
|
+
): void;
|
|
3129
3384
|
namespace generateKeyPair {
|
|
3130
3385
|
function __promisify__(
|
|
3131
3386
|
type: "rsa",
|
|
@@ -3139,21 +3394,21 @@ declare module "crypto" {
|
|
|
3139
3394
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
3140
3395
|
): Promise<{
|
|
3141
3396
|
publicKey: string;
|
|
3142
|
-
privateKey:
|
|
3397
|
+
privateKey: NonSharedBuffer;
|
|
3143
3398
|
}>;
|
|
3144
3399
|
function __promisify__(
|
|
3145
3400
|
type: "rsa",
|
|
3146
3401
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
3147
3402
|
): Promise<{
|
|
3148
|
-
publicKey:
|
|
3403
|
+
publicKey: NonSharedBuffer;
|
|
3149
3404
|
privateKey: string;
|
|
3150
3405
|
}>;
|
|
3151
3406
|
function __promisify__(
|
|
3152
3407
|
type: "rsa",
|
|
3153
3408
|
options: RSAKeyPairOptions<"der", "der">,
|
|
3154
3409
|
): Promise<{
|
|
3155
|
-
publicKey:
|
|
3156
|
-
privateKey:
|
|
3410
|
+
publicKey: NonSharedBuffer;
|
|
3411
|
+
privateKey: NonSharedBuffer;
|
|
3157
3412
|
}>;
|
|
3158
3413
|
function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3159
3414
|
function __promisify__(
|
|
@@ -3168,21 +3423,21 @@ declare module "crypto" {
|
|
|
3168
3423
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
3169
3424
|
): Promise<{
|
|
3170
3425
|
publicKey: string;
|
|
3171
|
-
privateKey:
|
|
3426
|
+
privateKey: NonSharedBuffer;
|
|
3172
3427
|
}>;
|
|
3173
3428
|
function __promisify__(
|
|
3174
3429
|
type: "rsa-pss",
|
|
3175
3430
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
3176
3431
|
): Promise<{
|
|
3177
|
-
publicKey:
|
|
3432
|
+
publicKey: NonSharedBuffer;
|
|
3178
3433
|
privateKey: string;
|
|
3179
3434
|
}>;
|
|
3180
3435
|
function __promisify__(
|
|
3181
3436
|
type: "rsa-pss",
|
|
3182
3437
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
3183
3438
|
): Promise<{
|
|
3184
|
-
publicKey:
|
|
3185
|
-
privateKey:
|
|
3439
|
+
publicKey: NonSharedBuffer;
|
|
3440
|
+
privateKey: NonSharedBuffer;
|
|
3186
3441
|
}>;
|
|
3187
3442
|
function __promisify__(
|
|
3188
3443
|
type: "rsa-pss",
|
|
@@ -3200,21 +3455,21 @@ declare module "crypto" {
|
|
|
3200
3455
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
3201
3456
|
): Promise<{
|
|
3202
3457
|
publicKey: string;
|
|
3203
|
-
privateKey:
|
|
3458
|
+
privateKey: NonSharedBuffer;
|
|
3204
3459
|
}>;
|
|
3205
3460
|
function __promisify__(
|
|
3206
3461
|
type: "dsa",
|
|
3207
3462
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
3208
3463
|
): Promise<{
|
|
3209
|
-
publicKey:
|
|
3464
|
+
publicKey: NonSharedBuffer;
|
|
3210
3465
|
privateKey: string;
|
|
3211
3466
|
}>;
|
|
3212
3467
|
function __promisify__(
|
|
3213
3468
|
type: "dsa",
|
|
3214
3469
|
options: DSAKeyPairOptions<"der", "der">,
|
|
3215
3470
|
): Promise<{
|
|
3216
|
-
publicKey:
|
|
3217
|
-
privateKey:
|
|
3471
|
+
publicKey: NonSharedBuffer;
|
|
3472
|
+
privateKey: NonSharedBuffer;
|
|
3218
3473
|
}>;
|
|
3219
3474
|
function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3220
3475
|
function __promisify__(
|
|
@@ -3229,21 +3484,21 @@ declare module "crypto" {
|
|
|
3229
3484
|
options: ECKeyPairOptions<"pem", "der">,
|
|
3230
3485
|
): Promise<{
|
|
3231
3486
|
publicKey: string;
|
|
3232
|
-
privateKey:
|
|
3487
|
+
privateKey: NonSharedBuffer;
|
|
3233
3488
|
}>;
|
|
3234
3489
|
function __promisify__(
|
|
3235
3490
|
type: "ec",
|
|
3236
3491
|
options: ECKeyPairOptions<"der", "pem">,
|
|
3237
3492
|
): Promise<{
|
|
3238
|
-
publicKey:
|
|
3493
|
+
publicKey: NonSharedBuffer;
|
|
3239
3494
|
privateKey: string;
|
|
3240
3495
|
}>;
|
|
3241
3496
|
function __promisify__(
|
|
3242
3497
|
type: "ec",
|
|
3243
3498
|
options: ECKeyPairOptions<"der", "der">,
|
|
3244
3499
|
): Promise<{
|
|
3245
|
-
publicKey:
|
|
3246
|
-
privateKey:
|
|
3500
|
+
publicKey: NonSharedBuffer;
|
|
3501
|
+
privateKey: NonSharedBuffer;
|
|
3247
3502
|
}>;
|
|
3248
3503
|
function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3249
3504
|
function __promisify__(
|
|
@@ -3258,21 +3513,21 @@ declare module "crypto" {
|
|
|
3258
3513
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
3259
3514
|
): Promise<{
|
|
3260
3515
|
publicKey: string;
|
|
3261
|
-
privateKey:
|
|
3516
|
+
privateKey: NonSharedBuffer;
|
|
3262
3517
|
}>;
|
|
3263
3518
|
function __promisify__(
|
|
3264
3519
|
type: "ed25519",
|
|
3265
3520
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
3266
3521
|
): Promise<{
|
|
3267
|
-
publicKey:
|
|
3522
|
+
publicKey: NonSharedBuffer;
|
|
3268
3523
|
privateKey: string;
|
|
3269
3524
|
}>;
|
|
3270
3525
|
function __promisify__(
|
|
3271
3526
|
type: "ed25519",
|
|
3272
3527
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
3273
3528
|
): Promise<{
|
|
3274
|
-
publicKey:
|
|
3275
|
-
privateKey:
|
|
3529
|
+
publicKey: NonSharedBuffer;
|
|
3530
|
+
privateKey: NonSharedBuffer;
|
|
3276
3531
|
}>;
|
|
3277
3532
|
function __promisify__(
|
|
3278
3533
|
type: "ed25519",
|
|
@@ -3290,21 +3545,21 @@ declare module "crypto" {
|
|
|
3290
3545
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
3291
3546
|
): Promise<{
|
|
3292
3547
|
publicKey: string;
|
|
3293
|
-
privateKey:
|
|
3548
|
+
privateKey: NonSharedBuffer;
|
|
3294
3549
|
}>;
|
|
3295
3550
|
function __promisify__(
|
|
3296
3551
|
type: "ed448",
|
|
3297
3552
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
3298
3553
|
): Promise<{
|
|
3299
|
-
publicKey:
|
|
3554
|
+
publicKey: NonSharedBuffer;
|
|
3300
3555
|
privateKey: string;
|
|
3301
3556
|
}>;
|
|
3302
3557
|
function __promisify__(
|
|
3303
3558
|
type: "ed448",
|
|
3304
3559
|
options: ED448KeyPairOptions<"der", "der">,
|
|
3305
3560
|
): Promise<{
|
|
3306
|
-
publicKey:
|
|
3307
|
-
privateKey:
|
|
3561
|
+
publicKey: NonSharedBuffer;
|
|
3562
|
+
privateKey: NonSharedBuffer;
|
|
3308
3563
|
}>;
|
|
3309
3564
|
function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3310
3565
|
function __promisify__(
|
|
@@ -3319,21 +3574,21 @@ declare module "crypto" {
|
|
|
3319
3574
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
3320
3575
|
): Promise<{
|
|
3321
3576
|
publicKey: string;
|
|
3322
|
-
privateKey:
|
|
3577
|
+
privateKey: NonSharedBuffer;
|
|
3323
3578
|
}>;
|
|
3324
3579
|
function __promisify__(
|
|
3325
3580
|
type: "x25519",
|
|
3326
3581
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
3327
3582
|
): Promise<{
|
|
3328
|
-
publicKey:
|
|
3583
|
+
publicKey: NonSharedBuffer;
|
|
3329
3584
|
privateKey: string;
|
|
3330
3585
|
}>;
|
|
3331
3586
|
function __promisify__(
|
|
3332
3587
|
type: "x25519",
|
|
3333
3588
|
options: X25519KeyPairOptions<"der", "der">,
|
|
3334
3589
|
): Promise<{
|
|
3335
|
-
publicKey:
|
|
3336
|
-
privateKey:
|
|
3590
|
+
publicKey: NonSharedBuffer;
|
|
3591
|
+
privateKey: NonSharedBuffer;
|
|
3337
3592
|
}>;
|
|
3338
3593
|
function __promisify__(
|
|
3339
3594
|
type: "x25519",
|
|
@@ -3351,21 +3606,21 @@ declare module "crypto" {
|
|
|
3351
3606
|
options: X448KeyPairOptions<"pem", "der">,
|
|
3352
3607
|
): Promise<{
|
|
3353
3608
|
publicKey: string;
|
|
3354
|
-
privateKey:
|
|
3609
|
+
privateKey: NonSharedBuffer;
|
|
3355
3610
|
}>;
|
|
3356
3611
|
function __promisify__(
|
|
3357
3612
|
type: "x448",
|
|
3358
3613
|
options: X448KeyPairOptions<"der", "pem">,
|
|
3359
3614
|
): Promise<{
|
|
3360
|
-
publicKey:
|
|
3615
|
+
publicKey: NonSharedBuffer;
|
|
3361
3616
|
privateKey: string;
|
|
3362
3617
|
}>;
|
|
3363
3618
|
function __promisify__(
|
|
3364
3619
|
type: "x448",
|
|
3365
3620
|
options: X448KeyPairOptions<"der", "der">,
|
|
3366
3621
|
): Promise<{
|
|
3367
|
-
publicKey:
|
|
3368
|
-
privateKey:
|
|
3622
|
+
publicKey: NonSharedBuffer;
|
|
3623
|
+
privateKey: NonSharedBuffer;
|
|
3369
3624
|
}>;
|
|
3370
3625
|
function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3371
3626
|
function __promisify__(
|
|
@@ -3380,26 +3635,150 @@ declare module "crypto" {
|
|
|
3380
3635
|
options: MLDSAKeyPairOptions<"pem", "der">,
|
|
3381
3636
|
): Promise<{
|
|
3382
3637
|
publicKey: string;
|
|
3383
|
-
privateKey:
|
|
3638
|
+
privateKey: NonSharedBuffer;
|
|
3384
3639
|
}>;
|
|
3385
3640
|
function __promisify__(
|
|
3386
3641
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3387
3642
|
options: MLDSAKeyPairOptions<"der", "pem">,
|
|
3388
3643
|
): Promise<{
|
|
3389
|
-
publicKey:
|
|
3644
|
+
publicKey: NonSharedBuffer;
|
|
3390
3645
|
privateKey: string;
|
|
3391
3646
|
}>;
|
|
3392
3647
|
function __promisify__(
|
|
3393
3648
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3394
3649
|
options: MLDSAKeyPairOptions<"der", "der">,
|
|
3395
3650
|
): Promise<{
|
|
3396
|
-
publicKey:
|
|
3397
|
-
privateKey:
|
|
3651
|
+
publicKey: NonSharedBuffer;
|
|
3652
|
+
privateKey: NonSharedBuffer;
|
|
3398
3653
|
}>;
|
|
3399
3654
|
function __promisify__(
|
|
3400
3655
|
type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
|
|
3401
3656
|
options?: MLDSAKeyPairKeyObjectOptions,
|
|
3402
3657
|
): Promise<KeyPairKeyObjectResult>;
|
|
3658
|
+
function __promisify__(
|
|
3659
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3660
|
+
options: MLKEMKeyPairOptions<"pem", "pem">,
|
|
3661
|
+
): Promise<{
|
|
3662
|
+
publicKey: string;
|
|
3663
|
+
privateKey: string;
|
|
3664
|
+
}>;
|
|
3665
|
+
function __promisify__(
|
|
3666
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3667
|
+
options: MLKEMKeyPairOptions<"pem", "der">,
|
|
3668
|
+
): Promise<{
|
|
3669
|
+
publicKey: string;
|
|
3670
|
+
privateKey: NonSharedBuffer;
|
|
3671
|
+
}>;
|
|
3672
|
+
function __promisify__(
|
|
3673
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3674
|
+
options: MLKEMKeyPairOptions<"der", "pem">,
|
|
3675
|
+
): Promise<{
|
|
3676
|
+
publicKey: NonSharedBuffer;
|
|
3677
|
+
privateKey: string;
|
|
3678
|
+
}>;
|
|
3679
|
+
function __promisify__(
|
|
3680
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3681
|
+
options: MLKEMKeyPairOptions<"der", "der">,
|
|
3682
|
+
): Promise<{
|
|
3683
|
+
publicKey: NonSharedBuffer;
|
|
3684
|
+
privateKey: NonSharedBuffer;
|
|
3685
|
+
}>;
|
|
3686
|
+
function __promisify__(
|
|
3687
|
+
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3688
|
+
options?: MLKEMKeyPairKeyObjectOptions,
|
|
3689
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3690
|
+
function __promisify__(
|
|
3691
|
+
type:
|
|
3692
|
+
| "slh-dsa-sha2-128f"
|
|
3693
|
+
| "slh-dsa-sha2-128s"
|
|
3694
|
+
| "slh-dsa-sha2-192f"
|
|
3695
|
+
| "slh-dsa-sha2-192s"
|
|
3696
|
+
| "slh-dsa-sha2-256f"
|
|
3697
|
+
| "slh-dsa-sha2-256s"
|
|
3698
|
+
| "slh-dsa-shake-128f"
|
|
3699
|
+
| "slh-dsa-shake-128s"
|
|
3700
|
+
| "slh-dsa-shake-192f"
|
|
3701
|
+
| "slh-dsa-shake-192s"
|
|
3702
|
+
| "slh-dsa-shake-256f"
|
|
3703
|
+
| "slh-dsa-shake-256s",
|
|
3704
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
3705
|
+
): Promise<{
|
|
3706
|
+
publicKey: string;
|
|
3707
|
+
privateKey: string;
|
|
3708
|
+
}>;
|
|
3709
|
+
function __promisify__(
|
|
3710
|
+
type:
|
|
3711
|
+
| "slh-dsa-sha2-128f"
|
|
3712
|
+
| "slh-dsa-sha2-128s"
|
|
3713
|
+
| "slh-dsa-sha2-192f"
|
|
3714
|
+
| "slh-dsa-sha2-192s"
|
|
3715
|
+
| "slh-dsa-sha2-256f"
|
|
3716
|
+
| "slh-dsa-sha2-256s"
|
|
3717
|
+
| "slh-dsa-shake-128f"
|
|
3718
|
+
| "slh-dsa-shake-128s"
|
|
3719
|
+
| "slh-dsa-shake-192f"
|
|
3720
|
+
| "slh-dsa-shake-192s"
|
|
3721
|
+
| "slh-dsa-shake-256f"
|
|
3722
|
+
| "slh-dsa-shake-256s",
|
|
3723
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
3724
|
+
): Promise<{
|
|
3725
|
+
publicKey: string;
|
|
3726
|
+
privateKey: Buffer;
|
|
3727
|
+
}>;
|
|
3728
|
+
function __promisify__(
|
|
3729
|
+
type:
|
|
3730
|
+
| "slh-dsa-sha2-128f"
|
|
3731
|
+
| "slh-dsa-sha2-128s"
|
|
3732
|
+
| "slh-dsa-sha2-192f"
|
|
3733
|
+
| "slh-dsa-sha2-192s"
|
|
3734
|
+
| "slh-dsa-sha2-256f"
|
|
3735
|
+
| "slh-dsa-sha2-256s"
|
|
3736
|
+
| "slh-dsa-shake-128f"
|
|
3737
|
+
| "slh-dsa-shake-128s"
|
|
3738
|
+
| "slh-dsa-shake-192f"
|
|
3739
|
+
| "slh-dsa-shake-192s"
|
|
3740
|
+
| "slh-dsa-shake-256f"
|
|
3741
|
+
| "slh-dsa-shake-256s",
|
|
3742
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
3743
|
+
): Promise<{
|
|
3744
|
+
publicKey: Buffer;
|
|
3745
|
+
privateKey: string;
|
|
3746
|
+
}>;
|
|
3747
|
+
function __promisify__(
|
|
3748
|
+
type:
|
|
3749
|
+
| "slh-dsa-sha2-128f"
|
|
3750
|
+
| "slh-dsa-sha2-128s"
|
|
3751
|
+
| "slh-dsa-sha2-192f"
|
|
3752
|
+
| "slh-dsa-sha2-192s"
|
|
3753
|
+
| "slh-dsa-sha2-256f"
|
|
3754
|
+
| "slh-dsa-sha2-256s"
|
|
3755
|
+
| "slh-dsa-shake-128f"
|
|
3756
|
+
| "slh-dsa-shake-128s"
|
|
3757
|
+
| "slh-dsa-shake-192f"
|
|
3758
|
+
| "slh-dsa-shake-192s"
|
|
3759
|
+
| "slh-dsa-shake-256f"
|
|
3760
|
+
| "slh-dsa-shake-256s",
|
|
3761
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
3762
|
+
): Promise<{
|
|
3763
|
+
publicKey: Buffer;
|
|
3764
|
+
privateKey: Buffer;
|
|
3765
|
+
}>;
|
|
3766
|
+
function __promisify__(
|
|
3767
|
+
type:
|
|
3768
|
+
| "slh-dsa-sha2-128f"
|
|
3769
|
+
| "slh-dsa-sha2-128s"
|
|
3770
|
+
| "slh-dsa-sha2-192f"
|
|
3771
|
+
| "slh-dsa-sha2-192s"
|
|
3772
|
+
| "slh-dsa-sha2-256f"
|
|
3773
|
+
| "slh-dsa-sha2-256s"
|
|
3774
|
+
| "slh-dsa-shake-128f"
|
|
3775
|
+
| "slh-dsa-shake-128s"
|
|
3776
|
+
| "slh-dsa-shake-192f"
|
|
3777
|
+
| "slh-dsa-shake-192s"
|
|
3778
|
+
| "slh-dsa-shake-256f"
|
|
3779
|
+
| "slh-dsa-shake-256s",
|
|
3780
|
+
options?: SLHDSAKeyPairKeyObjectOptions,
|
|
3781
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3403
3782
|
}
|
|
3404
3783
|
/**
|
|
3405
3784
|
* Calculates and returns the signature for `data` using the given private key and
|
|
@@ -3420,12 +3799,12 @@ declare module "crypto" {
|
|
|
3420
3799
|
algorithm: string | null | undefined,
|
|
3421
3800
|
data: NodeJS.ArrayBufferView,
|
|
3422
3801
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
3423
|
-
):
|
|
3802
|
+
): NonSharedBuffer;
|
|
3424
3803
|
function sign(
|
|
3425
3804
|
algorithm: string | null | undefined,
|
|
3426
3805
|
data: NodeJS.ArrayBufferView,
|
|
3427
3806
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
3428
|
-
callback: (error: Error | null, data:
|
|
3807
|
+
callback: (error: Error | null, data: NonSharedBuffer) => void,
|
|
3429
3808
|
): void;
|
|
3430
3809
|
/**
|
|
3431
3810
|
* Verifies the given signature for `data` using the given key and algorithm. If
|
|
@@ -3461,17 +3840,71 @@ declare module "crypto" {
|
|
|
3461
3840
|
callback: (error: Error | null, result: boolean) => void,
|
|
3462
3841
|
): void;
|
|
3463
3842
|
/**
|
|
3464
|
-
*
|
|
3465
|
-
*
|
|
3466
|
-
*
|
|
3843
|
+
* Key decapsulation using a KEM algorithm with a private key.
|
|
3844
|
+
*
|
|
3845
|
+
* Supported key types and their KEM algorithms are:
|
|
3846
|
+
*
|
|
3847
|
+
* * `'rsa'` RSA Secret Value Encapsulation
|
|
3848
|
+
* * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
|
|
3849
|
+
* * `'x25519'` DHKEM(X25519, HKDF-SHA256)
|
|
3850
|
+
* * `'x448'` DHKEM(X448, HKDF-SHA512)
|
|
3851
|
+
* * `'ml-kem-512'` ML-KEM
|
|
3852
|
+
* * `'ml-kem-768'` ML-KEM
|
|
3853
|
+
* * `'ml-kem-1024'` ML-KEM
|
|
3854
|
+
*
|
|
3855
|
+
* If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
|
|
3856
|
+
* passed to `crypto.createPrivateKey()`.
|
|
3857
|
+
*
|
|
3858
|
+
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3859
|
+
* @since v24.7.0
|
|
3860
|
+
*/
|
|
3861
|
+
function decapsulate(
|
|
3862
|
+
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3863
|
+
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3864
|
+
): NonSharedBuffer;
|
|
3865
|
+
function decapsulate(
|
|
3866
|
+
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3867
|
+
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3868
|
+
callback: (err: Error, sharedKey: NonSharedBuffer) => void,
|
|
3869
|
+
): void;
|
|
3870
|
+
/**
|
|
3871
|
+
* Computes the Diffie-Hellman shared secret based on a `privateKey` and a `publicKey`.
|
|
3872
|
+
* Both keys must have the same `asymmetricKeyType` and must support either the DH or
|
|
3873
|
+
* ECDH operation.
|
|
3467
3874
|
*
|
|
3468
3875
|
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3469
3876
|
* @since v13.9.0, v12.17.0
|
|
3470
3877
|
*/
|
|
3471
|
-
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }):
|
|
3878
|
+
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
|
|
3472
3879
|
function diffieHellman(
|
|
3473
3880
|
options: { privateKey: KeyObject; publicKey: KeyObject },
|
|
3474
|
-
callback: (err: Error | null, secret:
|
|
3881
|
+
callback: (err: Error | null, secret: NonSharedBuffer) => void,
|
|
3882
|
+
): void;
|
|
3883
|
+
/**
|
|
3884
|
+
* Key encapsulation using a KEM algorithm with a public key.
|
|
3885
|
+
*
|
|
3886
|
+
* Supported key types and their KEM algorithms are:
|
|
3887
|
+
*
|
|
3888
|
+
* * `'rsa'` RSA Secret Value Encapsulation
|
|
3889
|
+
* * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
|
|
3890
|
+
* * `'x25519'` DHKEM(X25519, HKDF-SHA256)
|
|
3891
|
+
* * `'x448'` DHKEM(X448, HKDF-SHA512)
|
|
3892
|
+
* * `'ml-kem-512'` ML-KEM
|
|
3893
|
+
* * `'ml-kem-768'` ML-KEM
|
|
3894
|
+
* * `'ml-kem-1024'` ML-KEM
|
|
3895
|
+
*
|
|
3896
|
+
* If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
|
|
3897
|
+
* passed to `crypto.createPublicKey()`.
|
|
3898
|
+
*
|
|
3899
|
+
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3900
|
+
* @since v24.7.0
|
|
3901
|
+
*/
|
|
3902
|
+
function encapsulate(
|
|
3903
|
+
key: KeyLike | PublicKeyInput | JsonWebKeyInput,
|
|
3904
|
+
): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer };
|
|
3905
|
+
function encapsulate(
|
|
3906
|
+
key: KeyLike | PublicKeyInput | JsonWebKeyInput,
|
|
3907
|
+
callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void,
|
|
3475
3908
|
): void;
|
|
3476
3909
|
interface OneShotDigestOptions {
|
|
3477
3910
|
/**
|
|
@@ -3536,12 +3969,12 @@ declare module "crypto" {
|
|
|
3536
3969
|
algorithm: string,
|
|
3537
3970
|
data: BinaryLike,
|
|
3538
3971
|
options: OneShotDigestOptionsWithBufferEncoding | "buffer",
|
|
3539
|
-
):
|
|
3972
|
+
): NonSharedBuffer;
|
|
3540
3973
|
function hash(
|
|
3541
3974
|
algorithm: string,
|
|
3542
3975
|
data: BinaryLike,
|
|
3543
3976
|
options: OneShotDigestOptions | BinaryToTextEncoding | "buffer",
|
|
3544
|
-
): string |
|
|
3977
|
+
): string | NonSharedBuffer;
|
|
3545
3978
|
type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
|
|
3546
3979
|
interface CipherInfoOptions {
|
|
3547
3980
|
/**
|
|
@@ -3705,23 +4138,23 @@ declare module "crypto" {
|
|
|
3705
4138
|
/**
|
|
3706
4139
|
* @default 'always'
|
|
3707
4140
|
*/
|
|
3708
|
-
subject?: "always" | "default" | "never";
|
|
4141
|
+
subject?: "always" | "default" | "never" | undefined;
|
|
3709
4142
|
/**
|
|
3710
4143
|
* @default true
|
|
3711
4144
|
*/
|
|
3712
|
-
wildcards?: boolean;
|
|
4145
|
+
wildcards?: boolean | undefined;
|
|
3713
4146
|
/**
|
|
3714
4147
|
* @default true
|
|
3715
4148
|
*/
|
|
3716
|
-
partialWildcards?: boolean;
|
|
4149
|
+
partialWildcards?: boolean | undefined;
|
|
3717
4150
|
/**
|
|
3718
4151
|
* @default false
|
|
3719
4152
|
*/
|
|
3720
|
-
multiLabelWildcards?: boolean;
|
|
4153
|
+
multiLabelWildcards?: boolean | undefined;
|
|
3721
4154
|
/**
|
|
3722
4155
|
* @default false
|
|
3723
4156
|
*/
|
|
3724
|
-
singleLabelSubdomains?: boolean;
|
|
4157
|
+
singleLabelSubdomains?: boolean | undefined;
|
|
3725
4158
|
}
|
|
3726
4159
|
/**
|
|
3727
4160
|
* Encapsulates an X509 certificate and provides read-only access to
|
|
@@ -3823,7 +4256,7 @@ declare module "crypto" {
|
|
|
3823
4256
|
* available.
|
|
3824
4257
|
* @since v15.9.0
|
|
3825
4258
|
*/
|
|
3826
|
-
readonly issuerCertificate
|
|
4259
|
+
readonly issuerCertificate: X509Certificate | undefined;
|
|
3827
4260
|
/**
|
|
3828
4261
|
* The public key `KeyObject` for this certificate.
|
|
3829
4262
|
* @since v15.6.0
|
|
@@ -3833,7 +4266,7 @@ declare module "crypto" {
|
|
|
3833
4266
|
* A `Buffer` containing the DER encoding of this certificate.
|
|
3834
4267
|
* @since v15.6.0
|
|
3835
4268
|
*/
|
|
3836
|
-
readonly raw:
|
|
4269
|
+
readonly raw: NonSharedBuffer;
|
|
3837
4270
|
/**
|
|
3838
4271
|
* The serial number of this certificate.
|
|
3839
4272
|
*
|
|
@@ -3843,6 +4276,16 @@ declare module "crypto" {
|
|
|
3843
4276
|
* @since v15.6.0
|
|
3844
4277
|
*/
|
|
3845
4278
|
readonly serialNumber: string;
|
|
4279
|
+
/**
|
|
4280
|
+
* The algorithm used to sign the certificate or `undefined` if the signature algorithm is unknown by OpenSSL.
|
|
4281
|
+
* @since v24.9.0
|
|
4282
|
+
*/
|
|
4283
|
+
readonly signatureAlgorithm: string | undefined;
|
|
4284
|
+
/**
|
|
4285
|
+
* The OID of the algorithm used to sign the certificate.
|
|
4286
|
+
* @since v24.9.0
|
|
4287
|
+
*/
|
|
4288
|
+
readonly signatureAlgorithmOid: string;
|
|
3846
4289
|
/**
|
|
3847
4290
|
* The date/time from which this certificate is considered valid.
|
|
3848
4291
|
* @since v15.6.0
|
|
@@ -4115,6 +4558,130 @@ declare module "crypto" {
|
|
|
4115
4558
|
* @return Returns `typedArray`.
|
|
4116
4559
|
*/
|
|
4117
4560
|
function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
|
|
4561
|
+
type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id";
|
|
4562
|
+
interface Argon2Parameters {
|
|
4563
|
+
/**
|
|
4564
|
+
* REQUIRED, this is the password for password hashing applications of Argon2.
|
|
4565
|
+
*/
|
|
4566
|
+
message: string | ArrayBuffer | NodeJS.ArrayBufferView;
|
|
4567
|
+
/**
|
|
4568
|
+
* REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.
|
|
4569
|
+
*/
|
|
4570
|
+
nonce: string | ArrayBuffer | NodeJS.ArrayBufferView;
|
|
4571
|
+
/**
|
|
4572
|
+
* REQUIRED, degree of parallelism determines how many computational chains (lanes)
|
|
4573
|
+
* can be run. Must be greater than 1 and less than `2**24-1`.
|
|
4574
|
+
*/
|
|
4575
|
+
parallelism: number;
|
|
4576
|
+
/**
|
|
4577
|
+
* REQUIRED, the length of the key to generate. Must be greater than 4 and
|
|
4578
|
+
* less than `2**32-1`.
|
|
4579
|
+
*/
|
|
4580
|
+
tagLength: number;
|
|
4581
|
+
/**
|
|
4582
|
+
* REQUIRED, memory cost in 1KiB blocks. Must be greater than
|
|
4583
|
+
* `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded
|
|
4584
|
+
* down to the nearest multiple of `4 * parallelism`.
|
|
4585
|
+
*/
|
|
4586
|
+
memory: number;
|
|
4587
|
+
/**
|
|
4588
|
+
* REQUIRED, number of passes (iterations). Must be greater than 1 and less
|
|
4589
|
+
* than `2**32-1`.
|
|
4590
|
+
*/
|
|
4591
|
+
passes: number;
|
|
4592
|
+
/**
|
|
4593
|
+
* OPTIONAL, Random additional input,
|
|
4594
|
+
* similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in
|
|
4595
|
+
* password hashing applications. If used, must have a length not greater than `2**32-1` bytes.
|
|
4596
|
+
*/
|
|
4597
|
+
secret?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
4598
|
+
/**
|
|
4599
|
+
* OPTIONAL, Additional data to
|
|
4600
|
+
* be added to the hash, functionally equivalent to salt or secret, but meant for
|
|
4601
|
+
* non-random data. If used, must have a length not greater than `2**32-1` bytes.
|
|
4602
|
+
*/
|
|
4603
|
+
associatedData?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
4604
|
+
}
|
|
4605
|
+
/**
|
|
4606
|
+
* Provides an asynchronous [Argon2](https://www.rfc-editor.org/rfc/rfc9106.html) implementation. Argon2 is a password-based
|
|
4607
|
+
* key derivation function that is designed to be expensive computationally and
|
|
4608
|
+
* memory-wise in order to make brute-force attacks unrewarding.
|
|
4609
|
+
*
|
|
4610
|
+
* The `nonce` should be as unique as possible. It is recommended that a nonce is
|
|
4611
|
+
* random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
|
|
4612
|
+
*
|
|
4613
|
+
* When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
|
|
4614
|
+
* consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
|
|
4615
|
+
*
|
|
4616
|
+
* The `callback` function is called with two arguments: `err` and `derivedKey`.
|
|
4617
|
+
* `err` is an exception object when key derivation fails, otherwise `err` is
|
|
4618
|
+
* `null`. `derivedKey` is passed to the callback as a `Buffer`.
|
|
4619
|
+
*
|
|
4620
|
+
* An exception is thrown when any of the input arguments specify invalid values
|
|
4621
|
+
* or types.
|
|
4622
|
+
*
|
|
4623
|
+
* ```js
|
|
4624
|
+
* const { argon2, randomBytes } = await import('node:crypto');
|
|
4625
|
+
*
|
|
4626
|
+
* const parameters = {
|
|
4627
|
+
* message: 'password',
|
|
4628
|
+
* nonce: randomBytes(16),
|
|
4629
|
+
* parallelism: 4,
|
|
4630
|
+
* tagLength: 64,
|
|
4631
|
+
* memory: 65536,
|
|
4632
|
+
* passes: 3,
|
|
4633
|
+
* };
|
|
4634
|
+
*
|
|
4635
|
+
* argon2('argon2id', parameters, (err, derivedKey) => {
|
|
4636
|
+
* if (err) throw err;
|
|
4637
|
+
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
4638
|
+
* });
|
|
4639
|
+
* ```
|
|
4640
|
+
* @since v24.7.0
|
|
4641
|
+
* @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
|
|
4642
|
+
* @experimental
|
|
4643
|
+
*/
|
|
4644
|
+
function argon2(
|
|
4645
|
+
algorithm: Argon2Algorithm,
|
|
4646
|
+
parameters: Argon2Parameters,
|
|
4647
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
4648
|
+
): void;
|
|
4649
|
+
/**
|
|
4650
|
+
* Provides a synchronous [Argon2][] implementation. Argon2 is a password-based
|
|
4651
|
+
* key derivation function that is designed to be expensive computationally and
|
|
4652
|
+
* memory-wise in order to make brute-force attacks unrewarding.
|
|
4653
|
+
*
|
|
4654
|
+
* The `nonce` should be as unique as possible. It is recommended that a nonce is
|
|
4655
|
+
* random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
|
|
4656
|
+
*
|
|
4657
|
+
* When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
|
|
4658
|
+
* consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
|
|
4659
|
+
*
|
|
4660
|
+
* An exception is thrown when key derivation fails, otherwise the derived key is
|
|
4661
|
+
* returned as a `Buffer`.
|
|
4662
|
+
*
|
|
4663
|
+
* An exception is thrown when any of the input arguments specify invalid values
|
|
4664
|
+
* or types.
|
|
4665
|
+
*
|
|
4666
|
+
* ```js
|
|
4667
|
+
* const { argon2Sync, randomBytes } = await import('node:crypto');
|
|
4668
|
+
*
|
|
4669
|
+
* const parameters = {
|
|
4670
|
+
* message: 'password',
|
|
4671
|
+
* nonce: randomBytes(16),
|
|
4672
|
+
* parallelism: 4,
|
|
4673
|
+
* tagLength: 64,
|
|
4674
|
+
* memory: 65536,
|
|
4675
|
+
* passes: 3,
|
|
4676
|
+
* };
|
|
4677
|
+
*
|
|
4678
|
+
* const derivedKey = argon2Sync('argon2id', parameters);
|
|
4679
|
+
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
4680
|
+
* ```
|
|
4681
|
+
* @since v24.7.0
|
|
4682
|
+
* @experimental
|
|
4683
|
+
*/
|
|
4684
|
+
function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
|
|
4118
4685
|
/**
|
|
4119
4686
|
* A convenient alias for `crypto.webcrypto.subtle`.
|
|
4120
4687
|
* @since v17.4.0
|
|
@@ -4129,21 +4696,30 @@ declare module "crypto" {
|
|
|
4129
4696
|
const webcrypto: webcrypto.Crypto;
|
|
4130
4697
|
namespace webcrypto {
|
|
4131
4698
|
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
4132
|
-
type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
|
|
4699
|
+
type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki";
|
|
4133
4700
|
type KeyType = "private" | "public" | "secret";
|
|
4134
4701
|
type KeyUsage =
|
|
4135
|
-
| "decrypt"
|
|
4136
|
-
| "deriveBits"
|
|
4137
|
-
| "deriveKey"
|
|
4138
4702
|
| "encrypt"
|
|
4703
|
+
| "decrypt"
|
|
4139
4704
|
| "sign"
|
|
4140
|
-
| "unwrapKey"
|
|
4141
4705
|
| "verify"
|
|
4142
|
-
| "
|
|
4706
|
+
| "deriveKey"
|
|
4707
|
+
| "deriveBits"
|
|
4708
|
+
| "encapsulateBits"
|
|
4709
|
+
| "decapsulateBits"
|
|
4710
|
+
| "encapsulateKey"
|
|
4711
|
+
| "decapsulateKey"
|
|
4712
|
+
| "wrapKey"
|
|
4713
|
+
| "unwrapKey";
|
|
4143
4714
|
type AlgorithmIdentifier = Algorithm | string;
|
|
4144
4715
|
type HashAlgorithmIdentifier = AlgorithmIdentifier;
|
|
4145
4716
|
type NamedCurve = string;
|
|
4146
4717
|
type BigInteger = Uint8Array;
|
|
4718
|
+
interface AeadParams extends Algorithm {
|
|
4719
|
+
additionalData?: BufferSource;
|
|
4720
|
+
iv: BufferSource;
|
|
4721
|
+
tagLength: number;
|
|
4722
|
+
}
|
|
4147
4723
|
interface AesCbcParams extends Algorithm {
|
|
4148
4724
|
iv: BufferSource;
|
|
4149
4725
|
}
|
|
@@ -4154,6 +4730,8 @@ declare module "crypto" {
|
|
|
4154
4730
|
interface AesDerivedKeyParams extends Algorithm {
|
|
4155
4731
|
length: number;
|
|
4156
4732
|
}
|
|
4733
|
+
// TODO: remove in next major
|
|
4734
|
+
/** @deprecated Replaced by `AeadParams`. */
|
|
4157
4735
|
interface AesGcmParams extends Algorithm {
|
|
4158
4736
|
additionalData?: BufferSource;
|
|
4159
4737
|
iv: BufferSource;
|
|
@@ -4168,6 +4746,23 @@ declare module "crypto" {
|
|
|
4168
4746
|
interface Algorithm {
|
|
4169
4747
|
name: string;
|
|
4170
4748
|
}
|
|
4749
|
+
interface Argon2Params extends Algorithm {
|
|
4750
|
+
associatedData?: BufferSource;
|
|
4751
|
+
memory: number;
|
|
4752
|
+
nonce: BufferSource;
|
|
4753
|
+
parallelism: number;
|
|
4754
|
+
passes: number;
|
|
4755
|
+
secretValue?: BufferSource;
|
|
4756
|
+
version?: number;
|
|
4757
|
+
}
|
|
4758
|
+
interface CShakeParams extends Algorithm {
|
|
4759
|
+
customization?: BufferSource;
|
|
4760
|
+
functionName?: BufferSource;
|
|
4761
|
+
length: number;
|
|
4762
|
+
}
|
|
4763
|
+
interface ContextParams extends Algorithm {
|
|
4764
|
+
context?: BufferSource;
|
|
4765
|
+
}
|
|
4171
4766
|
interface EcKeyAlgorithm extends KeyAlgorithm {
|
|
4172
4767
|
namedCurve: NamedCurve;
|
|
4173
4768
|
}
|
|
@@ -4183,9 +4778,6 @@ declare module "crypto" {
|
|
|
4183
4778
|
interface EcdsaParams extends Algorithm {
|
|
4184
4779
|
hash: HashAlgorithmIdentifier;
|
|
4185
4780
|
}
|
|
4186
|
-
interface Ed448Params extends Algorithm {
|
|
4187
|
-
context?: BufferSource;
|
|
4188
|
-
}
|
|
4189
4781
|
interface HkdfParams extends Algorithm {
|
|
4190
4782
|
hash: HashAlgorithmIdentifier;
|
|
4191
4783
|
info: BufferSource;
|
|
@@ -4226,6 +4818,19 @@ declare module "crypto" {
|
|
|
4226
4818
|
interface KeyAlgorithm {
|
|
4227
4819
|
name: string;
|
|
4228
4820
|
}
|
|
4821
|
+
interface KmacImportParams extends Algorithm {
|
|
4822
|
+
length?: number;
|
|
4823
|
+
}
|
|
4824
|
+
interface KmacKeyAlgorithm extends KeyAlgorithm {
|
|
4825
|
+
length: number;
|
|
4826
|
+
}
|
|
4827
|
+
interface KmacKeyGenParams extends Algorithm {
|
|
4828
|
+
length?: number;
|
|
4829
|
+
}
|
|
4830
|
+
interface KmacParams extends Algorithm {
|
|
4831
|
+
customization?: BufferSource;
|
|
4832
|
+
length: number;
|
|
4833
|
+
}
|
|
4229
4834
|
interface Pbkdf2Params extends Algorithm {
|
|
4230
4835
|
hash: HashAlgorithmIdentifier;
|
|
4231
4836
|
iterations: number;
|
|
@@ -4279,22 +4884,15 @@ declare module "crypto" {
|
|
|
4279
4884
|
* An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
|
|
4280
4885
|
* @since v15.0.0
|
|
4281
4886
|
*/
|
|
4282
|
-
getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(
|
|
4887
|
+
getRandomValues<T extends Exclude<NodeJS.TypedArray, Float16Array | Float32Array | Float64Array>>(
|
|
4888
|
+
typedArray: T,
|
|
4889
|
+
): T;
|
|
4283
4890
|
/**
|
|
4284
4891
|
* Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
|
|
4285
4892
|
* The UUID is generated using a cryptographic pseudorandom number generator.
|
|
4286
4893
|
* @since v16.7.0
|
|
4287
4894
|
*/
|
|
4288
4895
|
randomUUID(): UUID;
|
|
4289
|
-
CryptoKey: CryptoKeyConstructor;
|
|
4290
|
-
}
|
|
4291
|
-
// This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
|
|
4292
|
-
interface CryptoKeyConstructor {
|
|
4293
|
-
/** Illegal constructor */
|
|
4294
|
-
(_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
|
|
4295
|
-
readonly length: 0;
|
|
4296
|
-
readonly name: "CryptoKey";
|
|
4297
|
-
readonly prototype: CryptoKey;
|
|
4298
4896
|
}
|
|
4299
4897
|
/**
|
|
4300
4898
|
* @since v15.0.0
|
|
@@ -4349,31 +4947,81 @@ declare module "crypto" {
|
|
|
4349
4947
|
*/
|
|
4350
4948
|
publicKey: CryptoKey;
|
|
4351
4949
|
}
|
|
4950
|
+
interface EncapsulatedBits {
|
|
4951
|
+
sharedKey: ArrayBuffer;
|
|
4952
|
+
ciphertext: ArrayBuffer;
|
|
4953
|
+
}
|
|
4954
|
+
interface EncapsulatedKey {
|
|
4955
|
+
sharedKey: CryptoKey;
|
|
4956
|
+
ciphertext: ArrayBuffer;
|
|
4957
|
+
}
|
|
4352
4958
|
/**
|
|
4353
4959
|
* @since v15.0.0
|
|
4354
4960
|
*/
|
|
4355
4961
|
interface SubtleCrypto {
|
|
4962
|
+
/**
|
|
4963
|
+
* A message recipient uses their asymmetric private key to decrypt an
|
|
4964
|
+
* "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
|
|
4965
|
+
* key (represented as `ArrayBuffer`) which is then used to decrypt a message.
|
|
4966
|
+
*
|
|
4967
|
+
* The algorithms currently supported include:
|
|
4968
|
+
*
|
|
4969
|
+
* * `'ML-KEM-512'`
|
|
4970
|
+
* * `'ML-KEM-768'`
|
|
4971
|
+
* * `'ML-KEM-1024'`
|
|
4972
|
+
* @since v24.7.0
|
|
4973
|
+
* @returns Fulfills with `ArrayBuffer` upon success.
|
|
4974
|
+
*/
|
|
4975
|
+
decapsulateBits(
|
|
4976
|
+
decapsulationAlgorithm: AlgorithmIdentifier,
|
|
4977
|
+
decapsulationKey: CryptoKey,
|
|
4978
|
+
ciphertext: BufferSource,
|
|
4979
|
+
): Promise<ArrayBuffer>;
|
|
4980
|
+
/**
|
|
4981
|
+
* A message recipient uses their asymmetric private key to decrypt an
|
|
4982
|
+
* "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
|
|
4983
|
+
* key (represented as `CryptoKey`) which is then used to decrypt a message.
|
|
4984
|
+
*
|
|
4985
|
+
* The algorithms currently supported include:
|
|
4986
|
+
*
|
|
4987
|
+
* * `'ML-KEM-512'`
|
|
4988
|
+
* * `'ML-KEM-768'`
|
|
4989
|
+
* * `'ML-KEM-1024'`
|
|
4990
|
+
* @since v24.7.0
|
|
4991
|
+
* @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
|
|
4992
|
+
* @returns Fulfills with `CryptoKey` upon success.
|
|
4993
|
+
*/
|
|
4994
|
+
decapsulateKey(
|
|
4995
|
+
decapsulationAlgorithm: AlgorithmIdentifier,
|
|
4996
|
+
decapsulationKey: CryptoKey,
|
|
4997
|
+
ciphertext: BufferSource,
|
|
4998
|
+
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4999
|
+
extractable: boolean,
|
|
5000
|
+
usages: KeyUsage[],
|
|
5001
|
+
): Promise<CryptoKey>;
|
|
4356
5002
|
/**
|
|
4357
5003
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
4358
|
-
*
|
|
5004
|
+
* this method attempts to decipher the provided `data`. If successful,
|
|
4359
5005
|
* the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
|
|
4360
5006
|
*
|
|
4361
5007
|
* The algorithms currently supported include:
|
|
4362
5008
|
*
|
|
4363
|
-
*
|
|
4364
|
-
*
|
|
4365
|
-
*
|
|
4366
|
-
*
|
|
5009
|
+
* * `'AES-CBC'`
|
|
5010
|
+
* * `'AES-CTR'`
|
|
5011
|
+
* * `'AES-GCM'`
|
|
5012
|
+
* * `'AES-OCB'`
|
|
5013
|
+
* * `'ChaCha20-Poly1305'`
|
|
5014
|
+
* * `'RSA-OAEP'`
|
|
4367
5015
|
* @since v15.0.0
|
|
4368
5016
|
*/
|
|
4369
5017
|
decrypt(
|
|
4370
|
-
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
5018
|
+
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4371
5019
|
key: CryptoKey,
|
|
4372
5020
|
data: BufferSource,
|
|
4373
5021
|
): Promise<ArrayBuffer>;
|
|
4374
5022
|
/**
|
|
4375
5023
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
|
|
4376
|
-
*
|
|
5024
|
+
* this method attempts to generate `length` bits.
|
|
4377
5025
|
* The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
|
|
4378
5026
|
* When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
|
|
4379
5027
|
* for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
|
|
@@ -4381,11 +5029,14 @@ declare module "crypto" {
|
|
|
4381
5029
|
*
|
|
4382
5030
|
* The algorithms currently supported include:
|
|
4383
5031
|
*
|
|
4384
|
-
*
|
|
4385
|
-
*
|
|
4386
|
-
*
|
|
4387
|
-
*
|
|
4388
|
-
*
|
|
5032
|
+
* * `'Argon2d'`
|
|
5033
|
+
* * `'Argon2i'`
|
|
5034
|
+
* * `'Argon2id'`
|
|
5035
|
+
* * `'ECDH'`
|
|
5036
|
+
* * `'HKDF'`
|
|
5037
|
+
* * `'PBKDF2'`
|
|
5038
|
+
* * `'X25519'`
|
|
5039
|
+
* * `'X448'`
|
|
4389
5040
|
* @since v15.0.0
|
|
4390
5041
|
*/
|
|
4391
5042
|
deriveBits(
|
|
@@ -4394,31 +5045,34 @@ declare module "crypto" {
|
|
|
4394
5045
|
length?: number | null,
|
|
4395
5046
|
): Promise<ArrayBuffer>;
|
|
4396
5047
|
deriveBits(
|
|
4397
|
-
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
5048
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
|
|
4398
5049
|
baseKey: CryptoKey,
|
|
4399
5050
|
length: number,
|
|
4400
5051
|
): Promise<ArrayBuffer>;
|
|
4401
5052
|
/**
|
|
4402
5053
|
* Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
|
|
4403
|
-
*
|
|
5054
|
+
* this method attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
|
|
4404
5055
|
*
|
|
4405
5056
|
* Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
|
|
4406
5057
|
* then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
|
|
4407
5058
|
*
|
|
4408
5059
|
* The algorithms currently supported include:
|
|
4409
5060
|
*
|
|
4410
|
-
*
|
|
4411
|
-
*
|
|
4412
|
-
*
|
|
4413
|
-
*
|
|
4414
|
-
*
|
|
5061
|
+
* * `'Argon2d'`
|
|
5062
|
+
* * `'Argon2i'`
|
|
5063
|
+
* * `'Argon2id'`
|
|
5064
|
+
* * `'ECDH'`
|
|
5065
|
+
* * `'HKDF'`
|
|
5066
|
+
* * `'PBKDF2'`
|
|
5067
|
+
* * `'X25519'`
|
|
5068
|
+
* * `'X448'`
|
|
4415
5069
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4416
5070
|
* @since v15.0.0
|
|
4417
5071
|
*/
|
|
4418
5072
|
deriveKey(
|
|
4419
|
-
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
5073
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
|
|
4420
5074
|
baseKey: CryptoKey,
|
|
4421
|
-
derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
|
|
5075
|
+
derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4422
5076
|
extractable: boolean,
|
|
4423
5077
|
keyUsages: readonly KeyUsage[],
|
|
4424
5078
|
): Promise<CryptoKey>;
|
|
@@ -4428,30 +5082,73 @@ declare module "crypto" {
|
|
|
4428
5082
|
*
|
|
4429
5083
|
* If `algorithm` is provided as a `<string>`, it must be one of:
|
|
4430
5084
|
*
|
|
4431
|
-
*
|
|
4432
|
-
*
|
|
4433
|
-
*
|
|
4434
|
-
*
|
|
5085
|
+
* * `'cSHAKE128'`
|
|
5086
|
+
* * `'cSHAKE256'`
|
|
5087
|
+
* * `'SHA-1'`
|
|
5088
|
+
* * `'SHA-256'`
|
|
5089
|
+
* * `'SHA-384'`
|
|
5090
|
+
* * `'SHA-512'`
|
|
5091
|
+
* * `'SHA3-256'`
|
|
5092
|
+
* * `'SHA3-384'`
|
|
5093
|
+
* * `'SHA3-512'`
|
|
4435
5094
|
*
|
|
4436
5095
|
* If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
|
|
4437
5096
|
* @since v15.0.0
|
|
4438
5097
|
*/
|
|
4439
|
-
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
|
5098
|
+
digest(algorithm: AlgorithmIdentifier | CShakeParams, data: BufferSource): Promise<ArrayBuffer>;
|
|
5099
|
+
/**
|
|
5100
|
+
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5101
|
+
* This encrypted key is the "encapsulated key" represented as `EncapsulatedBits`.
|
|
5102
|
+
*
|
|
5103
|
+
* The algorithms currently supported include:
|
|
5104
|
+
*
|
|
5105
|
+
* * `'ML-KEM-512'`
|
|
5106
|
+
* * `'ML-KEM-768'`
|
|
5107
|
+
* * `'ML-KEM-1024'`
|
|
5108
|
+
* @since v24.7.0
|
|
5109
|
+
* @returns Fulfills with `EncapsulatedBits` upon success.
|
|
5110
|
+
*/
|
|
5111
|
+
encapsulateBits(
|
|
5112
|
+
encapsulationAlgorithm: AlgorithmIdentifier,
|
|
5113
|
+
encapsulationKey: CryptoKey,
|
|
5114
|
+
): Promise<EncapsulatedBits>;
|
|
5115
|
+
/**
|
|
5116
|
+
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5117
|
+
* This encrypted key is the "encapsulated key" represented as `EncapsulatedKey`.
|
|
5118
|
+
*
|
|
5119
|
+
* The algorithms currently supported include:
|
|
5120
|
+
*
|
|
5121
|
+
* * `'ML-KEM-512'`
|
|
5122
|
+
* * `'ML-KEM-768'`
|
|
5123
|
+
* * `'ML-KEM-1024'`
|
|
5124
|
+
* @since v24.7.0
|
|
5125
|
+
* @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
|
|
5126
|
+
* @returns Fulfills with `EncapsulatedKey` upon success.
|
|
5127
|
+
*/
|
|
5128
|
+
encapsulateKey(
|
|
5129
|
+
encapsulationAlgorithm: AlgorithmIdentifier,
|
|
5130
|
+
encapsulationKey: CryptoKey,
|
|
5131
|
+
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
5132
|
+
extractable: boolean,
|
|
5133
|
+
usages: KeyUsage[],
|
|
5134
|
+
): Promise<EncapsulatedKey>;
|
|
4440
5135
|
/**
|
|
4441
5136
|
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|
|
4442
|
-
*
|
|
5137
|
+
* this method attempts to encipher `data`. If successful,
|
|
4443
5138
|
* the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
|
|
4444
5139
|
*
|
|
4445
5140
|
* The algorithms currently supported include:
|
|
4446
5141
|
*
|
|
4447
|
-
*
|
|
4448
|
-
*
|
|
4449
|
-
*
|
|
4450
|
-
*
|
|
5142
|
+
* * `'AES-CBC'`
|
|
5143
|
+
* * `'AES-CTR'`
|
|
5144
|
+
* * `'AES-GCM'`
|
|
5145
|
+
* * `'AES-OCB'`
|
|
5146
|
+
* * `'ChaCha20-Poly1305'`
|
|
5147
|
+
* * `'RSA-OAEP'`
|
|
4451
5148
|
* @since v15.0.0
|
|
4452
5149
|
*/
|
|
4453
5150
|
encrypt(
|
|
4454
|
-
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
5151
|
+
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4455
5152
|
key: CryptoKey,
|
|
4456
5153
|
data: BufferSource,
|
|
4457
5154
|
): Promise<ArrayBuffer>;
|
|
@@ -4465,35 +5162,47 @@ declare module "crypto" {
|
|
|
4465
5162
|
*
|
|
4466
5163
|
* When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
|
|
4467
5164
|
* JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
|
|
4468
|
-
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`,
|
|
5165
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5166
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4469
5167
|
* @returns `<Promise>` containing `<ArrayBuffer>`.
|
|
4470
5168
|
* @since v15.0.0
|
|
4471
5169
|
*/
|
|
4472
5170
|
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
|
4473
5171
|
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
|
4474
5172
|
/**
|
|
4475
|
-
* Using the
|
|
4476
|
-
*
|
|
4477
|
-
*
|
|
5173
|
+
* Using the parameters provided in `algorithm`, this method
|
|
5174
|
+
* attempts to generate new keying material. Depending on the algorithm used
|
|
5175
|
+
* either a single `CryptoKey` or a `CryptoKeyPair` is generated.
|
|
4478
5176
|
*
|
|
4479
|
-
* The
|
|
5177
|
+
* The `CryptoKeyPair` (public and private key) generating algorithms supported
|
|
5178
|
+
* include:
|
|
4480
5179
|
*
|
|
4481
|
-
*
|
|
4482
|
-
*
|
|
4483
|
-
*
|
|
4484
|
-
*
|
|
4485
|
-
*
|
|
4486
|
-
*
|
|
4487
|
-
*
|
|
4488
|
-
*
|
|
4489
|
-
*
|
|
4490
|
-
*
|
|
5180
|
+
* * `'ECDH'`
|
|
5181
|
+
* * `'ECDSA'`
|
|
5182
|
+
* * `'Ed25519'`
|
|
5183
|
+
* * `'Ed448'`
|
|
5184
|
+
* * `'ML-DSA-44'`
|
|
5185
|
+
* * `'ML-DSA-65'`
|
|
5186
|
+
* * `'ML-DSA-87'`
|
|
5187
|
+
* * `'ML-KEM-512'`
|
|
5188
|
+
* * `'ML-KEM-768'`
|
|
5189
|
+
* * `'ML-KEM-1024'`
|
|
5190
|
+
* * `'RSA-OAEP'`
|
|
5191
|
+
* * `'RSA-PSS'`
|
|
5192
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
5193
|
+
* * `'X25519'`
|
|
5194
|
+
* * `'X448'`
|
|
4491
5195
|
*
|
|
4492
|
-
*
|
|
4493
|
-
*
|
|
4494
|
-
*
|
|
4495
|
-
*
|
|
4496
|
-
*
|
|
5196
|
+
* The `CryptoKey` (secret key) generating algorithms supported include:
|
|
5197
|
+
* * `'AES-CBC'`
|
|
5198
|
+
* * `'AES-CTR'`
|
|
5199
|
+
* * `'AES-GCM'`
|
|
5200
|
+
* * `'AES-KW'`
|
|
5201
|
+
* * `'AES-OCB'`
|
|
5202
|
+
* * `'ChaCha20-Poly1305'`
|
|
5203
|
+
* * `'HMAC'`
|
|
5204
|
+
* * `'KMAC128'`
|
|
5205
|
+
* * `'KMAC256'`
|
|
4497
5206
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4498
5207
|
* @since v15.0.0
|
|
4499
5208
|
*/
|
|
@@ -4503,7 +5212,7 @@ declare module "crypto" {
|
|
|
4503
5212
|
keyUsages: readonly KeyUsage[],
|
|
4504
5213
|
): Promise<CryptoKeyPair>;
|
|
4505
5214
|
generateKey(
|
|
4506
|
-
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
|
|
5215
|
+
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams,
|
|
4507
5216
|
extractable: boolean,
|
|
4508
5217
|
keyUsages: readonly KeyUsage[],
|
|
4509
5218
|
): Promise<CryptoKey>;
|
|
@@ -4513,12 +5222,23 @@ declare module "crypto" {
|
|
|
4513
5222
|
keyUsages: KeyUsage[],
|
|
4514
5223
|
): Promise<CryptoKeyPair | CryptoKey>;
|
|
4515
5224
|
/**
|
|
4516
|
-
*
|
|
4517
|
-
*
|
|
4518
|
-
*
|
|
5225
|
+
* Derives the public key from a given private key.
|
|
5226
|
+
* @since v24.7.0
|
|
5227
|
+
* @param key A private key from which to derive the corresponding public key.
|
|
5228
|
+
* @param keyUsages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
|
|
5229
|
+
* @returns Fulfills with a `CryptoKey` upon success.
|
|
5230
|
+
*/
|
|
5231
|
+
getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
5232
|
+
/**
|
|
5233
|
+
* This method attempts to interpret the provided `keyData`
|
|
5234
|
+
* as the given `format` to create a `CryptoKey` instance using the provided
|
|
5235
|
+
* `algorithm`, `extractable`, and `keyUsages` arguments. If the import is
|
|
5236
|
+
* successful, the returned promise will be resolved with a {CryptoKey}
|
|
5237
|
+
* representation of the key material.
|
|
4519
5238
|
*
|
|
4520
|
-
* If importing
|
|
4521
|
-
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`,
|
|
5239
|
+
* If importing KDF algorithm keys, `extractable` must be `false`.
|
|
5240
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5241
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4522
5242
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4523
5243
|
* @since v15.0.0
|
|
4524
5244
|
*/
|
|
@@ -4530,7 +5250,8 @@ declare module "crypto" {
|
|
|
4530
5250
|
| RsaHashedImportParams
|
|
4531
5251
|
| EcKeyImportParams
|
|
4532
5252
|
| HmacImportParams
|
|
4533
|
-
| AesKeyAlgorithm
|
|
5253
|
+
| AesKeyAlgorithm
|
|
5254
|
+
| KmacImportParams,
|
|
4534
5255
|
extractable: boolean,
|
|
4535
5256
|
keyUsages: readonly KeyUsage[],
|
|
4536
5257
|
): Promise<CryptoKey>;
|
|
@@ -4542,62 +5263,81 @@ declare module "crypto" {
|
|
|
4542
5263
|
| RsaHashedImportParams
|
|
4543
5264
|
| EcKeyImportParams
|
|
4544
5265
|
| HmacImportParams
|
|
4545
|
-
| AesKeyAlgorithm
|
|
5266
|
+
| AesKeyAlgorithm
|
|
5267
|
+
| KmacImportParams,
|
|
4546
5268
|
extractable: boolean,
|
|
4547
5269
|
keyUsages: KeyUsage[],
|
|
4548
5270
|
): Promise<CryptoKey>;
|
|
4549
5271
|
/**
|
|
4550
5272
|
* Using the method and parameters given by `algorithm` and the keying material provided by `key`,
|
|
4551
|
-
*
|
|
5273
|
+
* this method attempts to generate a cryptographic signature of `data`. If successful,
|
|
4552
5274
|
* the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
|
|
4553
5275
|
*
|
|
4554
5276
|
* The algorithms currently supported include:
|
|
4555
5277
|
*
|
|
4556
|
-
*
|
|
4557
|
-
*
|
|
4558
|
-
*
|
|
4559
|
-
*
|
|
4560
|
-
*
|
|
4561
|
-
*
|
|
5278
|
+
* * `'ECDSA'`
|
|
5279
|
+
* * `'Ed25519'`
|
|
5280
|
+
* * `'Ed448'`
|
|
5281
|
+
* * `'HMAC'`
|
|
5282
|
+
* * `'KMAC128'`
|
|
5283
|
+
* * `'KMAC256'`
|
|
5284
|
+
* * `'ML-DSA-44'`
|
|
5285
|
+
* * `'ML-DSA-65'`
|
|
5286
|
+
* * `'ML-DSA-87'`
|
|
5287
|
+
* * `'RSA-PSS'`
|
|
5288
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
4562
5289
|
* @since v15.0.0
|
|
4563
5290
|
*/
|
|
4564
5291
|
sign(
|
|
4565
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
5292
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
|
|
4566
5293
|
key: CryptoKey,
|
|
4567
5294
|
data: BufferSource,
|
|
4568
5295
|
): Promise<ArrayBuffer>;
|
|
4569
5296
|
/**
|
|
4570
5297
|
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
4571
|
-
*
|
|
5298
|
+
* This method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
|
|
4572
5299
|
* It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
|
|
4573
5300
|
* then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
|
|
4574
5301
|
* If successful, the returned promise is resolved with a `<CryptoKey>` object.
|
|
4575
5302
|
*
|
|
4576
5303
|
* The wrapping algorithms currently supported include:
|
|
4577
5304
|
*
|
|
4578
|
-
*
|
|
4579
|
-
*
|
|
4580
|
-
*
|
|
4581
|
-
*
|
|
4582
|
-
*
|
|
5305
|
+
* * `'AES-CBC'`
|
|
5306
|
+
* * `'AES-CTR'`
|
|
5307
|
+
* * `'AES-GCM'`
|
|
5308
|
+
* * `'AES-KW'`
|
|
5309
|
+
* * `'AES-OCB'`
|
|
5310
|
+
* * `'ChaCha20-Poly1305'`
|
|
5311
|
+
* * `'RSA-OAEP'`
|
|
4583
5312
|
*
|
|
4584
5313
|
* The unwrapped key algorithms supported include:
|
|
4585
5314
|
*
|
|
4586
|
-
*
|
|
4587
|
-
*
|
|
4588
|
-
*
|
|
4589
|
-
*
|
|
4590
|
-
*
|
|
4591
|
-
*
|
|
4592
|
-
*
|
|
4593
|
-
*
|
|
4594
|
-
*
|
|
4595
|
-
*
|
|
4596
|
-
*
|
|
4597
|
-
*
|
|
4598
|
-
*
|
|
4599
|
-
*
|
|
4600
|
-
*
|
|
5315
|
+
* * `'AES-CBC'`
|
|
5316
|
+
* * `'AES-CTR'`
|
|
5317
|
+
* * `'AES-GCM'`
|
|
5318
|
+
* * `'AES-KW'`
|
|
5319
|
+
* * `'AES-OCB'`
|
|
5320
|
+
* * `'ChaCha20-Poly1305'`
|
|
5321
|
+
* * `'ECDH'`
|
|
5322
|
+
* * `'ECDSA'`
|
|
5323
|
+
* * `'Ed25519'`
|
|
5324
|
+
* * `'Ed448'`
|
|
5325
|
+
* * `'HMAC'`
|
|
5326
|
+
* * `'KMAC128'`
|
|
5327
|
+
* * `'KMAC256'`
|
|
5328
|
+
* * `'ML-DSA-44'`
|
|
5329
|
+
* * `'ML-DSA-65'`
|
|
5330
|
+
* * `'ML-DSA-87'`
|
|
5331
|
+
* * `'ML-KEM-512'`
|
|
5332
|
+
* * `'ML-KEM-768'`
|
|
5333
|
+
* * `'ML-KEM-1024'`
|
|
5334
|
+
* * `'RSA-OAEP'`
|
|
5335
|
+
* * `'RSA-PSS'`
|
|
5336
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
5337
|
+
* * `'X25519'`
|
|
5338
|
+
* * `'X448'`
|
|
5339
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5340
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4601
5341
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4602
5342
|
* @since v15.0.0
|
|
4603
5343
|
*/
|
|
@@ -4605,40 +5345,46 @@ declare module "crypto" {
|
|
|
4605
5345
|
format: KeyFormat,
|
|
4606
5346
|
wrappedKey: BufferSource,
|
|
4607
5347
|
unwrappingKey: CryptoKey,
|
|
4608
|
-
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
5348
|
+
unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4609
5349
|
unwrappedKeyAlgorithm:
|
|
4610
5350
|
| AlgorithmIdentifier
|
|
4611
5351
|
| RsaHashedImportParams
|
|
4612
5352
|
| EcKeyImportParams
|
|
4613
5353
|
| HmacImportParams
|
|
4614
|
-
| AesKeyAlgorithm
|
|
5354
|
+
| AesKeyAlgorithm
|
|
5355
|
+
| KmacImportParams,
|
|
4615
5356
|
extractable: boolean,
|
|
4616
5357
|
keyUsages: KeyUsage[],
|
|
4617
5358
|
): Promise<CryptoKey>;
|
|
4618
5359
|
/**
|
|
4619
5360
|
* Using the method and parameters given in `algorithm` and the keying material provided by `key`,
|
|
4620
|
-
*
|
|
5361
|
+
* This method attempts to verify that `signature` is a valid cryptographic signature of `data`.
|
|
4621
5362
|
* The returned promise is resolved with either `true` or `false`.
|
|
4622
5363
|
*
|
|
4623
5364
|
* The algorithms currently supported include:
|
|
4624
5365
|
*
|
|
4625
|
-
*
|
|
4626
|
-
*
|
|
4627
|
-
*
|
|
4628
|
-
*
|
|
4629
|
-
*
|
|
4630
|
-
*
|
|
5366
|
+
* * `'ECDSA'`
|
|
5367
|
+
* * `'Ed25519'`
|
|
5368
|
+
* * `'Ed448'`
|
|
5369
|
+
* * `'HMAC'`
|
|
5370
|
+
* * `'KMAC128'`
|
|
5371
|
+
* * `'KMAC256'`
|
|
5372
|
+
* * `'ML-DSA-44'`
|
|
5373
|
+
* * `'ML-DSA-65'`
|
|
5374
|
+
* * `'ML-DSA-87'`
|
|
5375
|
+
* * `'RSA-PSS'`
|
|
5376
|
+
* * `'RSASSA-PKCS1-v1_5'`
|
|
4631
5377
|
* @since v15.0.0
|
|
4632
5378
|
*/
|
|
4633
5379
|
verify(
|
|
4634
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
5380
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
|
|
4635
5381
|
key: CryptoKey,
|
|
4636
5382
|
signature: BufferSource,
|
|
4637
5383
|
data: BufferSource,
|
|
4638
5384
|
): Promise<boolean>;
|
|
4639
5385
|
/**
|
|
4640
5386
|
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
4641
|
-
*
|
|
5387
|
+
* This method exports the keying material into the format identified by `format`,
|
|
4642
5388
|
* then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
|
|
4643
5389
|
* It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
|
|
4644
5390
|
* then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
|
|
@@ -4646,30 +5392,25 @@ declare module "crypto" {
|
|
|
4646
5392
|
*
|
|
4647
5393
|
* The wrapping algorithms currently supported include:
|
|
4648
5394
|
*
|
|
4649
|
-
*
|
|
4650
|
-
*
|
|
4651
|
-
*
|
|
4652
|
-
*
|
|
4653
|
-
*
|
|
4654
|
-
*
|
|
5395
|
+
* * `'AES-CBC'`
|
|
5396
|
+
* * `'AES-CTR'`
|
|
5397
|
+
* * `'AES-GCM'`
|
|
5398
|
+
* * `'AES-KW'`
|
|
5399
|
+
* * `'AES-OCB'`
|
|
5400
|
+
* * `'ChaCha20-Poly1305'`
|
|
5401
|
+
* * `'RSA-OAEP'`
|
|
5402
|
+
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
5403
|
+
* `'raw-public'`, or `'raw-seed'`.
|
|
4655
5404
|
* @since v15.0.0
|
|
4656
5405
|
*/
|
|
4657
5406
|
wrapKey(
|
|
4658
5407
|
format: KeyFormat,
|
|
4659
5408
|
key: CryptoKey,
|
|
4660
5409
|
wrappingKey: CryptoKey,
|
|
4661
|
-
wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams |
|
|
5410
|
+
wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
4662
5411
|
): Promise<ArrayBuffer>;
|
|
4663
5412
|
}
|
|
4664
5413
|
}
|
|
4665
|
-
|
|
4666
|
-
global {
|
|
4667
|
-
var crypto: typeof globalThis extends {
|
|
4668
|
-
crypto: infer T;
|
|
4669
|
-
onmessage: any;
|
|
4670
|
-
} ? T
|
|
4671
|
-
: webcrypto.Crypto;
|
|
4672
|
-
}
|
|
4673
5414
|
}
|
|
4674
5415
|
declare module "node:crypto" {
|
|
4675
5416
|
export * from "crypto";
|