@types/node 16.18.52 → 16.18.54

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.
Files changed (102) hide show
  1. node v16.18/README.md +1 -1
  2. node v16.18/assert/strict.d.ts +4 -4
  3. node v16.18/assert.d.ts +48 -24
  4. node v16.18/async_hooks.d.ts +10 -7
  5. node v16.18/buffer.d.ts +47 -24
  6. node v16.18/child_process.d.ts +262 -122
  7. node v16.18/cluster.d.ts +107 -89
  8. node v16.18/console.d.ts +7 -7
  9. node v16.18/constants.d.ts +12 -11
  10. node v16.18/crypto.d.ts +738 -267
  11. node v16.18/dgram.d.ts +81 -45
  12. node v16.18/diagnostics_channel.d.ts +3 -3
  13. node v16.18/dns/promises.d.ts +28 -25
  14. node v16.18/dns.d.ts +202 -61
  15. node v16.18/domain.d.ts +4 -4
  16. node v16.18/events.d.ts +15 -7
  17. node v16.18/fs/promises.d.ts +93 -64
  18. node v16.18/fs.d.ts +485 -290
  19. node v16.18/globals.d.ts +13 -13
  20. node v16.18/http.d.ts +177 -177
  21. node v16.18/http2.d.ts +628 -376
  22. node v16.18/https.d.ts +107 -105
  23. node v16.18/inspector.d.ts +3 -3
  24. node v16.18/module.d.ts +11 -8
  25. node v16.18/net.d.ts +106 -87
  26. node v16.18/os.d.ts +7 -7
  27. node v16.18/package.json +2 -2
  28. node v16.18/path.d.ts +13 -13
  29. node v16.18/perf_hooks.d.ts +17 -15
  30. node v16.18/process.d.ts +144 -124
  31. node v16.18/punycode.d.ts +3 -3
  32. node v16.18/querystring.d.ts +14 -4
  33. node v16.18/readline.d.ts +64 -54
  34. node v16.18/repl.d.ts +67 -61
  35. node v16.18/stream/consumers.d.ts +4 -4
  36. node v16.18/stream/promises.d.ts +56 -15
  37. node v16.18/stream/web.d.ts +19 -19
  38. node v16.18/stream.d.ts +314 -216
  39. node v16.18/string_decoder.d.ts +3 -3
  40. node v16.18/test.d.ts +2 -2
  41. node v16.18/timers/promises.d.ts +4 -4
  42. node v16.18/timers.d.ts +23 -8
  43. node v16.18/tls.d.ts +150 -71
  44. node v16.18/trace_events.d.ts +3 -3
  45. node v16.18/ts4.8/assert/strict.d.ts +4 -4
  46. node v16.18/ts4.8/assert.d.ts +48 -24
  47. node v16.18/ts4.8/async_hooks.d.ts +10 -7
  48. node v16.18/ts4.8/buffer.d.ts +47 -24
  49. node v16.18/ts4.8/child_process.d.ts +262 -122
  50. node v16.18/ts4.8/cluster.d.ts +107 -89
  51. node v16.18/ts4.8/console.d.ts +7 -7
  52. node v16.18/ts4.8/constants.d.ts +12 -11
  53. node v16.18/ts4.8/crypto.d.ts +738 -267
  54. node v16.18/ts4.8/dgram.d.ts +81 -45
  55. node v16.18/ts4.8/diagnostics_channel.d.ts +3 -3
  56. node v16.18/ts4.8/dns/promises.d.ts +28 -25
  57. node v16.18/ts4.8/dns.d.ts +202 -61
  58. node v16.18/ts4.8/domain.d.ts +4 -4
  59. node v16.18/ts4.8/events.d.ts +15 -7
  60. node v16.18/ts4.8/fs/promises.d.ts +93 -64
  61. node v16.18/ts4.8/fs.d.ts +485 -290
  62. node v16.18/ts4.8/globals.d.ts +13 -13
  63. node v16.18/ts4.8/http.d.ts +176 -176
  64. node v16.18/ts4.8/http2.d.ts +628 -376
  65. node v16.18/ts4.8/https.d.ts +107 -105
  66. node v16.18/ts4.8/inspector.d.ts +3 -3
  67. node v16.18/ts4.8/module.d.ts +11 -8
  68. node v16.18/ts4.8/net.d.ts +106 -87
  69. node v16.18/ts4.8/os.d.ts +7 -7
  70. node v16.18/ts4.8/path.d.ts +13 -13
  71. node v16.18/ts4.8/perf_hooks.d.ts +17 -15
  72. node v16.18/ts4.8/process.d.ts +144 -124
  73. node v16.18/ts4.8/punycode.d.ts +3 -3
  74. node v16.18/ts4.8/querystring.d.ts +14 -4
  75. node v16.18/ts4.8/readline.d.ts +64 -54
  76. node v16.18/ts4.8/repl.d.ts +67 -61
  77. node v16.18/ts4.8/stream/consumers.d.ts +4 -4
  78. node v16.18/ts4.8/stream/promises.d.ts +56 -15
  79. node v16.18/ts4.8/stream/web.d.ts +19 -19
  80. node v16.18/ts4.8/stream.d.ts +309 -214
  81. node v16.18/ts4.8/string_decoder.d.ts +3 -3
  82. node v16.18/ts4.8/test.d.ts +2 -2
  83. node v16.18/ts4.8/timers/promises.d.ts +4 -4
  84. node v16.18/ts4.8/timers.d.ts +23 -8
  85. node v16.18/ts4.8/tls.d.ts +150 -71
  86. node v16.18/ts4.8/trace_events.d.ts +3 -3
  87. node v16.18/ts4.8/tty.d.ts +10 -10
  88. node v16.18/ts4.8/url.d.ts +26 -14
  89. node v16.18/ts4.8/util.d.ts +122 -51
  90. node v16.18/ts4.8/v8.d.ts +4 -4
  91. node v16.18/ts4.8/vm.d.ts +18 -18
  92. node v16.18/ts4.8/wasi.d.ts +3 -3
  93. node v16.18/ts4.8/worker_threads.d.ts +77 -77
  94. node v16.18/ts4.8/zlib.d.ts +9 -9
  95. node v16.18/tty.d.ts +10 -10
  96. node v16.18/url.d.ts +26 -14
  97. node v16.18/util.d.ts +122 -51
  98. node v16.18/v8.d.ts +4 -4
  99. node v16.18/vm.d.ts +18 -18
  100. node v16.18/wasi.d.ts +3 -3
  101. node v16.18/worker_threads.d.ts +77 -77
  102. node v16.18/zlib.d.ts +9 -9
node v16.18/crypto.d.ts CHANGED
@@ -15,9 +15,9 @@
15
15
  * ```
16
16
  * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/crypto.js)
17
17
  */
18
- declare module 'node:crypto' {
19
- import * as stream from 'node:stream';
20
- import { PeerCertificate } from 'node:tls';
18
+ declare module "crypto" {
19
+ import * as stream from "node:stream";
20
+ import { PeerCertificate } from "node:tls";
21
21
  interface Certificate {
22
22
  /**
23
23
  * @deprecated
@@ -44,7 +44,7 @@ declare module 'node:crypto' {
44
44
  }
45
45
  const Certificate: Certificate & {
46
46
  /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
47
- new (): Certificate;
47
+ new(): Certificate;
48
48
  /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
49
49
  (): Certificate;
50
50
  /**
@@ -250,11 +250,11 @@ declare module 'node:crypto' {
250
250
  */
251
251
  function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
252
252
  // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
253
- type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex';
254
- type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
255
- type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
253
+ type BinaryToTextEncoding = "base64" | "base64url" | "hex";
254
+ type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "latin1";
255
+ type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
256
256
  type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
257
- type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
257
+ type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
258
258
  /**
259
259
  * The `Hash` class is a utility for creating hash digests of data. It can be
260
260
  * used in one of two ways:
@@ -473,15 +473,15 @@ declare module 'node:crypto' {
473
473
  digest(): Buffer;
474
474
  digest(encoding: BinaryToTextEncoding): string;
475
475
  }
476
- type KeyObjectType = 'secret' | 'public' | 'private';
476
+ type KeyObjectType = "secret" | "public" | "private";
477
477
  interface KeyExportOptions<T extends KeyFormat> {
478
- type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
478
+ type: "pkcs1" | "spki" | "pkcs8" | "sec1";
479
479
  format: T;
480
480
  cipher?: string | undefined;
481
481
  passphrase?: string | Buffer | undefined;
482
482
  }
483
483
  interface JwkKeyExportOptions {
484
- format: 'jwk';
484
+ format: "jwk";
485
485
  }
486
486
  interface JsonWebKey {
487
487
  crv?: string | undefined;
@@ -625,8 +625,8 @@ declare module 'node:crypto' {
625
625
  * PKCS#1 and SEC1 encryption.
626
626
  * @since v11.6.0
627
627
  */
628
- export(options: KeyExportOptions<'pem'>): string | Buffer;
629
- export(options?: KeyExportOptions<'der'>): Buffer;
628
+ export(options: KeyExportOptions<"pem">): string | Buffer;
629
+ export(options?: KeyExportOptions<"der">): Buffer;
630
630
  export(options?: JwkKeyExportOptions): JsonWebKey;
631
631
  /**
632
632
  * For secret keys, this property represents the size of the key in bytes. This
@@ -641,9 +641,9 @@ declare module 'node:crypto' {
641
641
  */
642
642
  type: KeyObjectType;
643
643
  }
644
- type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305';
645
- type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
646
- type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb';
644
+ type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305";
645
+ type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
646
+ type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
647
647
  type BinaryLike = string | NodeJS.ArrayBufferView;
648
648
  type CipherKey = BinaryLike | KeyObject;
649
649
  interface CipherCCMOptions extends stream.TransformOptions {
@@ -721,10 +721,30 @@ declare module 'node:crypto' {
721
721
  * @since v0.1.94
722
722
  * @param options `stream.transform` options
723
723
  */
724
- function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM;
725
- function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB;
726
- function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM;
727
- function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher;
724
+ function createCipheriv(
725
+ algorithm: CipherCCMTypes,
726
+ key: CipherKey,
727
+ iv: BinaryLike,
728
+ options: CipherCCMOptions,
729
+ ): CipherCCM;
730
+ function createCipheriv(
731
+ algorithm: CipherOCBTypes,
732
+ key: CipherKey,
733
+ iv: BinaryLike,
734
+ options: CipherOCBOptions,
735
+ ): CipherOCB;
736
+ function createCipheriv(
737
+ algorithm: CipherGCMTypes,
738
+ key: CipherKey,
739
+ iv: BinaryLike,
740
+ options?: CipherGCMOptions,
741
+ ): CipherGCM;
742
+ function createCipheriv(
743
+ algorithm: string,
744
+ key: CipherKey,
745
+ iv: BinaryLike | null,
746
+ options?: stream.TransformOptions,
747
+ ): Cipher;
728
748
  /**
729
749
  * Instances of the `Cipher` class are used to encrypt data. The class can be
730
750
  * used in one of two ways:
@@ -896,7 +916,7 @@ declare module 'node:crypto' {
896
916
  buffer: NodeJS.ArrayBufferView,
897
917
  options: {
898
918
  plaintextLength: number;
899
- }
919
+ },
900
920
  ): this;
901
921
  getAuthTag(): Buffer;
902
922
  }
@@ -905,7 +925,7 @@ declare module 'node:crypto' {
905
925
  buffer: NodeJS.ArrayBufferView,
906
926
  options?: {
907
927
  plaintextLength: number;
908
- }
928
+ },
909
929
  ): this;
910
930
  getAuthTag(): Buffer;
911
931
  }
@@ -914,7 +934,7 @@ declare module 'node:crypto' {
914
934
  buffer: NodeJS.ArrayBufferView,
915
935
  options?: {
916
936
  plaintextLength: number;
917
- }
937
+ },
918
938
  ): this;
919
939
  getAuthTag(): Buffer;
920
940
  }
@@ -972,10 +992,30 @@ declare module 'node:crypto' {
972
992
  * @since v0.1.94
973
993
  * @param options `stream.transform` options
974
994
  */
975
- function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM;
976
- function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB;
977
- function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
978
- function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
995
+ function createDecipheriv(
996
+ algorithm: CipherCCMTypes,
997
+ key: CipherKey,
998
+ iv: BinaryLike,
999
+ options: CipherCCMOptions,
1000
+ ): DecipherCCM;
1001
+ function createDecipheriv(
1002
+ algorithm: CipherOCBTypes,
1003
+ key: CipherKey,
1004
+ iv: BinaryLike,
1005
+ options: CipherOCBOptions,
1006
+ ): DecipherOCB;
1007
+ function createDecipheriv(
1008
+ algorithm: CipherGCMTypes,
1009
+ key: CipherKey,
1010
+ iv: BinaryLike,
1011
+ options?: CipherGCMOptions,
1012
+ ): DecipherGCM;
1013
+ function createDecipheriv(
1014
+ algorithm: string,
1015
+ key: CipherKey,
1016
+ iv: BinaryLike | null,
1017
+ options?: stream.TransformOptions,
1018
+ ): Decipher;
979
1019
  /**
980
1020
  * Instances of the `Decipher` class are used to decrypt data. The class can be
981
1021
  * used in one of two ways:
@@ -1133,7 +1173,7 @@ declare module 'node:crypto' {
1133
1173
  buffer: NodeJS.ArrayBufferView,
1134
1174
  options: {
1135
1175
  plaintextLength: number;
1136
- }
1176
+ },
1137
1177
  ): this;
1138
1178
  }
1139
1179
  interface DecipherGCM extends Decipher {
@@ -1142,7 +1182,7 @@ declare module 'node:crypto' {
1142
1182
  buffer: NodeJS.ArrayBufferView,
1143
1183
  options?: {
1144
1184
  plaintextLength: number;
1145
- }
1185
+ },
1146
1186
  ): this;
1147
1187
  }
1148
1188
  interface DecipherOCB extends Decipher {
@@ -1151,20 +1191,20 @@ declare module 'node:crypto' {
1151
1191
  buffer: NodeJS.ArrayBufferView,
1152
1192
  options?: {
1153
1193
  plaintextLength: number;
1154
- }
1194
+ },
1155
1195
  ): this;
1156
1196
  }
1157
1197
  interface PrivateKeyInput {
1158
1198
  key: string | Buffer;
1159
1199
  format?: KeyFormat | undefined;
1160
- type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined;
1200
+ type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
1161
1201
  passphrase?: string | Buffer | undefined;
1162
1202
  encoding?: string | undefined;
1163
1203
  }
1164
1204
  interface PublicKeyInput {
1165
1205
  key: string | Buffer;
1166
1206
  format?: KeyFormat | undefined;
1167
- type?: 'pkcs1' | 'spki' | undefined;
1207
+ type?: "pkcs1" | "spki" | undefined;
1168
1208
  encoding?: string | undefined;
1169
1209
  }
1170
1210
  /**
@@ -1184,11 +1224,11 @@ declare module 'node:crypto' {
1184
1224
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1185
1225
  */
1186
1226
  function generateKey(
1187
- type: 'hmac' | 'aes',
1227
+ type: "hmac" | "aes",
1188
1228
  options: {
1189
1229
  length: number;
1190
1230
  },
1191
- callback: (err: Error | null, key: KeyObject) => void
1231
+ callback: (err: Error | null, key: KeyObject) => void,
1192
1232
  ): void;
1193
1233
  /**
1194
1234
  * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
@@ -1205,14 +1245,14 @@ declare module 'node:crypto' {
1205
1245
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1206
1246
  */
1207
1247
  function generateKeySync(
1208
- type: 'hmac' | 'aes',
1248
+ type: "hmac" | "aes",
1209
1249
  options: {
1210
1250
  length: number;
1211
- }
1251
+ },
1212
1252
  ): KeyObject;
1213
1253
  interface JsonWebKeyInput {
1214
1254
  key: JsonWebKey;
1215
- format: 'jwk';
1255
+ format: "jwk";
1216
1256
  }
1217
1257
  /**
1218
1258
  * Creates and returns a new key object containing a private key. If `key` is a
@@ -1259,7 +1299,7 @@ declare module 'node:crypto' {
1259
1299
  * @param options `stream.Writable` options
1260
1300
  */
1261
1301
  function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
1262
- type DSAEncoding = 'der' | 'ieee-p1363';
1302
+ type DSAEncoding = "der" | "ieee-p1363";
1263
1303
  interface SigningOptions {
1264
1304
  /**
1265
1305
  * @see crypto.constants.RSA_PKCS1_PADDING
@@ -1368,7 +1408,10 @@ declare module 'node:crypto' {
1368
1408
  * @since v0.1.92
1369
1409
  */
1370
1410
  sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
1371
- sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string;
1411
+ sign(
1412
+ privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
1413
+ outputFormat: BinaryToTextEncoding,
1414
+ ): string;
1372
1415
  }
1373
1416
  /**
1374
1417
  * Creates and returns a `Verify` object that uses the given algorithm.
@@ -1431,8 +1474,15 @@ declare module 'node:crypto' {
1431
1474
  * be passed instead of a public key.
1432
1475
  * @since v0.1.92
1433
1476
  */
1434
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean;
1435
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
1477
+ verify(
1478
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
1479
+ signature: NodeJS.ArrayBufferView,
1480
+ ): boolean;
1481
+ verify(
1482
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
1483
+ signature: string,
1484
+ signature_format?: BinaryToTextEncoding,
1485
+ ): boolean;
1436
1486
  }
1437
1487
  /**
1438
1488
  * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
@@ -1453,8 +1503,17 @@ declare module 'node:crypto' {
1453
1503
  function createDiffieHellman(primeLength: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
1454
1504
  function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
1455
1505
  function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding): DiffieHellman;
1456
- function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
1457
- function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
1506
+ function createDiffieHellman(
1507
+ prime: string,
1508
+ primeEncoding: BinaryToTextEncoding,
1509
+ generator: number | NodeJS.ArrayBufferView,
1510
+ ): DiffieHellman;
1511
+ function createDiffieHellman(
1512
+ prime: string,
1513
+ primeEncoding: BinaryToTextEncoding,
1514
+ generator: string,
1515
+ generatorEncoding: BinaryToTextEncoding,
1516
+ ): DiffieHellman;
1458
1517
  /**
1459
1518
  * The `DiffieHellman` class is a utility for creating Diffie-Hellman key
1460
1519
  * exchanges.
@@ -1512,8 +1571,16 @@ declare module 'node:crypto' {
1512
1571
  */
1513
1572
  computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
1514
1573
  computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
1515
- computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string;
1516
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
1574
+ computeSecret(
1575
+ otherPublicKey: NodeJS.ArrayBufferView,
1576
+ inputEncoding: null,
1577
+ outputEncoding: BinaryToTextEncoding,
1578
+ ): string;
1579
+ computeSecret(
1580
+ otherPublicKey: string,
1581
+ inputEncoding: BinaryToTextEncoding,
1582
+ outputEncoding: BinaryToTextEncoding,
1583
+ ): string;
1517
1584
  /**
1518
1585
  * Returns the Diffie-Hellman prime in the specified `encoding`.
1519
1586
  * If `encoding` is provided a string is
@@ -1611,7 +1678,7 @@ declare module 'node:crypto' {
1611
1678
  (name: string): DiffieHellmanGroup;
1612
1679
  readonly prototype: DiffieHellmanGroup;
1613
1680
  }
1614
- type DiffieHellmanGroup = Omit<DiffieHellman, 'setPublicKey' | 'setPrivateKey'>;
1681
+ type DiffieHellmanGroup = Omit<DiffieHellman, "setPublicKey" | "setPrivateKey">;
1615
1682
  /**
1616
1683
  * Creates a predefined `DiffieHellmanGroup` key exchange object. The
1617
1684
  * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`,
@@ -1698,7 +1765,14 @@ declare module 'node:crypto' {
1698
1765
  * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
1699
1766
  * @since v0.5.5
1700
1767
  */
1701
- function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void;
1768
+ function pbkdf2(
1769
+ password: BinaryLike,
1770
+ salt: BinaryLike,
1771
+ iterations: number,
1772
+ keylen: number,
1773
+ digest: string,
1774
+ callback: (err: Error | null, derivedKey: Buffer) => void,
1775
+ ): void;
1702
1776
  /**
1703
1777
  * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
1704
1778
  * implementation. A selected HMAC digest algorithm specified by `digest` is
@@ -1741,7 +1815,13 @@ declare module 'node:crypto' {
1741
1815
  * An array of supported digest functions can be retrieved using {@link getHashes}.
1742
1816
  * @since v0.9.3
1743
1817
  */
1744
- function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer;
1818
+ function pbkdf2Sync(
1819
+ password: BinaryLike,
1820
+ salt: BinaryLike,
1821
+ iterations: number,
1822
+ keylen: number,
1823
+ digest: string,
1824
+ ): Buffer;
1745
1825
  /**
1746
1826
  * Generates cryptographically strong pseudorandom data. The `size` argument
1747
1827
  * is a number indicating the number of bytes to generate.
@@ -1965,9 +2045,21 @@ declare module 'node:crypto' {
1965
2045
  * @param [size=buffer.length - offset]
1966
2046
  * @param callback `function(err, buf) {}`.
1967
2047
  */
1968
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
1969
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
1970
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
2048
+ function randomFill<T extends NodeJS.ArrayBufferView>(
2049
+ buffer: T,
2050
+ callback: (err: Error | null, buf: T) => void,
2051
+ ): void;
2052
+ function randomFill<T extends NodeJS.ArrayBufferView>(
2053
+ buffer: T,
2054
+ offset: number,
2055
+ callback: (err: Error | null, buf: T) => void,
2056
+ ): void;
2057
+ function randomFill<T extends NodeJS.ArrayBufferView>(
2058
+ buffer: T,
2059
+ offset: number,
2060
+ size: number,
2061
+ callback: (err: Error | null, buf: T) => void,
2062
+ ): void;
1971
2063
  interface ScryptOptions {
1972
2064
  cost?: number | undefined;
1973
2065
  blockSize?: number | undefined;
@@ -2011,8 +2103,19 @@ declare module 'node:crypto' {
2011
2103
  * ```
2012
2104
  * @since v10.5.0
2013
2105
  */
2014
- function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void;
2015
- function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void;
2106
+ function scrypt(
2107
+ password: BinaryLike,
2108
+ salt: BinaryLike,
2109
+ keylen: number,
2110
+ callback: (err: Error | null, derivedKey: Buffer) => void,
2111
+ ): void;
2112
+ function scrypt(
2113
+ password: BinaryLike,
2114
+ salt: BinaryLike,
2115
+ keylen: number,
2116
+ options: ScryptOptions,
2117
+ callback: (err: Error | null, derivedKey: Buffer) => void,
2118
+ ): void;
2016
2119
  /**
2017
2120
  * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
2018
2121
  * key derivation function that is designed to be expensive computationally and
@@ -2225,8 +2328,8 @@ declare module 'node:crypto' {
2225
2328
  key: BinaryLike,
2226
2329
  curve: string,
2227
2330
  inputEncoding?: BinaryToTextEncoding,
2228
- outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url',
2229
- format?: 'uncompressed' | 'compressed' | 'hybrid'
2331
+ outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
2332
+ format?: "uncompressed" | "compressed" | "hybrid",
2230
2333
  ): Buffer | string;
2231
2334
  /**
2232
2335
  * Generates private and public EC Diffie-Hellman key values, and returns
@@ -2262,7 +2365,11 @@ declare module 'node:crypto' {
2262
2365
  computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
2263
2366
  computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
2264
2367
  computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
2265
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
2368
+ computeSecret(
2369
+ otherPublicKey: string,
2370
+ inputEncoding: BinaryToTextEncoding,
2371
+ outputEncoding: BinaryToTextEncoding,
2372
+ ): string;
2266
2373
  /**
2267
2374
  * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
2268
2375
  * returned.
@@ -2327,8 +2434,8 @@ declare module 'node:crypto' {
2327
2434
  function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
2328
2435
  /** @deprecated since v10.0.0 */
2329
2436
  const DEFAULT_ENCODING: BufferEncoding;
2330
- type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
2331
- type KeyFormat = 'pem' | 'der' | 'jwk';
2437
+ type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448";
2438
+ type KeyFormat = "pem" | "der" | "jwk";
2332
2439
  interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
2333
2440
  format: T;
2334
2441
  cipher?: string | undefined;
@@ -2403,11 +2510,11 @@ declare module 'node:crypto' {
2403
2510
  */
2404
2511
  publicExponent?: number | undefined;
2405
2512
  publicKeyEncoding: {
2406
- type: 'pkcs1' | 'spki';
2513
+ type: "pkcs1" | "spki";
2407
2514
  format: PubF;
2408
2515
  };
2409
2516
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2410
- type: 'pkcs1' | 'pkcs8';
2517
+ type: "pkcs1" | "pkcs8";
2411
2518
  };
2412
2519
  }
2413
2520
  interface RSAPSSKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
@@ -2433,11 +2540,11 @@ declare module 'node:crypto' {
2433
2540
  */
2434
2541
  saltLength?: string;
2435
2542
  publicKeyEncoding: {
2436
- type: 'spki';
2543
+ type: "spki";
2437
2544
  format: PubF;
2438
2545
  };
2439
2546
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2440
- type: 'pkcs8';
2547
+ type: "pkcs8";
2441
2548
  };
2442
2549
  }
2443
2550
  interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
@@ -2450,11 +2557,11 @@ declare module 'node:crypto' {
2450
2557
  */
2451
2558
  divisorLength: number;
2452
2559
  publicKeyEncoding: {
2453
- type: 'spki';
2560
+ type: "spki";
2454
2561
  format: PubF;
2455
2562
  };
2456
2563
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2457
- type: 'pkcs8';
2564
+ type: "pkcs8";
2458
2565
  };
2459
2566
  }
2460
2567
  interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
@@ -2463,47 +2570,47 @@ declare module 'node:crypto' {
2463
2570
  */
2464
2571
  namedCurve: string;
2465
2572
  publicKeyEncoding: {
2466
- type: 'pkcs1' | 'spki';
2573
+ type: "pkcs1" | "spki";
2467
2574
  format: PubF;
2468
2575
  };
2469
2576
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2470
- type: 'sec1' | 'pkcs8';
2577
+ type: "sec1" | "pkcs8";
2471
2578
  };
2472
2579
  }
2473
2580
  interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2474
2581
  publicKeyEncoding: {
2475
- type: 'spki';
2582
+ type: "spki";
2476
2583
  format: PubF;
2477
2584
  };
2478
2585
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2479
- type: 'pkcs8';
2586
+ type: "pkcs8";
2480
2587
  };
2481
2588
  }
2482
2589
  interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2483
2590
  publicKeyEncoding: {
2484
- type: 'spki';
2591
+ type: "spki";
2485
2592
  format: PubF;
2486
2593
  };
2487
2594
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2488
- type: 'pkcs8';
2595
+ type: "pkcs8";
2489
2596
  };
2490
2597
  }
2491
2598
  interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2492
2599
  publicKeyEncoding: {
2493
- type: 'spki';
2600
+ type: "spki";
2494
2601
  format: PubF;
2495
2602
  };
2496
2603
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2497
- type: 'pkcs8';
2604
+ type: "pkcs8";
2498
2605
  };
2499
2606
  }
2500
2607
  interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2501
2608
  publicKeyEncoding: {
2502
- type: 'spki';
2609
+ type: "spki";
2503
2610
  format: PubF;
2504
2611
  };
2505
2612
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2506
- type: 'pkcs8';
2613
+ type: "pkcs8";
2507
2614
  };
2508
2615
  }
2509
2616
  interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
@@ -2551,46 +2658,142 @@ declare module 'node:crypto' {
2551
2658
  * @since v10.12.0
2552
2659
  * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
2553
2660
  */
2554
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2555
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2556
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2557
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2558
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2559
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2560
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2561
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2562
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2563
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2564
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2565
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2566
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2567
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2568
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2569
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2570
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2571
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2572
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2573
- function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2574
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2575
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2576
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2577
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2578
- function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2579
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2580
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2581
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2582
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2583
- function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2584
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2585
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2586
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2587
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2588
- function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2589
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2590
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2591
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2592
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2593
- function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2661
+ function generateKeyPairSync(
2662
+ type: "rsa",
2663
+ options: RSAKeyPairOptions<"pem", "pem">,
2664
+ ): KeyPairSyncResult<string, string>;
2665
+ function generateKeyPairSync(
2666
+ type: "rsa",
2667
+ options: RSAKeyPairOptions<"pem", "der">,
2668
+ ): KeyPairSyncResult<string, Buffer>;
2669
+ function generateKeyPairSync(
2670
+ type: "rsa",
2671
+ options: RSAKeyPairOptions<"der", "pem">,
2672
+ ): KeyPairSyncResult<Buffer, string>;
2673
+ function generateKeyPairSync(
2674
+ type: "rsa",
2675
+ options: RSAKeyPairOptions<"der", "der">,
2676
+ ): KeyPairSyncResult<Buffer, Buffer>;
2677
+ function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2678
+ function generateKeyPairSync(
2679
+ type: "rsa-pss",
2680
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
2681
+ ): KeyPairSyncResult<string, string>;
2682
+ function generateKeyPairSync(
2683
+ type: "rsa-pss",
2684
+ options: RSAPSSKeyPairOptions<"pem", "der">,
2685
+ ): KeyPairSyncResult<string, Buffer>;
2686
+ function generateKeyPairSync(
2687
+ type: "rsa-pss",
2688
+ options: RSAPSSKeyPairOptions<"der", "pem">,
2689
+ ): KeyPairSyncResult<Buffer, string>;
2690
+ function generateKeyPairSync(
2691
+ type: "rsa-pss",
2692
+ options: RSAPSSKeyPairOptions<"der", "der">,
2693
+ ): KeyPairSyncResult<Buffer, Buffer>;
2694
+ function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2695
+ function generateKeyPairSync(
2696
+ type: "dsa",
2697
+ options: DSAKeyPairOptions<"pem", "pem">,
2698
+ ): KeyPairSyncResult<string, string>;
2699
+ function generateKeyPairSync(
2700
+ type: "dsa",
2701
+ options: DSAKeyPairOptions<"pem", "der">,
2702
+ ): KeyPairSyncResult<string, Buffer>;
2703
+ function generateKeyPairSync(
2704
+ type: "dsa",
2705
+ options: DSAKeyPairOptions<"der", "pem">,
2706
+ ): KeyPairSyncResult<Buffer, string>;
2707
+ function generateKeyPairSync(
2708
+ type: "dsa",
2709
+ options: DSAKeyPairOptions<"der", "der">,
2710
+ ): KeyPairSyncResult<Buffer, Buffer>;
2711
+ function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2712
+ function generateKeyPairSync(
2713
+ type: "ec",
2714
+ options: ECKeyPairOptions<"pem", "pem">,
2715
+ ): KeyPairSyncResult<string, string>;
2716
+ function generateKeyPairSync(
2717
+ type: "ec",
2718
+ options: ECKeyPairOptions<"pem", "der">,
2719
+ ): KeyPairSyncResult<string, Buffer>;
2720
+ function generateKeyPairSync(
2721
+ type: "ec",
2722
+ options: ECKeyPairOptions<"der", "pem">,
2723
+ ): KeyPairSyncResult<Buffer, string>;
2724
+ function generateKeyPairSync(
2725
+ type: "ec",
2726
+ options: ECKeyPairOptions<"der", "der">,
2727
+ ): KeyPairSyncResult<Buffer, Buffer>;
2728
+ function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2729
+ function generateKeyPairSync(
2730
+ type: "ed25519",
2731
+ options: ED25519KeyPairOptions<"pem", "pem">,
2732
+ ): KeyPairSyncResult<string, string>;
2733
+ function generateKeyPairSync(
2734
+ type: "ed25519",
2735
+ options: ED25519KeyPairOptions<"pem", "der">,
2736
+ ): KeyPairSyncResult<string, Buffer>;
2737
+ function generateKeyPairSync(
2738
+ type: "ed25519",
2739
+ options: ED25519KeyPairOptions<"der", "pem">,
2740
+ ): KeyPairSyncResult<Buffer, string>;
2741
+ function generateKeyPairSync(
2742
+ type: "ed25519",
2743
+ options: ED25519KeyPairOptions<"der", "der">,
2744
+ ): KeyPairSyncResult<Buffer, Buffer>;
2745
+ function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2746
+ function generateKeyPairSync(
2747
+ type: "ed448",
2748
+ options: ED448KeyPairOptions<"pem", "pem">,
2749
+ ): KeyPairSyncResult<string, string>;
2750
+ function generateKeyPairSync(
2751
+ type: "ed448",
2752
+ options: ED448KeyPairOptions<"pem", "der">,
2753
+ ): KeyPairSyncResult<string, Buffer>;
2754
+ function generateKeyPairSync(
2755
+ type: "ed448",
2756
+ options: ED448KeyPairOptions<"der", "pem">,
2757
+ ): KeyPairSyncResult<Buffer, string>;
2758
+ function generateKeyPairSync(
2759
+ type: "ed448",
2760
+ options: ED448KeyPairOptions<"der", "der">,
2761
+ ): KeyPairSyncResult<Buffer, Buffer>;
2762
+ function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2763
+ function generateKeyPairSync(
2764
+ type: "x25519",
2765
+ options: X25519KeyPairOptions<"pem", "pem">,
2766
+ ): KeyPairSyncResult<string, string>;
2767
+ function generateKeyPairSync(
2768
+ type: "x25519",
2769
+ options: X25519KeyPairOptions<"pem", "der">,
2770
+ ): KeyPairSyncResult<string, Buffer>;
2771
+ function generateKeyPairSync(
2772
+ type: "x25519",
2773
+ options: X25519KeyPairOptions<"der", "pem">,
2774
+ ): KeyPairSyncResult<Buffer, string>;
2775
+ function generateKeyPairSync(
2776
+ type: "x25519",
2777
+ options: X25519KeyPairOptions<"der", "der">,
2778
+ ): KeyPairSyncResult<Buffer, Buffer>;
2779
+ function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2780
+ function generateKeyPairSync(
2781
+ type: "x448",
2782
+ options: X448KeyPairOptions<"pem", "pem">,
2783
+ ): KeyPairSyncResult<string, string>;
2784
+ function generateKeyPairSync(
2785
+ type: "x448",
2786
+ options: X448KeyPairOptions<"pem", "der">,
2787
+ ): KeyPairSyncResult<string, Buffer>;
2788
+ function generateKeyPairSync(
2789
+ type: "x448",
2790
+ options: X448KeyPairOptions<"der", "pem">,
2791
+ ): KeyPairSyncResult<Buffer, string>;
2792
+ function generateKeyPairSync(
2793
+ type: "x448",
2794
+ options: X448KeyPairOptions<"der", "der">,
2795
+ ): KeyPairSyncResult<Buffer, Buffer>;
2796
+ function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2594
2797
  /**
2595
2798
  * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
2596
2799
  * Ed25519, Ed448, X25519, X448, and DH are currently supported.
@@ -2630,279 +2833,448 @@ declare module 'node:crypto' {
2630
2833
  * @since v10.12.0
2631
2834
  * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
2632
2835
  */
2633
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2634
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2635
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2636
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2637
- function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2638
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2639
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2640
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2641
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2642
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2643
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2644
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2645
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2646
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2647
- function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2648
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2649
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2650
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2651
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2652
- function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2653
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2654
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2655
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2656
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2657
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2658
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2659
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2660
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2661
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2662
- function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2663
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2664
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2665
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2666
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2667
- function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2668
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2669
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2670
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2671
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2672
- function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2836
+ function generateKeyPair(
2837
+ type: "rsa",
2838
+ options: RSAKeyPairOptions<"pem", "pem">,
2839
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2840
+ ): void;
2841
+ function generateKeyPair(
2842
+ type: "rsa",
2843
+ options: RSAKeyPairOptions<"pem", "der">,
2844
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2845
+ ): void;
2846
+ function generateKeyPair(
2847
+ type: "rsa",
2848
+ options: RSAKeyPairOptions<"der", "pem">,
2849
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2850
+ ): void;
2851
+ function generateKeyPair(
2852
+ type: "rsa",
2853
+ options: RSAKeyPairOptions<"der", "der">,
2854
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2855
+ ): void;
2856
+ function generateKeyPair(
2857
+ type: "rsa",
2858
+ options: RSAKeyPairKeyObjectOptions,
2859
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2860
+ ): void;
2861
+ function generateKeyPair(
2862
+ type: "rsa-pss",
2863
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
2864
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2865
+ ): void;
2866
+ function generateKeyPair(
2867
+ type: "rsa-pss",
2868
+ options: RSAPSSKeyPairOptions<"pem", "der">,
2869
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2870
+ ): void;
2871
+ function generateKeyPair(
2872
+ type: "rsa-pss",
2873
+ options: RSAPSSKeyPairOptions<"der", "pem">,
2874
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2875
+ ): void;
2876
+ function generateKeyPair(
2877
+ type: "rsa-pss",
2878
+ options: RSAPSSKeyPairOptions<"der", "der">,
2879
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2880
+ ): void;
2881
+ function generateKeyPair(
2882
+ type: "rsa-pss",
2883
+ options: RSAPSSKeyPairKeyObjectOptions,
2884
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2885
+ ): void;
2886
+ function generateKeyPair(
2887
+ type: "dsa",
2888
+ options: DSAKeyPairOptions<"pem", "pem">,
2889
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2890
+ ): void;
2891
+ function generateKeyPair(
2892
+ type: "dsa",
2893
+ options: DSAKeyPairOptions<"pem", "der">,
2894
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2895
+ ): void;
2896
+ function generateKeyPair(
2897
+ type: "dsa",
2898
+ options: DSAKeyPairOptions<"der", "pem">,
2899
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2900
+ ): void;
2901
+ function generateKeyPair(
2902
+ type: "dsa",
2903
+ options: DSAKeyPairOptions<"der", "der">,
2904
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2905
+ ): void;
2906
+ function generateKeyPair(
2907
+ type: "dsa",
2908
+ options: DSAKeyPairKeyObjectOptions,
2909
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2910
+ ): void;
2911
+ function generateKeyPair(
2912
+ type: "ec",
2913
+ options: ECKeyPairOptions<"pem", "pem">,
2914
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2915
+ ): void;
2916
+ function generateKeyPair(
2917
+ type: "ec",
2918
+ options: ECKeyPairOptions<"pem", "der">,
2919
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2920
+ ): void;
2921
+ function generateKeyPair(
2922
+ type: "ec",
2923
+ options: ECKeyPairOptions<"der", "pem">,
2924
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2925
+ ): void;
2926
+ function generateKeyPair(
2927
+ type: "ec",
2928
+ options: ECKeyPairOptions<"der", "der">,
2929
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2930
+ ): void;
2931
+ function generateKeyPair(
2932
+ type: "ec",
2933
+ options: ECKeyPairKeyObjectOptions,
2934
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2935
+ ): void;
2936
+ function generateKeyPair(
2937
+ type: "ed25519",
2938
+ options: ED25519KeyPairOptions<"pem", "pem">,
2939
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2940
+ ): void;
2941
+ function generateKeyPair(
2942
+ type: "ed25519",
2943
+ options: ED25519KeyPairOptions<"pem", "der">,
2944
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2945
+ ): void;
2946
+ function generateKeyPair(
2947
+ type: "ed25519",
2948
+ options: ED25519KeyPairOptions<"der", "pem">,
2949
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2950
+ ): void;
2951
+ function generateKeyPair(
2952
+ type: "ed25519",
2953
+ options: ED25519KeyPairOptions<"der", "der">,
2954
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2955
+ ): void;
2956
+ function generateKeyPair(
2957
+ type: "ed25519",
2958
+ options: ED25519KeyPairKeyObjectOptions | undefined,
2959
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2960
+ ): void;
2961
+ function generateKeyPair(
2962
+ type: "ed448",
2963
+ options: ED448KeyPairOptions<"pem", "pem">,
2964
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2965
+ ): void;
2966
+ function generateKeyPair(
2967
+ type: "ed448",
2968
+ options: ED448KeyPairOptions<"pem", "der">,
2969
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2970
+ ): void;
2971
+ function generateKeyPair(
2972
+ type: "ed448",
2973
+ options: ED448KeyPairOptions<"der", "pem">,
2974
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2975
+ ): void;
2976
+ function generateKeyPair(
2977
+ type: "ed448",
2978
+ options: ED448KeyPairOptions<"der", "der">,
2979
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2980
+ ): void;
2981
+ function generateKeyPair(
2982
+ type: "ed448",
2983
+ options: ED448KeyPairKeyObjectOptions | undefined,
2984
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2985
+ ): void;
2986
+ function generateKeyPair(
2987
+ type: "x25519",
2988
+ options: X25519KeyPairOptions<"pem", "pem">,
2989
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2990
+ ): void;
2991
+ function generateKeyPair(
2992
+ type: "x25519",
2993
+ options: X25519KeyPairOptions<"pem", "der">,
2994
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2995
+ ): void;
2996
+ function generateKeyPair(
2997
+ type: "x25519",
2998
+ options: X25519KeyPairOptions<"der", "pem">,
2999
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3000
+ ): void;
3001
+ function generateKeyPair(
3002
+ type: "x25519",
3003
+ options: X25519KeyPairOptions<"der", "der">,
3004
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3005
+ ): void;
3006
+ function generateKeyPair(
3007
+ type: "x25519",
3008
+ options: X25519KeyPairKeyObjectOptions | undefined,
3009
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3010
+ ): void;
3011
+ function generateKeyPair(
3012
+ type: "x448",
3013
+ options: X448KeyPairOptions<"pem", "pem">,
3014
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3015
+ ): void;
3016
+ function generateKeyPair(
3017
+ type: "x448",
3018
+ options: X448KeyPairOptions<"pem", "der">,
3019
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3020
+ ): void;
3021
+ function generateKeyPair(
3022
+ type: "x448",
3023
+ options: X448KeyPairOptions<"der", "pem">,
3024
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3025
+ ): void;
3026
+ function generateKeyPair(
3027
+ type: "x448",
3028
+ options: X448KeyPairOptions<"der", "der">,
3029
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3030
+ ): void;
3031
+ function generateKeyPair(
3032
+ type: "x448",
3033
+ options: X448KeyPairKeyObjectOptions | undefined,
3034
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3035
+ ): void;
2673
3036
  namespace generateKeyPair {
2674
3037
  function __promisify__(
2675
- type: 'rsa',
2676
- options: RSAKeyPairOptions<'pem', 'pem'>
3038
+ type: "rsa",
3039
+ options: RSAKeyPairOptions<"pem", "pem">,
2677
3040
  ): Promise<{
2678
3041
  publicKey: string;
2679
3042
  privateKey: string;
2680
3043
  }>;
2681
3044
  function __promisify__(
2682
- type: 'rsa',
2683
- options: RSAKeyPairOptions<'pem', 'der'>
3045
+ type: "rsa",
3046
+ options: RSAKeyPairOptions<"pem", "der">,
2684
3047
  ): Promise<{
2685
3048
  publicKey: string;
2686
3049
  privateKey: Buffer;
2687
3050
  }>;
2688
3051
  function __promisify__(
2689
- type: 'rsa',
2690
- options: RSAKeyPairOptions<'der', 'pem'>
3052
+ type: "rsa",
3053
+ options: RSAKeyPairOptions<"der", "pem">,
2691
3054
  ): Promise<{
2692
3055
  publicKey: Buffer;
2693
3056
  privateKey: string;
2694
3057
  }>;
2695
3058
  function __promisify__(
2696
- type: 'rsa',
2697
- options: RSAKeyPairOptions<'der', 'der'>
3059
+ type: "rsa",
3060
+ options: RSAKeyPairOptions<"der", "der">,
2698
3061
  ): Promise<{
2699
3062
  publicKey: Buffer;
2700
3063
  privateKey: Buffer;
2701
3064
  }>;
2702
- function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3065
+ function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2703
3066
  function __promisify__(
2704
- type: 'rsa-pss',
2705
- options: RSAPSSKeyPairOptions<'pem', 'pem'>
3067
+ type: "rsa-pss",
3068
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
2706
3069
  ): Promise<{
2707
3070
  publicKey: string;
2708
3071
  privateKey: string;
2709
3072
  }>;
2710
3073
  function __promisify__(
2711
- type: 'rsa-pss',
2712
- options: RSAPSSKeyPairOptions<'pem', 'der'>
3074
+ type: "rsa-pss",
3075
+ options: RSAPSSKeyPairOptions<"pem", "der">,
2713
3076
  ): Promise<{
2714
3077
  publicKey: string;
2715
3078
  privateKey: Buffer;
2716
3079
  }>;
2717
3080
  function __promisify__(
2718
- type: 'rsa-pss',
2719
- options: RSAPSSKeyPairOptions<'der', 'pem'>
3081
+ type: "rsa-pss",
3082
+ options: RSAPSSKeyPairOptions<"der", "pem">,
2720
3083
  ): Promise<{
2721
3084
  publicKey: Buffer;
2722
3085
  privateKey: string;
2723
3086
  }>;
2724
3087
  function __promisify__(
2725
- type: 'rsa-pss',
2726
- options: RSAPSSKeyPairOptions<'der', 'der'>
3088
+ type: "rsa-pss",
3089
+ options: RSAPSSKeyPairOptions<"der", "der">,
2727
3090
  ): Promise<{
2728
3091
  publicKey: Buffer;
2729
3092
  privateKey: Buffer;
2730
3093
  }>;
2731
- function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2732
3094
  function __promisify__(
2733
- type: 'dsa',
2734
- options: DSAKeyPairOptions<'pem', 'pem'>
3095
+ type: "rsa-pss",
3096
+ options: RSAPSSKeyPairKeyObjectOptions,
3097
+ ): Promise<KeyPairKeyObjectResult>;
3098
+ function __promisify__(
3099
+ type: "dsa",
3100
+ options: DSAKeyPairOptions<"pem", "pem">,
2735
3101
  ): Promise<{
2736
3102
  publicKey: string;
2737
3103
  privateKey: string;
2738
3104
  }>;
2739
3105
  function __promisify__(
2740
- type: 'dsa',
2741
- options: DSAKeyPairOptions<'pem', 'der'>
3106
+ type: "dsa",
3107
+ options: DSAKeyPairOptions<"pem", "der">,
2742
3108
  ): Promise<{
2743
3109
  publicKey: string;
2744
3110
  privateKey: Buffer;
2745
3111
  }>;
2746
3112
  function __promisify__(
2747
- type: 'dsa',
2748
- options: DSAKeyPairOptions<'der', 'pem'>
3113
+ type: "dsa",
3114
+ options: DSAKeyPairOptions<"der", "pem">,
2749
3115
  ): Promise<{
2750
3116
  publicKey: Buffer;
2751
3117
  privateKey: string;
2752
3118
  }>;
2753
3119
  function __promisify__(
2754
- type: 'dsa',
2755
- options: DSAKeyPairOptions<'der', 'der'>
3120
+ type: "dsa",
3121
+ options: DSAKeyPairOptions<"der", "der">,
2756
3122
  ): Promise<{
2757
3123
  publicKey: Buffer;
2758
3124
  privateKey: Buffer;
2759
3125
  }>;
2760
- function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3126
+ function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2761
3127
  function __promisify__(
2762
- type: 'ec',
2763
- options: ECKeyPairOptions<'pem', 'pem'>
3128
+ type: "ec",
3129
+ options: ECKeyPairOptions<"pem", "pem">,
2764
3130
  ): Promise<{
2765
3131
  publicKey: string;
2766
3132
  privateKey: string;
2767
3133
  }>;
2768
3134
  function __promisify__(
2769
- type: 'ec',
2770
- options: ECKeyPairOptions<'pem', 'der'>
3135
+ type: "ec",
3136
+ options: ECKeyPairOptions<"pem", "der">,
2771
3137
  ): Promise<{
2772
3138
  publicKey: string;
2773
3139
  privateKey: Buffer;
2774
3140
  }>;
2775
3141
  function __promisify__(
2776
- type: 'ec',
2777
- options: ECKeyPairOptions<'der', 'pem'>
3142
+ type: "ec",
3143
+ options: ECKeyPairOptions<"der", "pem">,
2778
3144
  ): Promise<{
2779
3145
  publicKey: Buffer;
2780
3146
  privateKey: string;
2781
3147
  }>;
2782
3148
  function __promisify__(
2783
- type: 'ec',
2784
- options: ECKeyPairOptions<'der', 'der'>
3149
+ type: "ec",
3150
+ options: ECKeyPairOptions<"der", "der">,
2785
3151
  ): Promise<{
2786
3152
  publicKey: Buffer;
2787
3153
  privateKey: Buffer;
2788
3154
  }>;
2789
- function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3155
+ function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2790
3156
  function __promisify__(
2791
- type: 'ed25519',
2792
- options: ED25519KeyPairOptions<'pem', 'pem'>
3157
+ type: "ed25519",
3158
+ options: ED25519KeyPairOptions<"pem", "pem">,
2793
3159
  ): Promise<{
2794
3160
  publicKey: string;
2795
3161
  privateKey: string;
2796
3162
  }>;
2797
3163
  function __promisify__(
2798
- type: 'ed25519',
2799
- options: ED25519KeyPairOptions<'pem', 'der'>
3164
+ type: "ed25519",
3165
+ options: ED25519KeyPairOptions<"pem", "der">,
2800
3166
  ): Promise<{
2801
3167
  publicKey: string;
2802
3168
  privateKey: Buffer;
2803
3169
  }>;
2804
3170
  function __promisify__(
2805
- type: 'ed25519',
2806
- options: ED25519KeyPairOptions<'der', 'pem'>
3171
+ type: "ed25519",
3172
+ options: ED25519KeyPairOptions<"der", "pem">,
2807
3173
  ): Promise<{
2808
3174
  publicKey: Buffer;
2809
3175
  privateKey: string;
2810
3176
  }>;
2811
3177
  function __promisify__(
2812
- type: 'ed25519',
2813
- options: ED25519KeyPairOptions<'der', 'der'>
3178
+ type: "ed25519",
3179
+ options: ED25519KeyPairOptions<"der", "der">,
2814
3180
  ): Promise<{
2815
3181
  publicKey: Buffer;
2816
3182
  privateKey: Buffer;
2817
3183
  }>;
2818
- function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2819
3184
  function __promisify__(
2820
- type: 'ed448',
2821
- options: ED448KeyPairOptions<'pem', 'pem'>
3185
+ type: "ed25519",
3186
+ options?: ED25519KeyPairKeyObjectOptions,
3187
+ ): Promise<KeyPairKeyObjectResult>;
3188
+ function __promisify__(
3189
+ type: "ed448",
3190
+ options: ED448KeyPairOptions<"pem", "pem">,
2822
3191
  ): Promise<{
2823
3192
  publicKey: string;
2824
3193
  privateKey: string;
2825
3194
  }>;
2826
3195
  function __promisify__(
2827
- type: 'ed448',
2828
- options: ED448KeyPairOptions<'pem', 'der'>
3196
+ type: "ed448",
3197
+ options: ED448KeyPairOptions<"pem", "der">,
2829
3198
  ): Promise<{
2830
3199
  publicKey: string;
2831
3200
  privateKey: Buffer;
2832
3201
  }>;
2833
3202
  function __promisify__(
2834
- type: 'ed448',
2835
- options: ED448KeyPairOptions<'der', 'pem'>
3203
+ type: "ed448",
3204
+ options: ED448KeyPairOptions<"der", "pem">,
2836
3205
  ): Promise<{
2837
3206
  publicKey: Buffer;
2838
3207
  privateKey: string;
2839
3208
  }>;
2840
3209
  function __promisify__(
2841
- type: 'ed448',
2842
- options: ED448KeyPairOptions<'der', 'der'>
3210
+ type: "ed448",
3211
+ options: ED448KeyPairOptions<"der", "der">,
2843
3212
  ): Promise<{
2844
3213
  publicKey: Buffer;
2845
3214
  privateKey: Buffer;
2846
3215
  }>;
2847
- function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3216
+ function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2848
3217
  function __promisify__(
2849
- type: 'x25519',
2850
- options: X25519KeyPairOptions<'pem', 'pem'>
3218
+ type: "x25519",
3219
+ options: X25519KeyPairOptions<"pem", "pem">,
2851
3220
  ): Promise<{
2852
3221
  publicKey: string;
2853
3222
  privateKey: string;
2854
3223
  }>;
2855
3224
  function __promisify__(
2856
- type: 'x25519',
2857
- options: X25519KeyPairOptions<'pem', 'der'>
3225
+ type: "x25519",
3226
+ options: X25519KeyPairOptions<"pem", "der">,
2858
3227
  ): Promise<{
2859
3228
  publicKey: string;
2860
3229
  privateKey: Buffer;
2861
3230
  }>;
2862
3231
  function __promisify__(
2863
- type: 'x25519',
2864
- options: X25519KeyPairOptions<'der', 'pem'>
3232
+ type: "x25519",
3233
+ options: X25519KeyPairOptions<"der", "pem">,
2865
3234
  ): Promise<{
2866
3235
  publicKey: Buffer;
2867
3236
  privateKey: string;
2868
3237
  }>;
2869
3238
  function __promisify__(
2870
- type: 'x25519',
2871
- options: X25519KeyPairOptions<'der', 'der'>
3239
+ type: "x25519",
3240
+ options: X25519KeyPairOptions<"der", "der">,
2872
3241
  ): Promise<{
2873
3242
  publicKey: Buffer;
2874
3243
  privateKey: Buffer;
2875
3244
  }>;
2876
- function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2877
3245
  function __promisify__(
2878
- type: 'x448',
2879
- options: X448KeyPairOptions<'pem', 'pem'>
3246
+ type: "x25519",
3247
+ options?: X25519KeyPairKeyObjectOptions,
3248
+ ): Promise<KeyPairKeyObjectResult>;
3249
+ function __promisify__(
3250
+ type: "x448",
3251
+ options: X448KeyPairOptions<"pem", "pem">,
2880
3252
  ): Promise<{
2881
3253
  publicKey: string;
2882
3254
  privateKey: string;
2883
3255
  }>;
2884
3256
  function __promisify__(
2885
- type: 'x448',
2886
- options: X448KeyPairOptions<'pem', 'der'>
3257
+ type: "x448",
3258
+ options: X448KeyPairOptions<"pem", "der">,
2887
3259
  ): Promise<{
2888
3260
  publicKey: string;
2889
3261
  privateKey: Buffer;
2890
3262
  }>;
2891
3263
  function __promisify__(
2892
- type: 'x448',
2893
- options: X448KeyPairOptions<'der', 'pem'>
3264
+ type: "x448",
3265
+ options: X448KeyPairOptions<"der", "pem">,
2894
3266
  ): Promise<{
2895
3267
  publicKey: Buffer;
2896
3268
  privateKey: string;
2897
3269
  }>;
2898
3270
  function __promisify__(
2899
- type: 'x448',
2900
- options: X448KeyPairOptions<'der', 'der'>
3271
+ type: "x448",
3272
+ options: X448KeyPairOptions<"der", "der">,
2901
3273
  ): Promise<{
2902
3274
  publicKey: Buffer;
2903
3275
  privateKey: Buffer;
2904
3276
  }>;
2905
- function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3277
+ function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2906
3278
  }
2907
3279
  /**
2908
3280
  * Calculates and returns the signature for `data` using the given private key and
@@ -2916,12 +3288,16 @@ declare module 'node:crypto' {
2916
3288
  * If the `callback` function is provided this function uses libuv's threadpool.
2917
3289
  * @since v12.0.0
2918
3290
  */
2919
- function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
2920
3291
  function sign(
2921
3292
  algorithm: string | null | undefined,
2922
3293
  data: NodeJS.ArrayBufferView,
2923
3294
  key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
2924
- callback: (error: Error | null, data: Buffer) => void
3295
+ ): Buffer;
3296
+ function sign(
3297
+ algorithm: string | null | undefined,
3298
+ data: NodeJS.ArrayBufferView,
3299
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
3300
+ callback: (error: Error | null, data: Buffer) => void,
2925
3301
  ): void;
2926
3302
  /**
2927
3303
  * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the
@@ -2943,14 +3319,14 @@ declare module 'node:crypto' {
2943
3319
  algorithm: string | null | undefined,
2944
3320
  data: NodeJS.ArrayBufferView,
2945
3321
  key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2946
- signature: NodeJS.ArrayBufferView
3322
+ signature: NodeJS.ArrayBufferView,
2947
3323
  ): boolean;
2948
3324
  function verify(
2949
3325
  algorithm: string | null | undefined,
2950
3326
  data: NodeJS.ArrayBufferView,
2951
3327
  key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2952
3328
  signature: NodeJS.ArrayBufferView,
2953
- callback: (error: Error | null, result: boolean) => void
3329
+ callback: (error: Error | null, result: boolean) => void,
2954
3330
  ): void;
2955
3331
  /**
2956
3332
  * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
@@ -2958,7 +3334,7 @@ declare module 'node:crypto' {
2958
3334
  * @since v13.9.0, v12.17.0
2959
3335
  */
2960
3336
  function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
2961
- type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts';
3337
+ type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
2962
3338
  interface CipherInfoOptions {
2963
3339
  /**
2964
3340
  * A test key length.
@@ -3036,7 +3412,14 @@ declare module 'node:crypto' {
3036
3412
  * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
3037
3413
  * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
3038
3414
  */
3039
- function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void;
3415
+ function hkdf(
3416
+ digest: string,
3417
+ irm: BinaryLike | KeyObject,
3418
+ salt: BinaryLike,
3419
+ info: BinaryLike,
3420
+ keylen: number,
3421
+ callback: (err: Error | null, derivedKey: ArrayBuffer) => void,
3422
+ ): void;
3040
3423
  /**
3041
3424
  * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The
3042
3425
  * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes.
@@ -3063,7 +3446,13 @@ declare module 'node:crypto' {
3063
3446
  * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
3064
3447
  * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
3065
3448
  */
3066
- function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer;
3449
+ function hkdfSync(
3450
+ digest: string,
3451
+ ikm: BinaryLike | KeyObject,
3452
+ salt: BinaryLike,
3453
+ info: BinaryLike,
3454
+ keylen: number,
3455
+ ): ArrayBuffer;
3067
3456
  interface SecureHeapUsage {
3068
3457
  /**
3069
3458
  * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag.
@@ -3108,7 +3497,7 @@ declare module 'node:crypto' {
3108
3497
  /**
3109
3498
  * @default 'always'
3110
3499
  */
3111
- subject?: 'always' | 'default' | 'never';
3500
+ subject?: "always" | "default" | "never";
3112
3501
  /**
3113
3502
  * @default true
3114
3503
  */
@@ -3159,7 +3548,7 @@ declare module 'node:crypto' {
3159
3548
  * The SHA-512 fingerprint of this certificate.
3160
3549
  * @since v16.14.0
3161
3550
  */
3162
- readonly fingerprint512: string;
3551
+ readonly fingerprint512: string;
3163
3552
  /**
3164
3553
  * The complete subject of this certificate.
3165
3554
  * @since v15.6.0
@@ -3224,7 +3613,7 @@ declare module 'node:crypto' {
3224
3613
  * @since v15.6.0
3225
3614
  * @return Returns `email` if the certificate matches, `undefined` if it does not.
3226
3615
  */
3227
- checkEmail(email: string, options?: Pick<X509CheckOptions, 'subject'>): string | undefined;
3616
+ checkEmail(email: string, options?: Pick<X509CheckOptions, "subject">): string | undefined;
3228
3617
  /**
3229
3618
  * Checks whether the certificate matches the given host name.
3230
3619
  * @since v15.6.0
@@ -3317,9 +3706,21 @@ declare module 'node:crypto' {
3317
3706
  * @param size The size (in bits) of the prime to generate.
3318
3707
  */
3319
3708
  function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
3320
- function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void;
3321
- function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
3322
- function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void;
3709
+ function generatePrime(
3710
+ size: number,
3711
+ options: GeneratePrimeOptionsBigInt,
3712
+ callback: (err: Error | null, prime: bigint) => void,
3713
+ ): void;
3714
+ function generatePrime(
3715
+ size: number,
3716
+ options: GeneratePrimeOptionsArrayBuffer,
3717
+ callback: (err: Error | null, prime: ArrayBuffer) => void,
3718
+ ): void;
3719
+ function generatePrime(
3720
+ size: number,
3721
+ options: GeneratePrimeOptions,
3722
+ callback: (err: Error | null, prime: ArrayBuffer | bigint) => void,
3723
+ ): void;
3323
3724
  /**
3324
3725
  * Generates a pseudorandom prime of `size` bits.
3325
3726
  *
@@ -3368,7 +3769,11 @@ declare module 'node:crypto' {
3368
3769
  * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
3369
3770
  */
3370
3771
  function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void;
3371
- function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void;
3772
+ function checkPrime(
3773
+ value: LargeNumberLike,
3774
+ options: CheckPrimeOptions,
3775
+ callback: (err: Error | null, result: boolean) => void,
3776
+ ): void;
3372
3777
  /**
3373
3778
  * Checks the primality of the `candidate`.
3374
3779
  * @since v15.8.0
@@ -3414,9 +3819,17 @@ declare module 'node:crypto' {
3414
3819
  const webcrypto: webcrypto.Crypto;
3415
3820
  namespace webcrypto {
3416
3821
  type BufferSource = ArrayBufferView | ArrayBuffer;
3417
- type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki';
3418
- type KeyType = 'private' | 'public' | 'secret';
3419
- type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey';
3822
+ type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
3823
+ type KeyType = "private" | "public" | "secret";
3824
+ type KeyUsage =
3825
+ | "decrypt"
3826
+ | "deriveBits"
3827
+ | "deriveKey"
3828
+ | "encrypt"
3829
+ | "sign"
3830
+ | "unwrapKey"
3831
+ | "verify"
3832
+ | "wrapKey";
3420
3833
  type AlgorithmIdentifier = Algorithm | string;
3421
3834
  type HashAlgorithmIdentifier = AlgorithmIdentifier;
3422
3835
  type NamedCurve = string;
@@ -3570,7 +3983,7 @@ declare module 'node:crypto' {
3570
3983
  /** Illegal constructor */
3571
3984
  (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
3572
3985
  readonly length: 0;
3573
- readonly name: 'CryptoKey';
3986
+ readonly name: "CryptoKey";
3574
3987
  readonly prototype: CryptoKey;
3575
3988
  }
3576
3989
  /**
@@ -3643,7 +4056,11 @@ declare module 'node:crypto' {
3643
4056
  * - `'AES-GCM'`
3644
4057
  * @since v15.0.0
3645
4058
  */
3646
- decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
4059
+ decrypt(
4060
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4061
+ key: CryptoKey,
4062
+ data: BufferSource,
4063
+ ): Promise<ArrayBuffer>;
3647
4064
  /**
3648
4065
  * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
3649
4066
  * `subtle.deriveBits()` attempts to generate `length` bits.
@@ -3657,7 +4074,11 @@ declare module 'node:crypto' {
3657
4074
  * - `'PBKDF2'`
3658
4075
  * @since v15.0.0
3659
4076
  */
3660
- deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
4077
+ deriveBits(
4078
+ algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
4079
+ baseKey: CryptoKey,
4080
+ length: number,
4081
+ ): Promise<ArrayBuffer>;
3661
4082
  /**
3662
4083
  * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
3663
4084
  * `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
@@ -3676,9 +4097,14 @@ declare module 'node:crypto' {
3676
4097
  deriveKey(
3677
4098
  algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
3678
4099
  baseKey: CryptoKey,
3679
- derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params,
4100
+ derivedKeyAlgorithm:
4101
+ | AlgorithmIdentifier
4102
+ | AesDerivedKeyParams
4103
+ | HmacImportParams
4104
+ | HkdfParams
4105
+ | Pbkdf2Params,
3680
4106
  extractable: boolean,
3681
- keyUsages: ReadonlyArray<KeyUsage>
4107
+ keyUsages: ReadonlyArray<KeyUsage>,
3682
4108
  ): Promise<CryptoKey>;
3683
4109
  /**
3684
4110
  * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
@@ -3708,7 +4134,11 @@ declare module 'node:crypto' {
3708
4134
  * - `'AES-GCM'`
3709
4135
  * @since v15.0.0
3710
4136
  */
3711
- encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
4137
+ encrypt(
4138
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4139
+ key: CryptoKey,
4140
+ data: BufferSource,
4141
+ ): Promise<ArrayBuffer>;
3712
4142
  /**
3713
4143
  * Exports the given key into the specified format, if supported.
3714
4144
  *
@@ -3723,8 +4153,8 @@ declare module 'node:crypto' {
3723
4153
  * @returns `<Promise>` containing `<ArrayBuffer>`.
3724
4154
  * @since v15.0.0
3725
4155
  */
3726
- exportKey(format: 'jwk', key: CryptoKey): Promise<JsonWebKey>;
3727
- exportKey(format: Exclude<KeyFormat, 'jwk'>, key: CryptoKey): Promise<ArrayBuffer>;
4156
+ exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
4157
+ exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
3728
4158
  /**
3729
4159
  * Using the method and parameters provided in `algorithm`,
3730
4160
  * `subtle.generateKey()` attempts to generate new keying material.
@@ -3747,9 +4177,21 @@ declare module 'node:crypto' {
3747
4177
  * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
3748
4178
  * @since v15.0.0
3749
4179
  */
3750
- generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
3751
- generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
3752
- generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
4180
+ generateKey(
4181
+ algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
4182
+ extractable: boolean,
4183
+ keyUsages: ReadonlyArray<KeyUsage>,
4184
+ ): Promise<CryptoKeyPair>;
4185
+ generateKey(
4186
+ algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
4187
+ extractable: boolean,
4188
+ keyUsages: ReadonlyArray<KeyUsage>,
4189
+ ): Promise<CryptoKey>;
4190
+ generateKey(
4191
+ algorithm: AlgorithmIdentifier,
4192
+ extractable: boolean,
4193
+ keyUsages: KeyUsage[],
4194
+ ): Promise<CryptoKeyPair | CryptoKey>;
3753
4195
  /**
3754
4196
  * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
3755
4197
  * to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
@@ -3761,18 +4203,28 @@ declare module 'node:crypto' {
3761
4203
  * @since v15.0.0
3762
4204
  */
3763
4205
  importKey(
3764
- format: 'jwk',
4206
+ format: "jwk",
3765
4207
  keyData: JsonWebKey,
3766
- algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
4208
+ algorithm:
4209
+ | AlgorithmIdentifier
4210
+ | RsaHashedImportParams
4211
+ | EcKeyImportParams
4212
+ | HmacImportParams
4213
+ | AesKeyAlgorithm,
3767
4214
  extractable: boolean,
3768
- keyUsages: ReadonlyArray<KeyUsage>
4215
+ keyUsages: ReadonlyArray<KeyUsage>,
3769
4216
  ): Promise<CryptoKey>;
3770
4217
  importKey(
3771
- format: Exclude<KeyFormat, 'jwk'>,
4218
+ format: Exclude<KeyFormat, "jwk">,
3772
4219
  keyData: BufferSource,
3773
- algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
4220
+ algorithm:
4221
+ | AlgorithmIdentifier
4222
+ | RsaHashedImportParams
4223
+ | EcKeyImportParams
4224
+ | HmacImportParams
4225
+ | AesKeyAlgorithm,
3774
4226
  extractable: boolean,
3775
- keyUsages: KeyUsage[]
4227
+ keyUsages: KeyUsage[],
3776
4228
  ): Promise<CryptoKey>;
3777
4229
  /**
3778
4230
  * Using the method and parameters given by `algorithm` and the keying material provided by `key`,
@@ -3787,7 +4239,11 @@ declare module 'node:crypto' {
3787
4239
  * - `'HMAC'`
3788
4240
  * @since v15.0.0
3789
4241
  */
3790
- sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
4242
+ sign(
4243
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
4244
+ key: CryptoKey,
4245
+ data: BufferSource,
4246
+ ): Promise<ArrayBuffer>;
3791
4247
  /**
3792
4248
  * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
3793
4249
  * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
@@ -3824,9 +4280,14 @@ declare module 'node:crypto' {
3824
4280
  wrappedKey: BufferSource,
3825
4281
  unwrappingKey: CryptoKey,
3826
4282
  unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
3827
- unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
4283
+ unwrappedKeyAlgorithm:
4284
+ | AlgorithmIdentifier
4285
+ | RsaHashedImportParams
4286
+ | EcKeyImportParams
4287
+ | HmacImportParams
4288
+ | AesKeyAlgorithm,
3828
4289
  extractable: boolean,
3829
- keyUsages: KeyUsage[]
4290
+ keyUsages: KeyUsage[],
3830
4291
  ): Promise<CryptoKey>;
3831
4292
  /**
3832
4293
  * Using the method and parameters given in `algorithm` and the keying material provided by `key`,
@@ -3841,7 +4302,12 @@ declare module 'node:crypto' {
3841
4302
  * - `'HMAC'`
3842
4303
  * @since v15.0.0
3843
4304
  */
3844
- verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<boolean>;
4305
+ verify(
4306
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
4307
+ key: CryptoKey,
4308
+ signature: BufferSource,
4309
+ data: BufferSource,
4310
+ ): Promise<boolean>;
3845
4311
  /**
3846
4312
  * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
3847
4313
  * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
@@ -3860,10 +4326,15 @@ declare module 'node:crypto' {
3860
4326
  * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
3861
4327
  * @since v15.0.0
3862
4328
  */
3863
- wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise<ArrayBuffer>;
4329
+ wrapKey(
4330
+ format: KeyFormat,
4331
+ key: CryptoKey,
4332
+ wrappingKey: CryptoKey,
4333
+ wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4334
+ ): Promise<ArrayBuffer>;
3864
4335
  }
3865
4336
  }
3866
4337
  }
3867
- declare module 'crypto' {
3868
- export * from 'node:crypto';
4338
+ declare module "node:crypto" {
4339
+ export * from "crypto";
3869
4340
  }