@types/node 24.7.2 → 24.8.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.
- node/README.md +1 -1
- node/crypto.d.ts +356 -25
- node/diagnostics_channel.d.ts +0 -2
- node/http2.d.ts +144 -26
- node/package.json +2 -2
- node/sea.d.ts +9 -0
- node/stream.d.ts +9 -1
- node/v8.d.ts +16 -0
- node/vm.d.ts +128 -38
- node/worker_threads.d.ts +39 -1
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 16 Oct 2025 12:02:25 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node/crypto.d.ts
CHANGED
|
@@ -1310,6 +1310,7 @@ declare module "crypto" {
|
|
|
1310
1310
|
* @since v0.1.92
|
|
1311
1311
|
* @param options `stream.Writable` options
|
|
1312
1312
|
*/
|
|
1313
|
+
// TODO: signing algorithm type
|
|
1313
1314
|
function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
|
|
1314
1315
|
type DSAEncoding = "der" | "ieee-p1363";
|
|
1315
1316
|
interface SigningOptions {
|
|
@@ -1319,6 +1320,7 @@ declare module "crypto" {
|
|
|
1319
1320
|
padding?: number | undefined;
|
|
1320
1321
|
saltLength?: number | undefined;
|
|
1321
1322
|
dsaEncoding?: DSAEncoding | undefined;
|
|
1323
|
+
context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
1322
1324
|
}
|
|
1323
1325
|
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
1324
1326
|
interface SignKeyObjectInput extends SigningOptions {
|
|
@@ -2460,6 +2462,18 @@ declare module "crypto" {
|
|
|
2460
2462
|
| "ml-kem-768"
|
|
2461
2463
|
| "rsa-pss"
|
|
2462
2464
|
| "rsa"
|
|
2465
|
+
| "slh-dsa-sha2-128f"
|
|
2466
|
+
| "slh-dsa-sha2-128s"
|
|
2467
|
+
| "slh-dsa-sha2-192f"
|
|
2468
|
+
| "slh-dsa-sha2-192s"
|
|
2469
|
+
| "slh-dsa-sha2-256f"
|
|
2470
|
+
| "slh-dsa-sha2-256s"
|
|
2471
|
+
| "slh-dsa-shake-128f"
|
|
2472
|
+
| "slh-dsa-shake-128s"
|
|
2473
|
+
| "slh-dsa-shake-192f"
|
|
2474
|
+
| "slh-dsa-shake-192s"
|
|
2475
|
+
| "slh-dsa-shake-256f"
|
|
2476
|
+
| "slh-dsa-shake-256s"
|
|
2463
2477
|
| "x25519"
|
|
2464
2478
|
| "x448";
|
|
2465
2479
|
type KeyFormat = "pem" | "der" | "jwk";
|
|
@@ -2478,6 +2492,7 @@ declare module "crypto" {
|
|
|
2478
2492
|
interface X448KeyPairKeyObjectOptions {}
|
|
2479
2493
|
interface MLDSAKeyPairKeyObjectOptions {}
|
|
2480
2494
|
interface MLKEMKeyPairKeyObjectOptions {}
|
|
2495
|
+
interface SLHDSAKeyPairKeyObjectOptions {}
|
|
2481
2496
|
interface ECKeyPairKeyObjectOptions {
|
|
2482
2497
|
/**
|
|
2483
2498
|
* Name of the curve to use
|
|
@@ -2660,6 +2675,15 @@ declare module "crypto" {
|
|
|
2660
2675
|
type: "pkcs8";
|
|
2661
2676
|
};
|
|
2662
2677
|
}
|
|
2678
|
+
interface SLHDSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
2679
|
+
publicKeyEncoding: {
|
|
2680
|
+
type: "spki";
|
|
2681
|
+
format: PubF;
|
|
2682
|
+
};
|
|
2683
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
2684
|
+
type: "pkcs8";
|
|
2685
|
+
};
|
|
2686
|
+
}
|
|
2663
2687
|
interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
|
|
2664
2688
|
publicKey: T1;
|
|
2665
2689
|
privateKey: T2;
|
|
@@ -2882,6 +2906,86 @@ declare module "crypto" {
|
|
|
2882
2906
|
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
2883
2907
|
options?: MLKEMKeyPairKeyObjectOptions,
|
|
2884
2908
|
): KeyPairKeyObjectResult;
|
|
2909
|
+
function generateKeyPairSync(
|
|
2910
|
+
type:
|
|
2911
|
+
| "slh-dsa-sha2-128f"
|
|
2912
|
+
| "slh-dsa-sha2-128s"
|
|
2913
|
+
| "slh-dsa-sha2-192f"
|
|
2914
|
+
| "slh-dsa-sha2-192s"
|
|
2915
|
+
| "slh-dsa-sha2-256f"
|
|
2916
|
+
| "slh-dsa-sha2-256s"
|
|
2917
|
+
| "slh-dsa-shake-128f"
|
|
2918
|
+
| "slh-dsa-shake-128s"
|
|
2919
|
+
| "slh-dsa-shake-192f"
|
|
2920
|
+
| "slh-dsa-shake-192s"
|
|
2921
|
+
| "slh-dsa-shake-256f"
|
|
2922
|
+
| "slh-dsa-shake-256s",
|
|
2923
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
2924
|
+
): KeyPairSyncResult<string, string>;
|
|
2925
|
+
function generateKeyPairSync(
|
|
2926
|
+
type:
|
|
2927
|
+
| "slh-dsa-sha2-128f"
|
|
2928
|
+
| "slh-dsa-sha2-128s"
|
|
2929
|
+
| "slh-dsa-sha2-192f"
|
|
2930
|
+
| "slh-dsa-sha2-192s"
|
|
2931
|
+
| "slh-dsa-sha2-256f"
|
|
2932
|
+
| "slh-dsa-sha2-256s"
|
|
2933
|
+
| "slh-dsa-shake-128f"
|
|
2934
|
+
| "slh-dsa-shake-128s"
|
|
2935
|
+
| "slh-dsa-shake-192f"
|
|
2936
|
+
| "slh-dsa-shake-192s"
|
|
2937
|
+
| "slh-dsa-shake-256f"
|
|
2938
|
+
| "slh-dsa-shake-256s",
|
|
2939
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
2940
|
+
): KeyPairSyncResult<string, Buffer>;
|
|
2941
|
+
function generateKeyPairSync(
|
|
2942
|
+
type:
|
|
2943
|
+
| "slh-dsa-sha2-128f"
|
|
2944
|
+
| "slh-dsa-sha2-128s"
|
|
2945
|
+
| "slh-dsa-sha2-192f"
|
|
2946
|
+
| "slh-dsa-sha2-192s"
|
|
2947
|
+
| "slh-dsa-sha2-256f"
|
|
2948
|
+
| "slh-dsa-sha2-256s"
|
|
2949
|
+
| "slh-dsa-shake-128f"
|
|
2950
|
+
| "slh-dsa-shake-128s"
|
|
2951
|
+
| "slh-dsa-shake-192f"
|
|
2952
|
+
| "slh-dsa-shake-192s"
|
|
2953
|
+
| "slh-dsa-shake-256f"
|
|
2954
|
+
| "slh-dsa-shake-256s",
|
|
2955
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
2956
|
+
): KeyPairSyncResult<Buffer, string>;
|
|
2957
|
+
function generateKeyPairSync(
|
|
2958
|
+
type:
|
|
2959
|
+
| "slh-dsa-sha2-128f"
|
|
2960
|
+
| "slh-dsa-sha2-128s"
|
|
2961
|
+
| "slh-dsa-sha2-192f"
|
|
2962
|
+
| "slh-dsa-sha2-192s"
|
|
2963
|
+
| "slh-dsa-sha2-256f"
|
|
2964
|
+
| "slh-dsa-sha2-256s"
|
|
2965
|
+
| "slh-dsa-shake-128f"
|
|
2966
|
+
| "slh-dsa-shake-128s"
|
|
2967
|
+
| "slh-dsa-shake-192f"
|
|
2968
|
+
| "slh-dsa-shake-192s"
|
|
2969
|
+
| "slh-dsa-shake-256f"
|
|
2970
|
+
| "slh-dsa-shake-256s",
|
|
2971
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
2972
|
+
): KeyPairSyncResult<Buffer, Buffer>;
|
|
2973
|
+
function generateKeyPairSync(
|
|
2974
|
+
type:
|
|
2975
|
+
| "slh-dsa-sha2-128f"
|
|
2976
|
+
| "slh-dsa-sha2-128s"
|
|
2977
|
+
| "slh-dsa-sha2-192f"
|
|
2978
|
+
| "slh-dsa-sha2-192s"
|
|
2979
|
+
| "slh-dsa-sha2-256f"
|
|
2980
|
+
| "slh-dsa-sha2-256s"
|
|
2981
|
+
| "slh-dsa-shake-128f"
|
|
2982
|
+
| "slh-dsa-shake-128s"
|
|
2983
|
+
| "slh-dsa-shake-192f"
|
|
2984
|
+
| "slh-dsa-shake-192s"
|
|
2985
|
+
| "slh-dsa-shake-256f"
|
|
2986
|
+
| "slh-dsa-shake-256s",
|
|
2987
|
+
options?: SLHDSAKeyPairKeyObjectOptions,
|
|
2988
|
+
): KeyPairKeyObjectResult;
|
|
2885
2989
|
/**
|
|
2886
2990
|
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
2887
2991
|
* Ed25519, Ed448, X25519, X448, and DH are currently supported.
|
|
@@ -3172,6 +3276,91 @@ declare module "crypto" {
|
|
|
3172
3276
|
options: MLKEMKeyPairKeyObjectOptions | undefined,
|
|
3173
3277
|
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3174
3278
|
): void;
|
|
3279
|
+
function generateKeyPair(
|
|
3280
|
+
type:
|
|
3281
|
+
| "slh-dsa-sha2-128f"
|
|
3282
|
+
| "slh-dsa-sha2-128s"
|
|
3283
|
+
| "slh-dsa-sha2-192f"
|
|
3284
|
+
| "slh-dsa-sha2-192s"
|
|
3285
|
+
| "slh-dsa-sha2-256f"
|
|
3286
|
+
| "slh-dsa-sha2-256s"
|
|
3287
|
+
| "slh-dsa-shake-128f"
|
|
3288
|
+
| "slh-dsa-shake-128s"
|
|
3289
|
+
| "slh-dsa-shake-192f"
|
|
3290
|
+
| "slh-dsa-shake-192s"
|
|
3291
|
+
| "slh-dsa-shake-256f"
|
|
3292
|
+
| "slh-dsa-shake-256s",
|
|
3293
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
3294
|
+
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
|
3295
|
+
): void;
|
|
3296
|
+
function generateKeyPair(
|
|
3297
|
+
type:
|
|
3298
|
+
| "slh-dsa-sha2-128f"
|
|
3299
|
+
| "slh-dsa-sha2-128s"
|
|
3300
|
+
| "slh-dsa-sha2-192f"
|
|
3301
|
+
| "slh-dsa-sha2-192s"
|
|
3302
|
+
| "slh-dsa-sha2-256f"
|
|
3303
|
+
| "slh-dsa-sha2-256s"
|
|
3304
|
+
| "slh-dsa-shake-128f"
|
|
3305
|
+
| "slh-dsa-shake-128s"
|
|
3306
|
+
| "slh-dsa-shake-192f"
|
|
3307
|
+
| "slh-dsa-shake-192s"
|
|
3308
|
+
| "slh-dsa-shake-256f"
|
|
3309
|
+
| "slh-dsa-shake-256s",
|
|
3310
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
3311
|
+
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
|
3312
|
+
): void;
|
|
3313
|
+
function generateKeyPair(
|
|
3314
|
+
type:
|
|
3315
|
+
| "slh-dsa-sha2-128f"
|
|
3316
|
+
| "slh-dsa-sha2-128s"
|
|
3317
|
+
| "slh-dsa-sha2-192f"
|
|
3318
|
+
| "slh-dsa-sha2-192s"
|
|
3319
|
+
| "slh-dsa-sha2-256f"
|
|
3320
|
+
| "slh-dsa-sha2-256s"
|
|
3321
|
+
| "slh-dsa-shake-128f"
|
|
3322
|
+
| "slh-dsa-shake-128s"
|
|
3323
|
+
| "slh-dsa-shake-192f"
|
|
3324
|
+
| "slh-dsa-shake-192s"
|
|
3325
|
+
| "slh-dsa-shake-256f"
|
|
3326
|
+
| "slh-dsa-shake-256s",
|
|
3327
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
3328
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
|
3329
|
+
): void;
|
|
3330
|
+
function generateKeyPair(
|
|
3331
|
+
type:
|
|
3332
|
+
| "slh-dsa-sha2-128f"
|
|
3333
|
+
| "slh-dsa-sha2-128s"
|
|
3334
|
+
| "slh-dsa-sha2-192f"
|
|
3335
|
+
| "slh-dsa-sha2-192s"
|
|
3336
|
+
| "slh-dsa-sha2-256f"
|
|
3337
|
+
| "slh-dsa-sha2-256s"
|
|
3338
|
+
| "slh-dsa-shake-128f"
|
|
3339
|
+
| "slh-dsa-shake-128s"
|
|
3340
|
+
| "slh-dsa-shake-192f"
|
|
3341
|
+
| "slh-dsa-shake-192s"
|
|
3342
|
+
| "slh-dsa-shake-256f"
|
|
3343
|
+
| "slh-dsa-shake-256s",
|
|
3344
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
3345
|
+
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
|
3346
|
+
): void;
|
|
3347
|
+
function generateKeyPair(
|
|
3348
|
+
type:
|
|
3349
|
+
| "slh-dsa-sha2-128f"
|
|
3350
|
+
| "slh-dsa-sha2-128s"
|
|
3351
|
+
| "slh-dsa-sha2-192f"
|
|
3352
|
+
| "slh-dsa-sha2-192s"
|
|
3353
|
+
| "slh-dsa-sha2-256f"
|
|
3354
|
+
| "slh-dsa-sha2-256s"
|
|
3355
|
+
| "slh-dsa-shake-128f"
|
|
3356
|
+
| "slh-dsa-shake-128s"
|
|
3357
|
+
| "slh-dsa-shake-192f"
|
|
3358
|
+
| "slh-dsa-shake-192s"
|
|
3359
|
+
| "slh-dsa-shake-256f"
|
|
3360
|
+
| "slh-dsa-shake-256s",
|
|
3361
|
+
options: SLHDSAKeyPairKeyObjectOptions | undefined,
|
|
3362
|
+
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
|
3363
|
+
): void;
|
|
3175
3364
|
namespace generateKeyPair {
|
|
3176
3365
|
function __promisify__(
|
|
3177
3366
|
type: "rsa",
|
|
@@ -3478,6 +3667,98 @@ declare module "crypto" {
|
|
|
3478
3667
|
type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
|
|
3479
3668
|
options?: MLKEMKeyPairKeyObjectOptions,
|
|
3480
3669
|
): Promise<KeyPairKeyObjectResult>;
|
|
3670
|
+
function __promisify__(
|
|
3671
|
+
type:
|
|
3672
|
+
| "slh-dsa-sha2-128f"
|
|
3673
|
+
| "slh-dsa-sha2-128s"
|
|
3674
|
+
| "slh-dsa-sha2-192f"
|
|
3675
|
+
| "slh-dsa-sha2-192s"
|
|
3676
|
+
| "slh-dsa-sha2-256f"
|
|
3677
|
+
| "slh-dsa-sha2-256s"
|
|
3678
|
+
| "slh-dsa-shake-128f"
|
|
3679
|
+
| "slh-dsa-shake-128s"
|
|
3680
|
+
| "slh-dsa-shake-192f"
|
|
3681
|
+
| "slh-dsa-shake-192s"
|
|
3682
|
+
| "slh-dsa-shake-256f"
|
|
3683
|
+
| "slh-dsa-shake-256s",
|
|
3684
|
+
options: SLHDSAKeyPairOptions<"pem", "pem">,
|
|
3685
|
+
): Promise<{
|
|
3686
|
+
publicKey: string;
|
|
3687
|
+
privateKey: string;
|
|
3688
|
+
}>;
|
|
3689
|
+
function __promisify__(
|
|
3690
|
+
type:
|
|
3691
|
+
| "slh-dsa-sha2-128f"
|
|
3692
|
+
| "slh-dsa-sha2-128s"
|
|
3693
|
+
| "slh-dsa-sha2-192f"
|
|
3694
|
+
| "slh-dsa-sha2-192s"
|
|
3695
|
+
| "slh-dsa-sha2-256f"
|
|
3696
|
+
| "slh-dsa-sha2-256s"
|
|
3697
|
+
| "slh-dsa-shake-128f"
|
|
3698
|
+
| "slh-dsa-shake-128s"
|
|
3699
|
+
| "slh-dsa-shake-192f"
|
|
3700
|
+
| "slh-dsa-shake-192s"
|
|
3701
|
+
| "slh-dsa-shake-256f"
|
|
3702
|
+
| "slh-dsa-shake-256s",
|
|
3703
|
+
options: SLHDSAKeyPairOptions<"pem", "der">,
|
|
3704
|
+
): Promise<{
|
|
3705
|
+
publicKey: string;
|
|
3706
|
+
privateKey: Buffer;
|
|
3707
|
+
}>;
|
|
3708
|
+
function __promisify__(
|
|
3709
|
+
type:
|
|
3710
|
+
| "slh-dsa-sha2-128f"
|
|
3711
|
+
| "slh-dsa-sha2-128s"
|
|
3712
|
+
| "slh-dsa-sha2-192f"
|
|
3713
|
+
| "slh-dsa-sha2-192s"
|
|
3714
|
+
| "slh-dsa-sha2-256f"
|
|
3715
|
+
| "slh-dsa-sha2-256s"
|
|
3716
|
+
| "slh-dsa-shake-128f"
|
|
3717
|
+
| "slh-dsa-shake-128s"
|
|
3718
|
+
| "slh-dsa-shake-192f"
|
|
3719
|
+
| "slh-dsa-shake-192s"
|
|
3720
|
+
| "slh-dsa-shake-256f"
|
|
3721
|
+
| "slh-dsa-shake-256s",
|
|
3722
|
+
options: SLHDSAKeyPairOptions<"der", "pem">,
|
|
3723
|
+
): Promise<{
|
|
3724
|
+
publicKey: Buffer;
|
|
3725
|
+
privateKey: string;
|
|
3726
|
+
}>;
|
|
3727
|
+
function __promisify__(
|
|
3728
|
+
type:
|
|
3729
|
+
| "slh-dsa-sha2-128f"
|
|
3730
|
+
| "slh-dsa-sha2-128s"
|
|
3731
|
+
| "slh-dsa-sha2-192f"
|
|
3732
|
+
| "slh-dsa-sha2-192s"
|
|
3733
|
+
| "slh-dsa-sha2-256f"
|
|
3734
|
+
| "slh-dsa-sha2-256s"
|
|
3735
|
+
| "slh-dsa-shake-128f"
|
|
3736
|
+
| "slh-dsa-shake-128s"
|
|
3737
|
+
| "slh-dsa-shake-192f"
|
|
3738
|
+
| "slh-dsa-shake-192s"
|
|
3739
|
+
| "slh-dsa-shake-256f"
|
|
3740
|
+
| "slh-dsa-shake-256s",
|
|
3741
|
+
options: SLHDSAKeyPairOptions<"der", "der">,
|
|
3742
|
+
): Promise<{
|
|
3743
|
+
publicKey: Buffer;
|
|
3744
|
+
privateKey: Buffer;
|
|
3745
|
+
}>;
|
|
3746
|
+
function __promisify__(
|
|
3747
|
+
type:
|
|
3748
|
+
| "slh-dsa-sha2-128f"
|
|
3749
|
+
| "slh-dsa-sha2-128s"
|
|
3750
|
+
| "slh-dsa-sha2-192f"
|
|
3751
|
+
| "slh-dsa-sha2-192s"
|
|
3752
|
+
| "slh-dsa-sha2-256f"
|
|
3753
|
+
| "slh-dsa-sha2-256s"
|
|
3754
|
+
| "slh-dsa-shake-128f"
|
|
3755
|
+
| "slh-dsa-shake-128s"
|
|
3756
|
+
| "slh-dsa-shake-192f"
|
|
3757
|
+
| "slh-dsa-shake-192s"
|
|
3758
|
+
| "slh-dsa-shake-256f"
|
|
3759
|
+
| "slh-dsa-shake-256s",
|
|
3760
|
+
options?: SLHDSAKeyPairKeyObjectOptions,
|
|
3761
|
+
): Promise<KeyPairKeyObjectResult>;
|
|
3481
3762
|
}
|
|
3482
3763
|
/**
|
|
3483
3764
|
* Calculates and returns the signature for `data` using the given private key and
|
|
@@ -4433,6 +4714,15 @@ declare module "crypto" {
|
|
|
4433
4714
|
interface Algorithm {
|
|
4434
4715
|
name: string;
|
|
4435
4716
|
}
|
|
4717
|
+
interface Argon2Params extends Algorithm {
|
|
4718
|
+
associatedData?: BufferSource;
|
|
4719
|
+
memory: number;
|
|
4720
|
+
nonce: BufferSource;
|
|
4721
|
+
parallelism: number;
|
|
4722
|
+
passes: number;
|
|
4723
|
+
secretValue?: BufferSource;
|
|
4724
|
+
version?: number;
|
|
4725
|
+
}
|
|
4436
4726
|
interface CShakeParams extends Algorithm {
|
|
4437
4727
|
customization?: BufferSource;
|
|
4438
4728
|
functionName?: BufferSource;
|
|
@@ -4456,9 +4746,6 @@ declare module "crypto" {
|
|
|
4456
4746
|
interface EcdsaParams extends Algorithm {
|
|
4457
4747
|
hash: HashAlgorithmIdentifier;
|
|
4458
4748
|
}
|
|
4459
|
-
interface Ed448Params extends Algorithm {
|
|
4460
|
-
context?: BufferSource;
|
|
4461
|
-
}
|
|
4462
4749
|
interface HkdfParams extends Algorithm {
|
|
4463
4750
|
hash: HashAlgorithmIdentifier;
|
|
4464
4751
|
info: BufferSource;
|
|
@@ -4499,6 +4786,19 @@ declare module "crypto" {
|
|
|
4499
4786
|
interface KeyAlgorithm {
|
|
4500
4787
|
name: string;
|
|
4501
4788
|
}
|
|
4789
|
+
interface KmacImportParams extends Algorithm {
|
|
4790
|
+
length?: number;
|
|
4791
|
+
}
|
|
4792
|
+
interface KmacKeyAlgorithm extends KeyAlgorithm {
|
|
4793
|
+
length: number;
|
|
4794
|
+
}
|
|
4795
|
+
interface KmacKeyGenParams extends Algorithm {
|
|
4796
|
+
length?: number;
|
|
4797
|
+
}
|
|
4798
|
+
interface KmacParams extends Algorithm {
|
|
4799
|
+
customization?: BufferSource;
|
|
4800
|
+
length: number;
|
|
4801
|
+
}
|
|
4502
4802
|
interface Pbkdf2Params extends Algorithm {
|
|
4503
4803
|
hash: HashAlgorithmIdentifier;
|
|
4504
4804
|
iterations: number;
|
|
@@ -4628,6 +4928,10 @@ declare module "crypto" {
|
|
|
4628
4928
|
*/
|
|
4629
4929
|
interface SubtleCrypto {
|
|
4630
4930
|
/**
|
|
4931
|
+
* A message recipient uses their asymmetric private key to decrypt an
|
|
4932
|
+
* "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
|
|
4933
|
+
* key (represented as `ArrayBuffer`) which is then used to decrypt a message.
|
|
4934
|
+
*
|
|
4631
4935
|
* The algorithms currently supported include:
|
|
4632
4936
|
*
|
|
4633
4937
|
* * `'ML-KEM-512'`
|
|
@@ -4642,6 +4946,10 @@ declare module "crypto" {
|
|
|
4642
4946
|
ciphertext: BufferSource,
|
|
4643
4947
|
): Promise<ArrayBuffer>;
|
|
4644
4948
|
/**
|
|
4949
|
+
* A message recipient uses their asymmetric private key to decrypt an
|
|
4950
|
+
* "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
|
|
4951
|
+
* key (represented as `CryptoKey`) which is then used to decrypt a message.
|
|
4952
|
+
*
|
|
4645
4953
|
* The algorithms currently supported include:
|
|
4646
4954
|
*
|
|
4647
4955
|
* * `'ML-KEM-512'`
|
|
@@ -4655,13 +4963,13 @@ declare module "crypto" {
|
|
|
4655
4963
|
decapsulationAlgorithm: AlgorithmIdentifier,
|
|
4656
4964
|
decapsulationKey: CryptoKey,
|
|
4657
4965
|
ciphertext: BufferSource,
|
|
4658
|
-
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
|
|
4966
|
+
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4659
4967
|
extractable: boolean,
|
|
4660
4968
|
usages: KeyUsage[],
|
|
4661
4969
|
): Promise<CryptoKey>;
|
|
4662
4970
|
/**
|
|
4663
4971
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
4664
|
-
*
|
|
4972
|
+
* this method attempts to decipher the provided `data`. If successful,
|
|
4665
4973
|
* the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
|
|
4666
4974
|
*
|
|
4667
4975
|
* The algorithms currently supported include:
|
|
@@ -4681,7 +4989,7 @@ declare module "crypto" {
|
|
|
4681
4989
|
): Promise<ArrayBuffer>;
|
|
4682
4990
|
/**
|
|
4683
4991
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
|
|
4684
|
-
*
|
|
4992
|
+
* this method attempts to generate `length` bits.
|
|
4685
4993
|
* The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
|
|
4686
4994
|
* When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
|
|
4687
4995
|
* for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
|
|
@@ -4689,6 +4997,9 @@ declare module "crypto" {
|
|
|
4689
4997
|
*
|
|
4690
4998
|
* The algorithms currently supported include:
|
|
4691
4999
|
*
|
|
5000
|
+
* * `'Argon2d'`
|
|
5001
|
+
* * `'Argon2i'`
|
|
5002
|
+
* * `'Argon2id'`
|
|
4692
5003
|
* * `'ECDH'`
|
|
4693
5004
|
* * `'HKDF'`
|
|
4694
5005
|
* * `'PBKDF2'`
|
|
@@ -4702,19 +5013,22 @@ declare module "crypto" {
|
|
|
4702
5013
|
length?: number | null,
|
|
4703
5014
|
): Promise<ArrayBuffer>;
|
|
4704
5015
|
deriveBits(
|
|
4705
|
-
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
5016
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
|
|
4706
5017
|
baseKey: CryptoKey,
|
|
4707
5018
|
length: number,
|
|
4708
5019
|
): Promise<ArrayBuffer>;
|
|
4709
5020
|
/**
|
|
4710
5021
|
* Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
|
|
4711
|
-
*
|
|
5022
|
+
* this method attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
|
|
4712
5023
|
*
|
|
4713
5024
|
* Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
|
|
4714
5025
|
* then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
|
|
4715
5026
|
*
|
|
4716
5027
|
* The algorithms currently supported include:
|
|
4717
5028
|
*
|
|
5029
|
+
* * `'Argon2d'`
|
|
5030
|
+
* * `'Argon2i'`
|
|
5031
|
+
* * `'Argon2id'`
|
|
4718
5032
|
* * `'ECDH'`
|
|
4719
5033
|
* * `'HKDF'`
|
|
4720
5034
|
* * `'PBKDF2'`
|
|
@@ -4724,9 +5038,9 @@ declare module "crypto" {
|
|
|
4724
5038
|
* @since v15.0.0
|
|
4725
5039
|
*/
|
|
4726
5040
|
deriveKey(
|
|
4727
|
-
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
|
|
5041
|
+
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
|
|
4728
5042
|
baseKey: CryptoKey,
|
|
4729
|
-
derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
|
|
5043
|
+
derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4730
5044
|
extractable: boolean,
|
|
4731
5045
|
keyUsages: readonly KeyUsage[],
|
|
4732
5046
|
): Promise<CryptoKey>;
|
|
@@ -4751,6 +5065,9 @@ declare module "crypto" {
|
|
|
4751
5065
|
*/
|
|
4752
5066
|
digest(algorithm: AlgorithmIdentifier | CShakeParams, data: BufferSource): Promise<ArrayBuffer>;
|
|
4753
5067
|
/**
|
|
5068
|
+
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5069
|
+
* This encrypted key is the "encapsulated key" represented as `EncapsulatedBits`.
|
|
5070
|
+
*
|
|
4754
5071
|
* The algorithms currently supported include:
|
|
4755
5072
|
*
|
|
4756
5073
|
* * `'ML-KEM-512'`
|
|
@@ -4764,6 +5081,9 @@ declare module "crypto" {
|
|
|
4764
5081
|
encapsulationKey: CryptoKey,
|
|
4765
5082
|
): Promise<EncapsulatedBits>;
|
|
4766
5083
|
/**
|
|
5084
|
+
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5085
|
+
* This encrypted key is the "encapsulated key" represented as `EncapsulatedKey`.
|
|
5086
|
+
*
|
|
4767
5087
|
* The algorithms currently supported include:
|
|
4768
5088
|
*
|
|
4769
5089
|
* * `'ML-KEM-512'`
|
|
@@ -4776,13 +5096,13 @@ declare module "crypto" {
|
|
|
4776
5096
|
encapsulateKey(
|
|
4777
5097
|
encapsulationAlgorithm: AlgorithmIdentifier,
|
|
4778
5098
|
encapsulationKey: CryptoKey,
|
|
4779
|
-
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
|
|
5099
|
+
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4780
5100
|
extractable: boolean,
|
|
4781
5101
|
usages: KeyUsage[],
|
|
4782
5102
|
): Promise<EncapsulatedKey>;
|
|
4783
5103
|
/**
|
|
4784
5104
|
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|
|
4785
|
-
*
|
|
5105
|
+
* this method attempts to encipher `data`. If successful,
|
|
4786
5106
|
* the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
|
|
4787
5107
|
*
|
|
4788
5108
|
* The algorithms currently supported include:
|
|
@@ -4841,7 +5161,7 @@ declare module "crypto" {
|
|
|
4841
5161
|
* * `'X25519'`
|
|
4842
5162
|
* * `'X448'`
|
|
4843
5163
|
*
|
|
4844
|
-
* The
|
|
5164
|
+
* The `CryptoKey` (secret key) generating algorithms supported include:
|
|
4845
5165
|
* * `'AES-CBC'`
|
|
4846
5166
|
* * `'AES-CTR'`
|
|
4847
5167
|
* * `'AES-GCM'`
|
|
@@ -4849,6 +5169,8 @@ declare module "crypto" {
|
|
|
4849
5169
|
* * `'AES-OCB'`
|
|
4850
5170
|
* * `'ChaCha20-Poly1305'`
|
|
4851
5171
|
* * `'HMAC'`
|
|
5172
|
+
* * `'KMAC128'`
|
|
5173
|
+
* * `'KMAC256'`
|
|
4852
5174
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
4853
5175
|
* @since v15.0.0
|
|
4854
5176
|
*/
|
|
@@ -4858,7 +5180,7 @@ declare module "crypto" {
|
|
|
4858
5180
|
keyUsages: readonly KeyUsage[],
|
|
4859
5181
|
): Promise<CryptoKeyPair>;
|
|
4860
5182
|
generateKey(
|
|
4861
|
-
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
|
|
5183
|
+
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams,
|
|
4862
5184
|
extractable: boolean,
|
|
4863
5185
|
keyUsages: readonly KeyUsage[],
|
|
4864
5186
|
): Promise<CryptoKey>;
|
|
@@ -4880,7 +5202,7 @@ declare module "crypto" {
|
|
|
4880
5202
|
* to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
|
|
4881
5203
|
* If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
|
|
4882
5204
|
*
|
|
4883
|
-
* If importing
|
|
5205
|
+
* If importing KDF algorithm keys, `extractable` must be `false`.
|
|
4884
5206
|
* @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
|
|
4885
5207
|
* `'raw-public'`, or `'raw-seed'`.
|
|
4886
5208
|
* @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
|
|
@@ -4894,7 +5216,8 @@ declare module "crypto" {
|
|
|
4894
5216
|
| RsaHashedImportParams
|
|
4895
5217
|
| EcKeyImportParams
|
|
4896
5218
|
| HmacImportParams
|
|
4897
|
-
| AesKeyAlgorithm
|
|
5219
|
+
| AesKeyAlgorithm
|
|
5220
|
+
| KmacImportParams,
|
|
4898
5221
|
extractable: boolean,
|
|
4899
5222
|
keyUsages: readonly KeyUsage[],
|
|
4900
5223
|
): Promise<CryptoKey>;
|
|
@@ -4906,13 +5229,14 @@ declare module "crypto" {
|
|
|
4906
5229
|
| RsaHashedImportParams
|
|
4907
5230
|
| EcKeyImportParams
|
|
4908
5231
|
| HmacImportParams
|
|
4909
|
-
| AesKeyAlgorithm
|
|
5232
|
+
| AesKeyAlgorithm
|
|
5233
|
+
| KmacImportParams,
|
|
4910
5234
|
extractable: boolean,
|
|
4911
5235
|
keyUsages: KeyUsage[],
|
|
4912
5236
|
): Promise<CryptoKey>;
|
|
4913
5237
|
/**
|
|
4914
5238
|
* Using the method and parameters given by `algorithm` and the keying material provided by `key`,
|
|
4915
|
-
*
|
|
5239
|
+
* this method attempts to generate a cryptographic signature of `data`. If successful,
|
|
4916
5240
|
* the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
|
|
4917
5241
|
*
|
|
4918
5242
|
* The algorithms currently supported include:
|
|
@@ -4921,6 +5245,8 @@ declare module "crypto" {
|
|
|
4921
5245
|
* * `'Ed25519'`
|
|
4922
5246
|
* * `'Ed448'`
|
|
4923
5247
|
* * `'HMAC'`
|
|
5248
|
+
* * `'KMAC128'`
|
|
5249
|
+
* * `'KMAC256'`
|
|
4924
5250
|
* * `'ML-DSA-44'`
|
|
4925
5251
|
* * `'ML-DSA-65'`
|
|
4926
5252
|
* * `'ML-DSA-87'`
|
|
@@ -4929,13 +5255,13 @@ declare module "crypto" {
|
|
|
4929
5255
|
* @since v15.0.0
|
|
4930
5256
|
*/
|
|
4931
5257
|
sign(
|
|
4932
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
5258
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
|
|
4933
5259
|
key: CryptoKey,
|
|
4934
5260
|
data: BufferSource,
|
|
4935
5261
|
): Promise<ArrayBuffer>;
|
|
4936
5262
|
/**
|
|
4937
5263
|
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
4938
|
-
*
|
|
5264
|
+
* This method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
|
|
4939
5265
|
* It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
|
|
4940
5266
|
* then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
|
|
4941
5267
|
* If successful, the returned promise is resolved with a `<CryptoKey>` object.
|
|
@@ -4963,6 +5289,8 @@ declare module "crypto" {
|
|
|
4963
5289
|
* * `'Ed25519'`
|
|
4964
5290
|
* * `'Ed448'`
|
|
4965
5291
|
* * `'HMAC'`
|
|
5292
|
+
* * `'KMAC128'`
|
|
5293
|
+
* * `'KMAC256'`
|
|
4966
5294
|
* * `'ML-DSA-44'`
|
|
4967
5295
|
* * `'ML-DSA-65'`
|
|
4968
5296
|
* * `'ML-DSA-87'`
|
|
@@ -4989,21 +5317,24 @@ declare module "crypto" {
|
|
|
4989
5317
|
| RsaHashedImportParams
|
|
4990
5318
|
| EcKeyImportParams
|
|
4991
5319
|
| HmacImportParams
|
|
4992
|
-
| AesKeyAlgorithm
|
|
5320
|
+
| AesKeyAlgorithm
|
|
5321
|
+
| KmacImportParams,
|
|
4993
5322
|
extractable: boolean,
|
|
4994
5323
|
keyUsages: KeyUsage[],
|
|
4995
5324
|
): Promise<CryptoKey>;
|
|
4996
5325
|
/**
|
|
4997
5326
|
* Using the method and parameters given in `algorithm` and the keying material provided by `key`,
|
|
4998
|
-
*
|
|
5327
|
+
* This method attempts to verify that `signature` is a valid cryptographic signature of `data`.
|
|
4999
5328
|
* The returned promise is resolved with either `true` or `false`.
|
|
5000
5329
|
*
|
|
5001
5330
|
* The algorithms currently supported include:
|
|
5002
5331
|
*
|
|
5003
5332
|
* * `'ECDSA'`
|
|
5004
5333
|
* * `'Ed25519'`
|
|
5005
|
-
* * `'Ed448'`
|
|
5334
|
+
* * `'Ed448'`
|
|
5006
5335
|
* * `'HMAC'`
|
|
5336
|
+
* * `'KMAC128'`
|
|
5337
|
+
* * `'KMAC256'`
|
|
5007
5338
|
* * `'ML-DSA-44'`
|
|
5008
5339
|
* * `'ML-DSA-65'`
|
|
5009
5340
|
* * `'ML-DSA-87'`
|
|
@@ -5012,14 +5343,14 @@ declare module "crypto" {
|
|
|
5012
5343
|
* @since v15.0.0
|
|
5013
5344
|
*/
|
|
5014
5345
|
verify(
|
|
5015
|
-
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams |
|
|
5346
|
+
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
|
|
5016
5347
|
key: CryptoKey,
|
|
5017
5348
|
signature: BufferSource,
|
|
5018
5349
|
data: BufferSource,
|
|
5019
5350
|
): Promise<boolean>;
|
|
5020
5351
|
/**
|
|
5021
5352
|
* In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
|
|
5022
|
-
*
|
|
5353
|
+
* This method exports the keying material into the format identified by `format`,
|
|
5023
5354
|
* then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
|
|
5024
5355
|
* It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
|
|
5025
5356
|
* then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
|
node/diagnostics_channel.d.ts
CHANGED
|
@@ -189,7 +189,6 @@ declare module "diagnostics_channel" {
|
|
|
189
189
|
* });
|
|
190
190
|
* ```
|
|
191
191
|
* @since v15.1.0, v14.17.0
|
|
192
|
-
* @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)}
|
|
193
192
|
* @param onMessage The handler to receive channel messages
|
|
194
193
|
*/
|
|
195
194
|
subscribe(onMessage: ChannelListener): void;
|
|
@@ -210,7 +209,6 @@ declare module "diagnostics_channel" {
|
|
|
210
209
|
* channel.unsubscribe(onMessage);
|
|
211
210
|
* ```
|
|
212
211
|
* @since v15.1.0, v14.17.0
|
|
213
|
-
* @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)}
|
|
214
212
|
* @param onMessage The previous subscribed handler to remove
|
|
215
213
|
* @return `true` if the handler was found, `false` otherwise.
|
|
216
214
|
*/
|