@types/node 18.17.17 → 18.17.19

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 (106) hide show
  1. node v18.17/README.md +1 -1
  2. node v18.17/assert/strict.d.ts +4 -4
  3. node v18.17/assert.d.ts +48 -24
  4. node v18.17/async_hooks.d.ts +10 -7
  5. node v18.17/buffer.d.ts +32 -34
  6. node v18.17/child_process.d.ts +262 -122
  7. node v18.17/cluster.d.ts +107 -89
  8. node v18.17/console.d.ts +7 -7
  9. node v18.17/constants.d.ts +12 -11
  10. node v18.17/crypto.d.ts +746 -268
  11. node v18.17/dgram.d.ts +81 -45
  12. node v18.17/diagnostics_channel.d.ts +3 -3
  13. node v18.17/dns/promises.d.ts +28 -25
  14. node v18.17/dns.d.ts +203 -62
  15. node v18.17/dom-events.d.ts +67 -71
  16. node v18.17/domain.d.ts +4 -4
  17. node v18.17/events.d.ts +15 -7
  18. node v18.17/fs/promises.d.ts +102 -73
  19. node v18.17/fs.d.ts +513 -311
  20. node v18.17/globals.d.ts +16 -18
  21. node v18.17/http.d.ts +185 -185
  22. node v18.17/http2.d.ts +628 -376
  23. node v18.17/https.d.ts +107 -105
  24. node v18.17/inspector.d.ts +3 -3
  25. node v18.17/module.d.ts +11 -8
  26. node v18.17/net.d.ts +112 -93
  27. node v18.17/os.d.ts +7 -7
  28. node v18.17/package.json +2 -2
  29. node v18.17/path.d.ts +13 -13
  30. node v18.17/perf_hooks.d.ts +20 -19
  31. node v18.17/process.d.ts +155 -125
  32. node v18.17/punycode.d.ts +3 -3
  33. node v18.17/querystring.d.ts +14 -4
  34. node v18.17/readline/promises.d.ts +5 -5
  35. node v18.17/readline.d.ts +69 -56
  36. node v18.17/repl.d.ts +67 -61
  37. node v18.17/stream/consumers.d.ts +4 -4
  38. node v18.17/stream/promises.d.ts +56 -15
  39. node v18.17/stream/web.d.ts +26 -20
  40. node v18.17/stream.d.ts +356 -226
  41. node v18.17/string_decoder.d.ts +3 -3
  42. node v18.17/test.d.ts +76 -91
  43. node v18.17/timers/promises.d.ts +4 -4
  44. node v18.17/timers.d.ts +23 -8
  45. node v18.17/tls.d.ts +151 -71
  46. node v18.17/trace_events.d.ts +3 -3
  47. node v18.17/ts4.8/assert/strict.d.ts +4 -4
  48. node v18.17/ts4.8/assert.d.ts +48 -24
  49. node v18.17/ts4.8/async_hooks.d.ts +10 -7
  50. node v18.17/ts4.8/buffer.d.ts +32 -34
  51. node v18.17/ts4.8/child_process.d.ts +262 -122
  52. node v18.17/ts4.8/cluster.d.ts +107 -89
  53. node v18.17/ts4.8/console.d.ts +7 -7
  54. node v18.17/ts4.8/constants.d.ts +12 -11
  55. node v18.17/ts4.8/crypto.d.ts +746 -268
  56. node v18.17/ts4.8/dgram.d.ts +81 -45
  57. node v18.17/ts4.8/diagnostics_channel.d.ts +3 -3
  58. node v18.17/ts4.8/dns/promises.d.ts +28 -25
  59. node v18.17/ts4.8/dns.d.ts +203 -62
  60. node v18.17/ts4.8/dom-events.d.ts +67 -71
  61. node v18.17/ts4.8/domain.d.ts +4 -4
  62. node v18.17/ts4.8/events.d.ts +15 -7
  63. node v18.17/ts4.8/fs/promises.d.ts +102 -73
  64. node v18.17/ts4.8/fs.d.ts +514 -312
  65. node v18.17/ts4.8/globals.d.ts +44 -46
  66. node v18.17/ts4.8/http.d.ts +185 -185
  67. node v18.17/ts4.8/http2.d.ts +628 -376
  68. node v18.17/ts4.8/https.d.ts +107 -105
  69. node v18.17/ts4.8/inspector.d.ts +3 -3
  70. node v18.17/ts4.8/module.d.ts +11 -8
  71. node v18.17/ts4.8/net.d.ts +112 -93
  72. node v18.17/ts4.8/os.d.ts +7 -7
  73. node v18.17/ts4.8/path.d.ts +13 -13
  74. node v18.17/ts4.8/perf_hooks.d.ts +20 -19
  75. node v18.17/ts4.8/process.d.ts +155 -125
  76. node v18.17/ts4.8/punycode.d.ts +3 -3
  77. node v18.17/ts4.8/querystring.d.ts +14 -4
  78. node v18.17/ts4.8/readline/promises.d.ts +5 -5
  79. node v18.17/ts4.8/readline.d.ts +69 -56
  80. node v18.17/ts4.8/repl.d.ts +67 -61
  81. node v18.17/ts4.8/stream/consumers.d.ts +4 -4
  82. node v18.17/ts4.8/stream/promises.d.ts +56 -15
  83. node v18.17/ts4.8/stream/web.d.ts +26 -20
  84. node v18.17/ts4.8/stream.d.ts +321 -217
  85. node v18.17/ts4.8/string_decoder.d.ts +3 -3
  86. node v18.17/ts4.8/test.d.ts +75 -90
  87. node v18.17/ts4.8/timers/promises.d.ts +4 -4
  88. node v18.17/ts4.8/timers.d.ts +23 -8
  89. node v18.17/ts4.8/tls.d.ts +151 -71
  90. node v18.17/ts4.8/trace_events.d.ts +3 -3
  91. node v18.17/ts4.8/tty.d.ts +10 -10
  92. node v18.17/ts4.8/url.d.ts +26 -14
  93. node v18.17/ts4.8/util.d.ts +178 -117
  94. node v18.17/ts4.8/v8.d.ts +4 -4
  95. node v18.17/ts4.8/vm.d.ts +60 -42
  96. node v18.17/ts4.8/wasi.d.ts +3 -3
  97. node v18.17/ts4.8/worker_threads.d.ts +82 -85
  98. node v18.17/ts4.8/zlib.d.ts +9 -9
  99. node v18.17/tty.d.ts +10 -10
  100. node v18.17/url.d.ts +26 -14
  101. node v18.17/util.d.ts +178 -117
  102. node v18.17/v8.d.ts +4 -4
  103. node v18.17/vm.d.ts +60 -42
  104. node v18.17/wasi.d.ts +3 -3
  105. node v18.17/worker_threads.d.ts +82 -85
  106. node v18.17/zlib.d.ts +9 -9
node v18.17/crypto.d.ts CHANGED
@@ -15,9 +15,9 @@
15
15
  * ```
16
16
  * @see [source](https://github.com/nodejs/node/blob/v18.0.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
  /**
22
22
  * SPKAC is a Certificate Signing Request mechanism originally implemented by
23
23
  * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen).
@@ -277,11 +277,11 @@ declare module 'node:crypto' {
277
277
  */
278
278
  function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
279
279
  // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
280
- type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary';
281
- type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
282
- type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
280
+ type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
281
+ type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "latin1";
282
+ type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
283
283
  type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
284
- type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
284
+ type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
285
285
  /**
286
286
  * The `Hash` class is a utility for creating hash digests of data. It can be
287
287
  * used in one of two ways:
@@ -500,15 +500,15 @@ declare module 'node:crypto' {
500
500
  digest(): Buffer;
501
501
  digest(encoding: BinaryToTextEncoding): string;
502
502
  }
503
- type KeyObjectType = 'secret' | 'public' | 'private';
503
+ type KeyObjectType = "secret" | "public" | "private";
504
504
  interface KeyExportOptions<T extends KeyFormat> {
505
- type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
505
+ type: "pkcs1" | "spki" | "pkcs8" | "sec1";
506
506
  format: T;
507
507
  cipher?: string | undefined;
508
508
  passphrase?: string | Buffer | undefined;
509
509
  }
510
510
  interface JwkKeyExportOptions {
511
- format: 'jwk';
511
+ format: "jwk";
512
512
  }
513
513
  interface JsonWebKey {
514
514
  crv?: string | undefined;
@@ -652,8 +652,8 @@ declare module 'node:crypto' {
652
652
  * PKCS#1 and SEC1 encryption.
653
653
  * @since v11.6.0
654
654
  */
655
- export(options: KeyExportOptions<'pem'>): string | Buffer;
656
- export(options?: KeyExportOptions<'der'>): Buffer;
655
+ export(options: KeyExportOptions<"pem">): string | Buffer;
656
+ export(options?: KeyExportOptions<"der">): Buffer;
657
657
  export(options?: JwkKeyExportOptions): JsonWebKey;
658
658
  /**
659
659
  * For secret keys, this property represents the size of the key in bytes. This
@@ -668,9 +668,9 @@ declare module 'node:crypto' {
668
668
  */
669
669
  type: KeyObjectType;
670
670
  }
671
- type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305';
672
- type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
673
- type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb';
671
+ type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305";
672
+ type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
673
+ type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
674
674
  type BinaryLike = string | NodeJS.ArrayBufferView;
675
675
  type CipherKey = BinaryLike | KeyObject;
676
676
  interface CipherCCMOptions extends stream.TransformOptions {
@@ -750,10 +750,30 @@ declare module 'node:crypto' {
750
750
  * @since v0.1.94
751
751
  * @param options `stream.transform` options
752
752
  */
753
- function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM;
754
- function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB;
755
- function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM;
756
- function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher;
753
+ function createCipheriv(
754
+ algorithm: CipherCCMTypes,
755
+ key: CipherKey,
756
+ iv: BinaryLike,
757
+ options: CipherCCMOptions,
758
+ ): CipherCCM;
759
+ function createCipheriv(
760
+ algorithm: CipherOCBTypes,
761
+ key: CipherKey,
762
+ iv: BinaryLike,
763
+ options: CipherOCBOptions,
764
+ ): CipherOCB;
765
+ function createCipheriv(
766
+ algorithm: CipherGCMTypes,
767
+ key: CipherKey,
768
+ iv: BinaryLike,
769
+ options?: CipherGCMOptions,
770
+ ): CipherGCM;
771
+ function createCipheriv(
772
+ algorithm: string,
773
+ key: CipherKey,
774
+ iv: BinaryLike | null,
775
+ options?: stream.TransformOptions,
776
+ ): Cipher;
757
777
  /**
758
778
  * Instances of the `Cipher` class are used to encrypt data. The class can be
759
779
  * used in one of two ways:
@@ -925,7 +945,7 @@ declare module 'node:crypto' {
925
945
  buffer: NodeJS.ArrayBufferView,
926
946
  options: {
927
947
  plaintextLength: number;
928
- }
948
+ },
929
949
  ): this;
930
950
  getAuthTag(): Buffer;
931
951
  }
@@ -934,7 +954,7 @@ declare module 'node:crypto' {
934
954
  buffer: NodeJS.ArrayBufferView,
935
955
  options?: {
936
956
  plaintextLength: number;
937
- }
957
+ },
938
958
  ): this;
939
959
  getAuthTag(): Buffer;
940
960
  }
@@ -943,7 +963,7 @@ declare module 'node:crypto' {
943
963
  buffer: NodeJS.ArrayBufferView,
944
964
  options?: {
945
965
  plaintextLength: number;
946
- }
966
+ },
947
967
  ): this;
948
968
  getAuthTag(): Buffer;
949
969
  }
@@ -1003,10 +1023,30 @@ declare module 'node:crypto' {
1003
1023
  * @since v0.1.94
1004
1024
  * @param options `stream.transform` options
1005
1025
  */
1006
- function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM;
1007
- function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB;
1008
- function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
1009
- function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
1026
+ function createDecipheriv(
1027
+ algorithm: CipherCCMTypes,
1028
+ key: CipherKey,
1029
+ iv: BinaryLike,
1030
+ options: CipherCCMOptions,
1031
+ ): DecipherCCM;
1032
+ function createDecipheriv(
1033
+ algorithm: CipherOCBTypes,
1034
+ key: CipherKey,
1035
+ iv: BinaryLike,
1036
+ options: CipherOCBOptions,
1037
+ ): DecipherOCB;
1038
+ function createDecipheriv(
1039
+ algorithm: CipherGCMTypes,
1040
+ key: CipherKey,
1041
+ iv: BinaryLike,
1042
+ options?: CipherGCMOptions,
1043
+ ): DecipherGCM;
1044
+ function createDecipheriv(
1045
+ algorithm: string,
1046
+ key: CipherKey,
1047
+ iv: BinaryLike | null,
1048
+ options?: stream.TransformOptions,
1049
+ ): Decipher;
1010
1050
  /**
1011
1051
  * Instances of the `Decipher` class are used to decrypt data. The class can be
1012
1052
  * used in one of two ways:
@@ -1164,7 +1204,7 @@ declare module 'node:crypto' {
1164
1204
  buffer: NodeJS.ArrayBufferView,
1165
1205
  options: {
1166
1206
  plaintextLength: number;
1167
- }
1207
+ },
1168
1208
  ): this;
1169
1209
  }
1170
1210
  interface DecipherGCM extends Decipher {
@@ -1173,7 +1213,7 @@ declare module 'node:crypto' {
1173
1213
  buffer: NodeJS.ArrayBufferView,
1174
1214
  options?: {
1175
1215
  plaintextLength: number;
1176
- }
1216
+ },
1177
1217
  ): this;
1178
1218
  }
1179
1219
  interface DecipherOCB extends Decipher {
@@ -1182,20 +1222,20 @@ declare module 'node:crypto' {
1182
1222
  buffer: NodeJS.ArrayBufferView,
1183
1223
  options?: {
1184
1224
  plaintextLength: number;
1185
- }
1225
+ },
1186
1226
  ): this;
1187
1227
  }
1188
1228
  interface PrivateKeyInput {
1189
1229
  key: string | Buffer;
1190
1230
  format?: KeyFormat | undefined;
1191
- type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined;
1231
+ type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
1192
1232
  passphrase?: string | Buffer | undefined;
1193
1233
  encoding?: string | undefined;
1194
1234
  }
1195
1235
  interface PublicKeyInput {
1196
1236
  key: string | Buffer;
1197
1237
  format?: KeyFormat | undefined;
1198
- type?: 'pkcs1' | 'spki' | undefined;
1238
+ type?: "pkcs1" | "spki" | undefined;
1199
1239
  encoding?: string | undefined;
1200
1240
  }
1201
1241
  /**
@@ -1215,11 +1255,11 @@ declare module 'node:crypto' {
1215
1255
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1216
1256
  */
1217
1257
  function generateKey(
1218
- type: 'hmac' | 'aes',
1258
+ type: "hmac" | "aes",
1219
1259
  options: {
1220
1260
  length: number;
1221
1261
  },
1222
- callback: (err: Error | null, key: KeyObject) => void
1262
+ callback: (err: Error | null, key: KeyObject) => void,
1223
1263
  ): void;
1224
1264
  /**
1225
1265
  * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
@@ -1236,14 +1276,14 @@ declare module 'node:crypto' {
1236
1276
  * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1237
1277
  */
1238
1278
  function generateKeySync(
1239
- type: 'hmac' | 'aes',
1279
+ type: "hmac" | "aes",
1240
1280
  options: {
1241
1281
  length: number;
1242
- }
1282
+ },
1243
1283
  ): KeyObject;
1244
1284
  interface JsonWebKeyInput {
1245
1285
  key: JsonWebKey;
1246
- format: 'jwk';
1286
+ format: "jwk";
1247
1287
  }
1248
1288
  /**
1249
1289
  * Creates and returns a new key object containing a private key. If `key` is a
@@ -1290,7 +1330,7 @@ declare module 'node:crypto' {
1290
1330
  * @param options `stream.Writable` options
1291
1331
  */
1292
1332
  function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
1293
- type DSAEncoding = 'der' | 'ieee-p1363';
1333
+ type DSAEncoding = "der" | "ieee-p1363";
1294
1334
  interface SigningOptions {
1295
1335
  /**
1296
1336
  * @see crypto.constants.RSA_PKCS1_PADDING
@@ -1399,7 +1439,10 @@ declare module 'node:crypto' {
1399
1439
  * @since v0.1.92
1400
1440
  */
1401
1441
  sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
1402
- sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string;
1442
+ sign(
1443
+ privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
1444
+ outputFormat: BinaryToTextEncoding,
1445
+ ): string;
1403
1446
  }
1404
1447
  /**
1405
1448
  * Creates and returns a `Verify` object that uses the given algorithm.
@@ -1462,8 +1505,15 @@ declare module 'node:crypto' {
1462
1505
  * be passed instead of a public key.
1463
1506
  * @since v0.1.92
1464
1507
  */
1465
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean;
1466
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
1508
+ verify(
1509
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
1510
+ signature: NodeJS.ArrayBufferView,
1511
+ ): boolean;
1512
+ verify(
1513
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
1514
+ signature: string,
1515
+ signature_format?: BinaryToTextEncoding,
1516
+ ): boolean;
1467
1517
  }
1468
1518
  /**
1469
1519
  * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
@@ -1482,10 +1532,26 @@ declare module 'node:crypto' {
1482
1532
  * @param generatorEncoding The `encoding` of the `generator` string.
1483
1533
  */
1484
1534
  function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
1485
- function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman;
1486
- function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
1487
- function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman;
1488
- function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
1535
+ function createDiffieHellman(
1536
+ prime: ArrayBuffer | NodeJS.ArrayBufferView,
1537
+ generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
1538
+ ): DiffieHellman;
1539
+ function createDiffieHellman(
1540
+ prime: ArrayBuffer | NodeJS.ArrayBufferView,
1541
+ generator: string,
1542
+ generatorEncoding: BinaryToTextEncoding,
1543
+ ): DiffieHellman;
1544
+ function createDiffieHellman(
1545
+ prime: string,
1546
+ primeEncoding: BinaryToTextEncoding,
1547
+ generator?: number | ArrayBuffer | NodeJS.ArrayBufferView,
1548
+ ): DiffieHellman;
1549
+ function createDiffieHellman(
1550
+ prime: string,
1551
+ primeEncoding: BinaryToTextEncoding,
1552
+ generator: string,
1553
+ generatorEncoding: BinaryToTextEncoding,
1554
+ ): DiffieHellman;
1489
1555
  /**
1490
1556
  * The `DiffieHellman` class is a utility for creating Diffie-Hellman key
1491
1557
  * exchanges.
@@ -1543,8 +1609,16 @@ declare module 'node:crypto' {
1543
1609
  */
1544
1610
  computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
1545
1611
  computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
1546
- computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string;
1547
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
1612
+ computeSecret(
1613
+ otherPublicKey: NodeJS.ArrayBufferView,
1614
+ inputEncoding: null,
1615
+ outputEncoding: BinaryToTextEncoding,
1616
+ ): string;
1617
+ computeSecret(
1618
+ otherPublicKey: string,
1619
+ inputEncoding: BinaryToTextEncoding,
1620
+ outputEncoding: BinaryToTextEncoding,
1621
+ ): string;
1548
1622
  /**
1549
1623
  * Returns the Diffie-Hellman prime in the specified `encoding`.
1550
1624
  * If `encoding` is provided a string is
@@ -1642,7 +1716,7 @@ declare module 'node:crypto' {
1642
1716
  (name: string): DiffieHellmanGroup;
1643
1717
  readonly prototype: DiffieHellmanGroup;
1644
1718
  }
1645
- type DiffieHellmanGroup = Omit<DiffieHellman, 'setPublicKey' | 'setPrivateKey'>;
1719
+ type DiffieHellmanGroup = Omit<DiffieHellman, "setPublicKey" | "setPrivateKey">;
1646
1720
  /**
1647
1721
  * Creates a predefined `DiffieHellmanGroup` key exchange object. The
1648
1722
  * 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'`,
@@ -1729,7 +1803,14 @@ declare module 'node:crypto' {
1729
1803
  * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
1730
1804
  * @since v0.5.5
1731
1805
  */
1732
- function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void;
1806
+ function pbkdf2(
1807
+ password: BinaryLike,
1808
+ salt: BinaryLike,
1809
+ iterations: number,
1810
+ keylen: number,
1811
+ digest: string,
1812
+ callback: (err: Error | null, derivedKey: Buffer) => void,
1813
+ ): void;
1733
1814
  /**
1734
1815
  * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
1735
1816
  * implementation. A selected HMAC digest algorithm specified by `digest` is
@@ -1772,7 +1853,13 @@ declare module 'node:crypto' {
1772
1853
  * An array of supported digest functions can be retrieved using {@link getHashes}.
1773
1854
  * @since v0.9.3
1774
1855
  */
1775
- function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer;
1856
+ function pbkdf2Sync(
1857
+ password: BinaryLike,
1858
+ salt: BinaryLike,
1859
+ iterations: number,
1860
+ keylen: number,
1861
+ digest: string,
1862
+ ): Buffer;
1776
1863
  /**
1777
1864
  * Generates cryptographically strong pseudorandom data. The `size` argument
1778
1865
  * is a number indicating the number of bytes to generate.
@@ -1996,9 +2083,21 @@ declare module 'node:crypto' {
1996
2083
  * @param [size=buffer.length - offset]
1997
2084
  * @param callback `function(err, buf) {}`.
1998
2085
  */
1999
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
2000
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
2001
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
2086
+ function randomFill<T extends NodeJS.ArrayBufferView>(
2087
+ buffer: T,
2088
+ callback: (err: Error | null, buf: T) => void,
2089
+ ): void;
2090
+ function randomFill<T extends NodeJS.ArrayBufferView>(
2091
+ buffer: T,
2092
+ offset: number,
2093
+ callback: (err: Error | null, buf: T) => void,
2094
+ ): void;
2095
+ function randomFill<T extends NodeJS.ArrayBufferView>(
2096
+ buffer: T,
2097
+ offset: number,
2098
+ size: number,
2099
+ callback: (err: Error | null, buf: T) => void,
2100
+ ): void;
2002
2101
  interface ScryptOptions {
2003
2102
  cost?: number | undefined;
2004
2103
  blockSize?: number | undefined;
@@ -2042,8 +2141,19 @@ declare module 'node:crypto' {
2042
2141
  * ```
2043
2142
  * @since v10.5.0
2044
2143
  */
2045
- function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void;
2046
- function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void;
2144
+ function scrypt(
2145
+ password: BinaryLike,
2146
+ salt: BinaryLike,
2147
+ keylen: number,
2148
+ callback: (err: Error | null, derivedKey: Buffer) => void,
2149
+ ): void;
2150
+ function scrypt(
2151
+ password: BinaryLike,
2152
+ salt: BinaryLike,
2153
+ keylen: number,
2154
+ options: ScryptOptions,
2155
+ callback: (err: Error | null, derivedKey: Buffer) => void,
2156
+ ): void;
2047
2157
  /**
2048
2158
  * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
2049
2159
  * key derivation function that is designed to be expensive computationally and
@@ -2256,8 +2366,8 @@ declare module 'node:crypto' {
2256
2366
  key: BinaryLike,
2257
2367
  curve: string,
2258
2368
  inputEncoding?: BinaryToTextEncoding,
2259
- outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url',
2260
- format?: 'uncompressed' | 'compressed' | 'hybrid'
2369
+ outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
2370
+ format?: "uncompressed" | "compressed" | "hybrid",
2261
2371
  ): Buffer | string;
2262
2372
  /**
2263
2373
  * Generates private and public EC Diffie-Hellman key values, and returns
@@ -2293,7 +2403,11 @@ declare module 'node:crypto' {
2293
2403
  computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
2294
2404
  computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
2295
2405
  computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
2296
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
2406
+ computeSecret(
2407
+ otherPublicKey: string,
2408
+ inputEncoding: BinaryToTextEncoding,
2409
+ outputEncoding: BinaryToTextEncoding,
2410
+ ): string;
2297
2411
  /**
2298
2412
  * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
2299
2413
  * returned.
@@ -2359,8 +2473,8 @@ declare module 'node:crypto' {
2359
2473
  function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
2360
2474
  /** @deprecated since v10.0.0 */
2361
2475
  const DEFAULT_ENCODING: BufferEncoding;
2362
- type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
2363
- type KeyFormat = 'pem' | 'der' | 'jwk';
2476
+ type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448";
2477
+ type KeyFormat = "pem" | "der" | "jwk";
2364
2478
  interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
2365
2479
  format: T;
2366
2480
  cipher?: string | undefined;
@@ -2435,11 +2549,11 @@ declare module 'node:crypto' {
2435
2549
  */
2436
2550
  publicExponent?: number | undefined;
2437
2551
  publicKeyEncoding: {
2438
- type: 'pkcs1' | 'spki';
2552
+ type: "pkcs1" | "spki";
2439
2553
  format: PubF;
2440
2554
  };
2441
2555
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2442
- type: 'pkcs1' | 'pkcs8';
2556
+ type: "pkcs1" | "pkcs8";
2443
2557
  };
2444
2558
  }
2445
2559
  interface RSAPSSKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
@@ -2465,11 +2579,11 @@ declare module 'node:crypto' {
2465
2579
  */
2466
2580
  saltLength?: string;
2467
2581
  publicKeyEncoding: {
2468
- type: 'spki';
2582
+ type: "spki";
2469
2583
  format: PubF;
2470
2584
  };
2471
2585
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2472
- type: 'pkcs8';
2586
+ type: "pkcs8";
2473
2587
  };
2474
2588
  }
2475
2589
  interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
@@ -2482,11 +2596,11 @@ declare module 'node:crypto' {
2482
2596
  */
2483
2597
  divisorLength: number;
2484
2598
  publicKeyEncoding: {
2485
- type: 'spki';
2599
+ type: "spki";
2486
2600
  format: PubF;
2487
2601
  };
2488
2602
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2489
- type: 'pkcs8';
2603
+ type: "pkcs8";
2490
2604
  };
2491
2605
  }
2492
2606
  interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
@@ -2495,47 +2609,47 @@ declare module 'node:crypto' {
2495
2609
  */
2496
2610
  namedCurve: string;
2497
2611
  publicKeyEncoding: {
2498
- type: 'pkcs1' | 'spki';
2612
+ type: "pkcs1" | "spki";
2499
2613
  format: PubF;
2500
2614
  };
2501
2615
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2502
- type: 'sec1' | 'pkcs8';
2616
+ type: "sec1" | "pkcs8";
2503
2617
  };
2504
2618
  }
2505
2619
  interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2506
2620
  publicKeyEncoding: {
2507
- type: 'spki';
2621
+ type: "spki";
2508
2622
  format: PubF;
2509
2623
  };
2510
2624
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2511
- type: 'pkcs8';
2625
+ type: "pkcs8";
2512
2626
  };
2513
2627
  }
2514
2628
  interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2515
2629
  publicKeyEncoding: {
2516
- type: 'spki';
2630
+ type: "spki";
2517
2631
  format: PubF;
2518
2632
  };
2519
2633
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2520
- type: 'pkcs8';
2634
+ type: "pkcs8";
2521
2635
  };
2522
2636
  }
2523
2637
  interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2524
2638
  publicKeyEncoding: {
2525
- type: 'spki';
2639
+ type: "spki";
2526
2640
  format: PubF;
2527
2641
  };
2528
2642
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2529
- type: 'pkcs8';
2643
+ type: "pkcs8";
2530
2644
  };
2531
2645
  }
2532
2646
  interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2533
2647
  publicKeyEncoding: {
2534
- type: 'spki';
2648
+ type: "spki";
2535
2649
  format: PubF;
2536
2650
  };
2537
2651
  privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2538
- type: 'pkcs8';
2652
+ type: "pkcs8";
2539
2653
  };
2540
2654
  }
2541
2655
  interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
@@ -2583,46 +2697,142 @@ declare module 'node:crypto' {
2583
2697
  * @since v10.12.0
2584
2698
  * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
2585
2699
  */
2586
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2587
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2588
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2589
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2590
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2591
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2592
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2593
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2594
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2595
- function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2596
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2597
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2598
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2599
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2600
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2601
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2602
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2603
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2604
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2605
- function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2606
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2607
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2608
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2609
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2610
- function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2611
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2612
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2613
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2614
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2615
- function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2616
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2617
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2618
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2619
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2620
- function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2621
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
2622
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
2623
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
2624
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
2625
- function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2700
+ function generateKeyPairSync(
2701
+ type: "rsa",
2702
+ options: RSAKeyPairOptions<"pem", "pem">,
2703
+ ): KeyPairSyncResult<string, string>;
2704
+ function generateKeyPairSync(
2705
+ type: "rsa",
2706
+ options: RSAKeyPairOptions<"pem", "der">,
2707
+ ): KeyPairSyncResult<string, Buffer>;
2708
+ function generateKeyPairSync(
2709
+ type: "rsa",
2710
+ options: RSAKeyPairOptions<"der", "pem">,
2711
+ ): KeyPairSyncResult<Buffer, string>;
2712
+ function generateKeyPairSync(
2713
+ type: "rsa",
2714
+ options: RSAKeyPairOptions<"der", "der">,
2715
+ ): KeyPairSyncResult<Buffer, Buffer>;
2716
+ function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2717
+ function generateKeyPairSync(
2718
+ type: "rsa-pss",
2719
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
2720
+ ): KeyPairSyncResult<string, string>;
2721
+ function generateKeyPairSync(
2722
+ type: "rsa-pss",
2723
+ options: RSAPSSKeyPairOptions<"pem", "der">,
2724
+ ): KeyPairSyncResult<string, Buffer>;
2725
+ function generateKeyPairSync(
2726
+ type: "rsa-pss",
2727
+ options: RSAPSSKeyPairOptions<"der", "pem">,
2728
+ ): KeyPairSyncResult<Buffer, string>;
2729
+ function generateKeyPairSync(
2730
+ type: "rsa-pss",
2731
+ options: RSAPSSKeyPairOptions<"der", "der">,
2732
+ ): KeyPairSyncResult<Buffer, Buffer>;
2733
+ function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2734
+ function generateKeyPairSync(
2735
+ type: "dsa",
2736
+ options: DSAKeyPairOptions<"pem", "pem">,
2737
+ ): KeyPairSyncResult<string, string>;
2738
+ function generateKeyPairSync(
2739
+ type: "dsa",
2740
+ options: DSAKeyPairOptions<"pem", "der">,
2741
+ ): KeyPairSyncResult<string, Buffer>;
2742
+ function generateKeyPairSync(
2743
+ type: "dsa",
2744
+ options: DSAKeyPairOptions<"der", "pem">,
2745
+ ): KeyPairSyncResult<Buffer, string>;
2746
+ function generateKeyPairSync(
2747
+ type: "dsa",
2748
+ options: DSAKeyPairOptions<"der", "der">,
2749
+ ): KeyPairSyncResult<Buffer, Buffer>;
2750
+ function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2751
+ function generateKeyPairSync(
2752
+ type: "ec",
2753
+ options: ECKeyPairOptions<"pem", "pem">,
2754
+ ): KeyPairSyncResult<string, string>;
2755
+ function generateKeyPairSync(
2756
+ type: "ec",
2757
+ options: ECKeyPairOptions<"pem", "der">,
2758
+ ): KeyPairSyncResult<string, Buffer>;
2759
+ function generateKeyPairSync(
2760
+ type: "ec",
2761
+ options: ECKeyPairOptions<"der", "pem">,
2762
+ ): KeyPairSyncResult<Buffer, string>;
2763
+ function generateKeyPairSync(
2764
+ type: "ec",
2765
+ options: ECKeyPairOptions<"der", "der">,
2766
+ ): KeyPairSyncResult<Buffer, Buffer>;
2767
+ function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2768
+ function generateKeyPairSync(
2769
+ type: "ed25519",
2770
+ options: ED25519KeyPairOptions<"pem", "pem">,
2771
+ ): KeyPairSyncResult<string, string>;
2772
+ function generateKeyPairSync(
2773
+ type: "ed25519",
2774
+ options: ED25519KeyPairOptions<"pem", "der">,
2775
+ ): KeyPairSyncResult<string, Buffer>;
2776
+ function generateKeyPairSync(
2777
+ type: "ed25519",
2778
+ options: ED25519KeyPairOptions<"der", "pem">,
2779
+ ): KeyPairSyncResult<Buffer, string>;
2780
+ function generateKeyPairSync(
2781
+ type: "ed25519",
2782
+ options: ED25519KeyPairOptions<"der", "der">,
2783
+ ): KeyPairSyncResult<Buffer, Buffer>;
2784
+ function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2785
+ function generateKeyPairSync(
2786
+ type: "ed448",
2787
+ options: ED448KeyPairOptions<"pem", "pem">,
2788
+ ): KeyPairSyncResult<string, string>;
2789
+ function generateKeyPairSync(
2790
+ type: "ed448",
2791
+ options: ED448KeyPairOptions<"pem", "der">,
2792
+ ): KeyPairSyncResult<string, Buffer>;
2793
+ function generateKeyPairSync(
2794
+ type: "ed448",
2795
+ options: ED448KeyPairOptions<"der", "pem">,
2796
+ ): KeyPairSyncResult<Buffer, string>;
2797
+ function generateKeyPairSync(
2798
+ type: "ed448",
2799
+ options: ED448KeyPairOptions<"der", "der">,
2800
+ ): KeyPairSyncResult<Buffer, Buffer>;
2801
+ function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2802
+ function generateKeyPairSync(
2803
+ type: "x25519",
2804
+ options: X25519KeyPairOptions<"pem", "pem">,
2805
+ ): KeyPairSyncResult<string, string>;
2806
+ function generateKeyPairSync(
2807
+ type: "x25519",
2808
+ options: X25519KeyPairOptions<"pem", "der">,
2809
+ ): KeyPairSyncResult<string, Buffer>;
2810
+ function generateKeyPairSync(
2811
+ type: "x25519",
2812
+ options: X25519KeyPairOptions<"der", "pem">,
2813
+ ): KeyPairSyncResult<Buffer, string>;
2814
+ function generateKeyPairSync(
2815
+ type: "x25519",
2816
+ options: X25519KeyPairOptions<"der", "der">,
2817
+ ): KeyPairSyncResult<Buffer, Buffer>;
2818
+ function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2819
+ function generateKeyPairSync(
2820
+ type: "x448",
2821
+ options: X448KeyPairOptions<"pem", "pem">,
2822
+ ): KeyPairSyncResult<string, string>;
2823
+ function generateKeyPairSync(
2824
+ type: "x448",
2825
+ options: X448KeyPairOptions<"pem", "der">,
2826
+ ): KeyPairSyncResult<string, Buffer>;
2827
+ function generateKeyPairSync(
2828
+ type: "x448",
2829
+ options: X448KeyPairOptions<"der", "pem">,
2830
+ ): KeyPairSyncResult<Buffer, string>;
2831
+ function generateKeyPairSync(
2832
+ type: "x448",
2833
+ options: X448KeyPairOptions<"der", "der">,
2834
+ ): KeyPairSyncResult<Buffer, Buffer>;
2835
+ function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2626
2836
  /**
2627
2837
  * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
2628
2838
  * Ed25519, Ed448, X25519, X448, and DH are currently supported.
@@ -2662,279 +2872,448 @@ declare module 'node:crypto' {
2662
2872
  * @since v10.12.0
2663
2873
  * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
2664
2874
  */
2665
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2666
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2667
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2668
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2669
- function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2670
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2671
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2672
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2673
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2674
- function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2675
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2676
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2677
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2678
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2679
- function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2680
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2681
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2682
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2683
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2684
- function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2685
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2686
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2687
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2688
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2689
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2690
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2691
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2692
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2693
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2694
- function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2695
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2696
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2697
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2698
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2699
- function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2700
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
2701
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
2702
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
2703
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
2704
- function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
2875
+ function generateKeyPair(
2876
+ type: "rsa",
2877
+ options: RSAKeyPairOptions<"pem", "pem">,
2878
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2879
+ ): void;
2880
+ function generateKeyPair(
2881
+ type: "rsa",
2882
+ options: RSAKeyPairOptions<"pem", "der">,
2883
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2884
+ ): void;
2885
+ function generateKeyPair(
2886
+ type: "rsa",
2887
+ options: RSAKeyPairOptions<"der", "pem">,
2888
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2889
+ ): void;
2890
+ function generateKeyPair(
2891
+ type: "rsa",
2892
+ options: RSAKeyPairOptions<"der", "der">,
2893
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2894
+ ): void;
2895
+ function generateKeyPair(
2896
+ type: "rsa",
2897
+ options: RSAKeyPairKeyObjectOptions,
2898
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2899
+ ): void;
2900
+ function generateKeyPair(
2901
+ type: "rsa-pss",
2902
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
2903
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2904
+ ): void;
2905
+ function generateKeyPair(
2906
+ type: "rsa-pss",
2907
+ options: RSAPSSKeyPairOptions<"pem", "der">,
2908
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2909
+ ): void;
2910
+ function generateKeyPair(
2911
+ type: "rsa-pss",
2912
+ options: RSAPSSKeyPairOptions<"der", "pem">,
2913
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2914
+ ): void;
2915
+ function generateKeyPair(
2916
+ type: "rsa-pss",
2917
+ options: RSAPSSKeyPairOptions<"der", "der">,
2918
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2919
+ ): void;
2920
+ function generateKeyPair(
2921
+ type: "rsa-pss",
2922
+ options: RSAPSSKeyPairKeyObjectOptions,
2923
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2924
+ ): void;
2925
+ function generateKeyPair(
2926
+ type: "dsa",
2927
+ options: DSAKeyPairOptions<"pem", "pem">,
2928
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2929
+ ): void;
2930
+ function generateKeyPair(
2931
+ type: "dsa",
2932
+ options: DSAKeyPairOptions<"pem", "der">,
2933
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2934
+ ): void;
2935
+ function generateKeyPair(
2936
+ type: "dsa",
2937
+ options: DSAKeyPairOptions<"der", "pem">,
2938
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2939
+ ): void;
2940
+ function generateKeyPair(
2941
+ type: "dsa",
2942
+ options: DSAKeyPairOptions<"der", "der">,
2943
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2944
+ ): void;
2945
+ function generateKeyPair(
2946
+ type: "dsa",
2947
+ options: DSAKeyPairKeyObjectOptions,
2948
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2949
+ ): void;
2950
+ function generateKeyPair(
2951
+ type: "ec",
2952
+ options: ECKeyPairOptions<"pem", "pem">,
2953
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2954
+ ): void;
2955
+ function generateKeyPair(
2956
+ type: "ec",
2957
+ options: ECKeyPairOptions<"pem", "der">,
2958
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2959
+ ): void;
2960
+ function generateKeyPair(
2961
+ type: "ec",
2962
+ options: ECKeyPairOptions<"der", "pem">,
2963
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2964
+ ): void;
2965
+ function generateKeyPair(
2966
+ type: "ec",
2967
+ options: ECKeyPairOptions<"der", "der">,
2968
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2969
+ ): void;
2970
+ function generateKeyPair(
2971
+ type: "ec",
2972
+ options: ECKeyPairKeyObjectOptions,
2973
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2974
+ ): void;
2975
+ function generateKeyPair(
2976
+ type: "ed25519",
2977
+ options: ED25519KeyPairOptions<"pem", "pem">,
2978
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2979
+ ): void;
2980
+ function generateKeyPair(
2981
+ type: "ed25519",
2982
+ options: ED25519KeyPairOptions<"pem", "der">,
2983
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
2984
+ ): void;
2985
+ function generateKeyPair(
2986
+ type: "ed25519",
2987
+ options: ED25519KeyPairOptions<"der", "pem">,
2988
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
2989
+ ): void;
2990
+ function generateKeyPair(
2991
+ type: "ed25519",
2992
+ options: ED25519KeyPairOptions<"der", "der">,
2993
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
2994
+ ): void;
2995
+ function generateKeyPair(
2996
+ type: "ed25519",
2997
+ options: ED25519KeyPairKeyObjectOptions | undefined,
2998
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2999
+ ): void;
3000
+ function generateKeyPair(
3001
+ type: "ed448",
3002
+ options: ED448KeyPairOptions<"pem", "pem">,
3003
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3004
+ ): void;
3005
+ function generateKeyPair(
3006
+ type: "ed448",
3007
+ options: ED448KeyPairOptions<"pem", "der">,
3008
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3009
+ ): void;
3010
+ function generateKeyPair(
3011
+ type: "ed448",
3012
+ options: ED448KeyPairOptions<"der", "pem">,
3013
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3014
+ ): void;
3015
+ function generateKeyPair(
3016
+ type: "ed448",
3017
+ options: ED448KeyPairOptions<"der", "der">,
3018
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3019
+ ): void;
3020
+ function generateKeyPair(
3021
+ type: "ed448",
3022
+ options: ED448KeyPairKeyObjectOptions | undefined,
3023
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3024
+ ): void;
3025
+ function generateKeyPair(
3026
+ type: "x25519",
3027
+ options: X25519KeyPairOptions<"pem", "pem">,
3028
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3029
+ ): void;
3030
+ function generateKeyPair(
3031
+ type: "x25519",
3032
+ options: X25519KeyPairOptions<"pem", "der">,
3033
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3034
+ ): void;
3035
+ function generateKeyPair(
3036
+ type: "x25519",
3037
+ options: X25519KeyPairOptions<"der", "pem">,
3038
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3039
+ ): void;
3040
+ function generateKeyPair(
3041
+ type: "x25519",
3042
+ options: X25519KeyPairOptions<"der", "der">,
3043
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3044
+ ): void;
3045
+ function generateKeyPair(
3046
+ type: "x25519",
3047
+ options: X25519KeyPairKeyObjectOptions | undefined,
3048
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3049
+ ): void;
3050
+ function generateKeyPair(
3051
+ type: "x448",
3052
+ options: X448KeyPairOptions<"pem", "pem">,
3053
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3054
+ ): void;
3055
+ function generateKeyPair(
3056
+ type: "x448",
3057
+ options: X448KeyPairOptions<"pem", "der">,
3058
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3059
+ ): void;
3060
+ function generateKeyPair(
3061
+ type: "x448",
3062
+ options: X448KeyPairOptions<"der", "pem">,
3063
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3064
+ ): void;
3065
+ function generateKeyPair(
3066
+ type: "x448",
3067
+ options: X448KeyPairOptions<"der", "der">,
3068
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3069
+ ): void;
3070
+ function generateKeyPair(
3071
+ type: "x448",
3072
+ options: X448KeyPairKeyObjectOptions | undefined,
3073
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3074
+ ): void;
2705
3075
  namespace generateKeyPair {
2706
3076
  function __promisify__(
2707
- type: 'rsa',
2708
- options: RSAKeyPairOptions<'pem', 'pem'>
3077
+ type: "rsa",
3078
+ options: RSAKeyPairOptions<"pem", "pem">,
2709
3079
  ): Promise<{
2710
3080
  publicKey: string;
2711
3081
  privateKey: string;
2712
3082
  }>;
2713
3083
  function __promisify__(
2714
- type: 'rsa',
2715
- options: RSAKeyPairOptions<'pem', 'der'>
3084
+ type: "rsa",
3085
+ options: RSAKeyPairOptions<"pem", "der">,
2716
3086
  ): Promise<{
2717
3087
  publicKey: string;
2718
3088
  privateKey: Buffer;
2719
3089
  }>;
2720
3090
  function __promisify__(
2721
- type: 'rsa',
2722
- options: RSAKeyPairOptions<'der', 'pem'>
3091
+ type: "rsa",
3092
+ options: RSAKeyPairOptions<"der", "pem">,
2723
3093
  ): Promise<{
2724
3094
  publicKey: Buffer;
2725
3095
  privateKey: string;
2726
3096
  }>;
2727
3097
  function __promisify__(
2728
- type: 'rsa',
2729
- options: RSAKeyPairOptions<'der', 'der'>
3098
+ type: "rsa",
3099
+ options: RSAKeyPairOptions<"der", "der">,
2730
3100
  ): Promise<{
2731
3101
  publicKey: Buffer;
2732
3102
  privateKey: Buffer;
2733
3103
  }>;
2734
- function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3104
+ function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2735
3105
  function __promisify__(
2736
- type: 'rsa-pss',
2737
- options: RSAPSSKeyPairOptions<'pem', 'pem'>
3106
+ type: "rsa-pss",
3107
+ options: RSAPSSKeyPairOptions<"pem", "pem">,
2738
3108
  ): Promise<{
2739
3109
  publicKey: string;
2740
3110
  privateKey: string;
2741
3111
  }>;
2742
3112
  function __promisify__(
2743
- type: 'rsa-pss',
2744
- options: RSAPSSKeyPairOptions<'pem', 'der'>
3113
+ type: "rsa-pss",
3114
+ options: RSAPSSKeyPairOptions<"pem", "der">,
2745
3115
  ): Promise<{
2746
3116
  publicKey: string;
2747
3117
  privateKey: Buffer;
2748
3118
  }>;
2749
3119
  function __promisify__(
2750
- type: 'rsa-pss',
2751
- options: RSAPSSKeyPairOptions<'der', 'pem'>
3120
+ type: "rsa-pss",
3121
+ options: RSAPSSKeyPairOptions<"der", "pem">,
2752
3122
  ): Promise<{
2753
3123
  publicKey: Buffer;
2754
3124
  privateKey: string;
2755
3125
  }>;
2756
3126
  function __promisify__(
2757
- type: 'rsa-pss',
2758
- options: RSAPSSKeyPairOptions<'der', 'der'>
3127
+ type: "rsa-pss",
3128
+ options: RSAPSSKeyPairOptions<"der", "der">,
2759
3129
  ): Promise<{
2760
3130
  publicKey: Buffer;
2761
3131
  privateKey: Buffer;
2762
3132
  }>;
2763
- function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2764
3133
  function __promisify__(
2765
- type: 'dsa',
2766
- options: DSAKeyPairOptions<'pem', 'pem'>
3134
+ type: "rsa-pss",
3135
+ options: RSAPSSKeyPairKeyObjectOptions,
3136
+ ): Promise<KeyPairKeyObjectResult>;
3137
+ function __promisify__(
3138
+ type: "dsa",
3139
+ options: DSAKeyPairOptions<"pem", "pem">,
2767
3140
  ): Promise<{
2768
3141
  publicKey: string;
2769
3142
  privateKey: string;
2770
3143
  }>;
2771
3144
  function __promisify__(
2772
- type: 'dsa',
2773
- options: DSAKeyPairOptions<'pem', 'der'>
3145
+ type: "dsa",
3146
+ options: DSAKeyPairOptions<"pem", "der">,
2774
3147
  ): Promise<{
2775
3148
  publicKey: string;
2776
3149
  privateKey: Buffer;
2777
3150
  }>;
2778
3151
  function __promisify__(
2779
- type: 'dsa',
2780
- options: DSAKeyPairOptions<'der', 'pem'>
3152
+ type: "dsa",
3153
+ options: DSAKeyPairOptions<"der", "pem">,
2781
3154
  ): Promise<{
2782
3155
  publicKey: Buffer;
2783
3156
  privateKey: string;
2784
3157
  }>;
2785
3158
  function __promisify__(
2786
- type: 'dsa',
2787
- options: DSAKeyPairOptions<'der', 'der'>
3159
+ type: "dsa",
3160
+ options: DSAKeyPairOptions<"der", "der">,
2788
3161
  ): Promise<{
2789
3162
  publicKey: Buffer;
2790
3163
  privateKey: Buffer;
2791
3164
  }>;
2792
- function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3165
+ function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2793
3166
  function __promisify__(
2794
- type: 'ec',
2795
- options: ECKeyPairOptions<'pem', 'pem'>
3167
+ type: "ec",
3168
+ options: ECKeyPairOptions<"pem", "pem">,
2796
3169
  ): Promise<{
2797
3170
  publicKey: string;
2798
3171
  privateKey: string;
2799
3172
  }>;
2800
3173
  function __promisify__(
2801
- type: 'ec',
2802
- options: ECKeyPairOptions<'pem', 'der'>
3174
+ type: "ec",
3175
+ options: ECKeyPairOptions<"pem", "der">,
2803
3176
  ): Promise<{
2804
3177
  publicKey: string;
2805
3178
  privateKey: Buffer;
2806
3179
  }>;
2807
3180
  function __promisify__(
2808
- type: 'ec',
2809
- options: ECKeyPairOptions<'der', 'pem'>
3181
+ type: "ec",
3182
+ options: ECKeyPairOptions<"der", "pem">,
2810
3183
  ): Promise<{
2811
3184
  publicKey: Buffer;
2812
3185
  privateKey: string;
2813
3186
  }>;
2814
3187
  function __promisify__(
2815
- type: 'ec',
2816
- options: ECKeyPairOptions<'der', 'der'>
3188
+ type: "ec",
3189
+ options: ECKeyPairOptions<"der", "der">,
2817
3190
  ): Promise<{
2818
3191
  publicKey: Buffer;
2819
3192
  privateKey: Buffer;
2820
3193
  }>;
2821
- function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3194
+ function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2822
3195
  function __promisify__(
2823
- type: 'ed25519',
2824
- options: ED25519KeyPairOptions<'pem', 'pem'>
3196
+ type: "ed25519",
3197
+ options: ED25519KeyPairOptions<"pem", "pem">,
2825
3198
  ): Promise<{
2826
3199
  publicKey: string;
2827
3200
  privateKey: string;
2828
3201
  }>;
2829
3202
  function __promisify__(
2830
- type: 'ed25519',
2831
- options: ED25519KeyPairOptions<'pem', 'der'>
3203
+ type: "ed25519",
3204
+ options: ED25519KeyPairOptions<"pem", "der">,
2832
3205
  ): Promise<{
2833
3206
  publicKey: string;
2834
3207
  privateKey: Buffer;
2835
3208
  }>;
2836
3209
  function __promisify__(
2837
- type: 'ed25519',
2838
- options: ED25519KeyPairOptions<'der', 'pem'>
3210
+ type: "ed25519",
3211
+ options: ED25519KeyPairOptions<"der", "pem">,
2839
3212
  ): Promise<{
2840
3213
  publicKey: Buffer;
2841
3214
  privateKey: string;
2842
3215
  }>;
2843
3216
  function __promisify__(
2844
- type: 'ed25519',
2845
- options: ED25519KeyPairOptions<'der', 'der'>
3217
+ type: "ed25519",
3218
+ options: ED25519KeyPairOptions<"der", "der">,
2846
3219
  ): Promise<{
2847
3220
  publicKey: Buffer;
2848
3221
  privateKey: Buffer;
2849
3222
  }>;
2850
- function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2851
3223
  function __promisify__(
2852
- type: 'ed448',
2853
- options: ED448KeyPairOptions<'pem', 'pem'>
3224
+ type: "ed25519",
3225
+ options?: ED25519KeyPairKeyObjectOptions,
3226
+ ): Promise<KeyPairKeyObjectResult>;
3227
+ function __promisify__(
3228
+ type: "ed448",
3229
+ options: ED448KeyPairOptions<"pem", "pem">,
2854
3230
  ): Promise<{
2855
3231
  publicKey: string;
2856
3232
  privateKey: string;
2857
3233
  }>;
2858
3234
  function __promisify__(
2859
- type: 'ed448',
2860
- options: ED448KeyPairOptions<'pem', 'der'>
3235
+ type: "ed448",
3236
+ options: ED448KeyPairOptions<"pem", "der">,
2861
3237
  ): Promise<{
2862
3238
  publicKey: string;
2863
3239
  privateKey: Buffer;
2864
3240
  }>;
2865
3241
  function __promisify__(
2866
- type: 'ed448',
2867
- options: ED448KeyPairOptions<'der', 'pem'>
3242
+ type: "ed448",
3243
+ options: ED448KeyPairOptions<"der", "pem">,
2868
3244
  ): Promise<{
2869
3245
  publicKey: Buffer;
2870
3246
  privateKey: string;
2871
3247
  }>;
2872
3248
  function __promisify__(
2873
- type: 'ed448',
2874
- options: ED448KeyPairOptions<'der', 'der'>
3249
+ type: "ed448",
3250
+ options: ED448KeyPairOptions<"der", "der">,
2875
3251
  ): Promise<{
2876
3252
  publicKey: Buffer;
2877
3253
  privateKey: Buffer;
2878
3254
  }>;
2879
- function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3255
+ function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2880
3256
  function __promisify__(
2881
- type: 'x25519',
2882
- options: X25519KeyPairOptions<'pem', 'pem'>
3257
+ type: "x25519",
3258
+ options: X25519KeyPairOptions<"pem", "pem">,
2883
3259
  ): Promise<{
2884
3260
  publicKey: string;
2885
3261
  privateKey: string;
2886
3262
  }>;
2887
3263
  function __promisify__(
2888
- type: 'x25519',
2889
- options: X25519KeyPairOptions<'pem', 'der'>
3264
+ type: "x25519",
3265
+ options: X25519KeyPairOptions<"pem", "der">,
2890
3266
  ): Promise<{
2891
3267
  publicKey: string;
2892
3268
  privateKey: Buffer;
2893
3269
  }>;
2894
3270
  function __promisify__(
2895
- type: 'x25519',
2896
- options: X25519KeyPairOptions<'der', 'pem'>
3271
+ type: "x25519",
3272
+ options: X25519KeyPairOptions<"der", "pem">,
2897
3273
  ): Promise<{
2898
3274
  publicKey: Buffer;
2899
3275
  privateKey: string;
2900
3276
  }>;
2901
3277
  function __promisify__(
2902
- type: 'x25519',
2903
- options: X25519KeyPairOptions<'der', 'der'>
3278
+ type: "x25519",
3279
+ options: X25519KeyPairOptions<"der", "der">,
2904
3280
  ): Promise<{
2905
3281
  publicKey: Buffer;
2906
3282
  privateKey: Buffer;
2907
3283
  }>;
2908
- function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2909
3284
  function __promisify__(
2910
- type: 'x448',
2911
- options: X448KeyPairOptions<'pem', 'pem'>
3285
+ type: "x25519",
3286
+ options?: X25519KeyPairKeyObjectOptions,
3287
+ ): Promise<KeyPairKeyObjectResult>;
3288
+ function __promisify__(
3289
+ type: "x448",
3290
+ options: X448KeyPairOptions<"pem", "pem">,
2912
3291
  ): Promise<{
2913
3292
  publicKey: string;
2914
3293
  privateKey: string;
2915
3294
  }>;
2916
3295
  function __promisify__(
2917
- type: 'x448',
2918
- options: X448KeyPairOptions<'pem', 'der'>
3296
+ type: "x448",
3297
+ options: X448KeyPairOptions<"pem", "der">,
2919
3298
  ): Promise<{
2920
3299
  publicKey: string;
2921
3300
  privateKey: Buffer;
2922
3301
  }>;
2923
3302
  function __promisify__(
2924
- type: 'x448',
2925
- options: X448KeyPairOptions<'der', 'pem'>
3303
+ type: "x448",
3304
+ options: X448KeyPairOptions<"der", "pem">,
2926
3305
  ): Promise<{
2927
3306
  publicKey: Buffer;
2928
3307
  privateKey: string;
2929
3308
  }>;
2930
3309
  function __promisify__(
2931
- type: 'x448',
2932
- options: X448KeyPairOptions<'der', 'der'>
3310
+ type: "x448",
3311
+ options: X448KeyPairOptions<"der", "der">,
2933
3312
  ): Promise<{
2934
3313
  publicKey: Buffer;
2935
3314
  privateKey: Buffer;
2936
3315
  }>;
2937
- function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3316
+ function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2938
3317
  }
2939
3318
  /**
2940
3319
  * Calculates and returns the signature for `data` using the given private key and
@@ -2948,12 +3327,16 @@ declare module 'node:crypto' {
2948
3327
  * If the `callback` function is provided this function uses libuv's threadpool.
2949
3328
  * @since v12.0.0
2950
3329
  */
2951
- function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
2952
3330
  function sign(
2953
3331
  algorithm: string | null | undefined,
2954
3332
  data: NodeJS.ArrayBufferView,
2955
3333
  key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
2956
- callback: (error: Error | null, data: Buffer) => void
3334
+ ): Buffer;
3335
+ function sign(
3336
+ algorithm: string | null | undefined,
3337
+ data: NodeJS.ArrayBufferView,
3338
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
3339
+ callback: (error: Error | null, data: Buffer) => void,
2957
3340
  ): void;
2958
3341
  /**
2959
3342
  * 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
@@ -2975,14 +3358,14 @@ declare module 'node:crypto' {
2975
3358
  algorithm: string | null | undefined,
2976
3359
  data: NodeJS.ArrayBufferView,
2977
3360
  key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2978
- signature: NodeJS.ArrayBufferView
3361
+ signature: NodeJS.ArrayBufferView,
2979
3362
  ): boolean;
2980
3363
  function verify(
2981
3364
  algorithm: string | null | undefined,
2982
3365
  data: NodeJS.ArrayBufferView,
2983
3366
  key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2984
3367
  signature: NodeJS.ArrayBufferView,
2985
- callback: (error: Error | null, result: boolean) => void
3368
+ callback: (error: Error | null, result: boolean) => void,
2986
3369
  ): void;
2987
3370
  /**
2988
3371
  * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
@@ -2990,7 +3373,7 @@ declare module 'node:crypto' {
2990
3373
  * @since v13.9.0, v12.17.0
2991
3374
  */
2992
3375
  function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
2993
- type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts';
3376
+ type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
2994
3377
  interface CipherInfoOptions {
2995
3378
  /**
2996
3379
  * A test key length.
@@ -3068,7 +3451,14 @@ declare module 'node:crypto' {
3068
3451
  * @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`
3069
3452
  * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
3070
3453
  */
3071
- function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void;
3454
+ function hkdf(
3455
+ digest: string,
3456
+ irm: BinaryLike | KeyObject,
3457
+ salt: BinaryLike,
3458
+ info: BinaryLike,
3459
+ keylen: number,
3460
+ callback: (err: Error | null, derivedKey: ArrayBuffer) => void,
3461
+ ): void;
3072
3462
  /**
3073
3463
  * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The
3074
3464
  * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes.
@@ -3095,7 +3485,13 @@ declare module 'node:crypto' {
3095
3485
  * @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`
3096
3486
  * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
3097
3487
  */
3098
- function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer;
3488
+ function hkdfSync(
3489
+ digest: string,
3490
+ ikm: BinaryLike | KeyObject,
3491
+ salt: BinaryLike,
3492
+ info: BinaryLike,
3493
+ keylen: number,
3494
+ ): ArrayBuffer;
3099
3495
  interface SecureHeapUsage {
3100
3496
  /**
3101
3497
  * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag.
@@ -3140,7 +3536,7 @@ declare module 'node:crypto' {
3140
3536
  /**
3141
3537
  * @default 'always'
3142
3538
  */
3143
- subject?: 'always' | 'default' | 'never';
3539
+ subject?: "always" | "default" | "never";
3144
3540
  /**
3145
3541
  * @default true
3146
3542
  */
@@ -3195,7 +3591,7 @@ declare module 'node:crypto' {
3195
3591
  * The SHA-512 fingerprint of this certificate.
3196
3592
  * @since v16.14.0
3197
3593
  */
3198
- readonly fingerprint512: string;
3594
+ readonly fingerprint512: string;
3199
3595
  /**
3200
3596
  * The complete subject of this certificate.
3201
3597
  * @since v15.6.0
@@ -3275,7 +3671,7 @@ declare module 'node:crypto' {
3275
3671
  * @since v15.6.0
3276
3672
  * @return Returns `email` if the certificate matches, `undefined` if it does not.
3277
3673
  */
3278
- checkEmail(email: string, options?: Pick<X509CheckOptions, 'subject'>): string | undefined;
3674
+ checkEmail(email: string, options?: Pick<X509CheckOptions, "subject">): string | undefined;
3279
3675
  /**
3280
3676
  * Checks whether the certificate matches the given host name.
3281
3677
  *
@@ -3389,9 +3785,21 @@ declare module 'node:crypto' {
3389
3785
  * @param size The size (in bits) of the prime to generate.
3390
3786
  */
3391
3787
  function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
3392
- function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void;
3393
- function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
3394
- function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void;
3788
+ function generatePrime(
3789
+ size: number,
3790
+ options: GeneratePrimeOptionsBigInt,
3791
+ callback: (err: Error | null, prime: bigint) => void,
3792
+ ): void;
3793
+ function generatePrime(
3794
+ size: number,
3795
+ options: GeneratePrimeOptionsArrayBuffer,
3796
+ callback: (err: Error | null, prime: ArrayBuffer) => void,
3797
+ ): void;
3798
+ function generatePrime(
3799
+ size: number,
3800
+ options: GeneratePrimeOptions,
3801
+ callback: (err: Error | null, prime: ArrayBuffer | bigint) => void,
3802
+ ): void;
3395
3803
  /**
3396
3804
  * Generates a pseudorandom prime of `size` bits.
3397
3805
  *
@@ -3440,7 +3848,11 @@ declare module 'node:crypto' {
3440
3848
  * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
3441
3849
  */
3442
3850
  function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void;
3443
- function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void;
3851
+ function checkPrime(
3852
+ value: LargeNumberLike,
3853
+ options: CheckPrimeOptions,
3854
+ callback: (err: Error | null, result: boolean) => void,
3855
+ ): void;
3444
3856
  /**
3445
3857
  * Checks the primality of the `candidate`.
3446
3858
  * @since v15.8.0
@@ -3499,9 +3911,17 @@ declare module 'node:crypto' {
3499
3911
  const webcrypto: webcrypto.Crypto;
3500
3912
  namespace webcrypto {
3501
3913
  type BufferSource = ArrayBufferView | ArrayBuffer;
3502
- type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki';
3503
- type KeyType = 'private' | 'public' | 'secret';
3504
- type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey';
3914
+ type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
3915
+ type KeyType = "private" | "public" | "secret";
3916
+ type KeyUsage =
3917
+ | "decrypt"
3918
+ | "deriveBits"
3919
+ | "deriveKey"
3920
+ | "encrypt"
3921
+ | "sign"
3922
+ | "unwrapKey"
3923
+ | "verify"
3924
+ | "wrapKey";
3505
3925
  type AlgorithmIdentifier = Algorithm | string;
3506
3926
  type HashAlgorithmIdentifier = AlgorithmIdentifier;
3507
3927
  type NamedCurve = string;
@@ -3655,7 +4075,7 @@ declare module 'node:crypto' {
3655
4075
  /** Illegal constructor */
3656
4076
  (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
3657
4077
  readonly length: 0;
3658
- readonly name: 'CryptoKey';
4078
+ readonly name: "CryptoKey";
3659
4079
  readonly prototype: CryptoKey;
3660
4080
  }
3661
4081
  /**
@@ -3728,7 +4148,11 @@ declare module 'node:crypto' {
3728
4148
  * - `'AES-GCM'`
3729
4149
  * @since v15.0.0
3730
4150
  */
3731
- decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
4151
+ decrypt(
4152
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4153
+ key: CryptoKey,
4154
+ data: BufferSource,
4155
+ ): Promise<ArrayBuffer>;
3732
4156
  /**
3733
4157
  * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
3734
4158
  * `subtle.deriveBits()` attempts to generate `length` bits.
@@ -3747,7 +4171,11 @@ declare module 'node:crypto' {
3747
4171
  * @since v15.0.0
3748
4172
  */
3749
4173
  deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise<ArrayBuffer>;
3750
- deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
4174
+ deriveBits(
4175
+ algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params,
4176
+ baseKey: CryptoKey,
4177
+ length: number,
4178
+ ): Promise<ArrayBuffer>;
3751
4179
  /**
3752
4180
  * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
3753
4181
  * `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
@@ -3768,9 +4196,14 @@ declare module 'node:crypto' {
3768
4196
  deriveKey(
3769
4197
  algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
3770
4198
  baseKey: CryptoKey,
3771
- derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params,
4199
+ derivedKeyAlgorithm:
4200
+ | AlgorithmIdentifier
4201
+ | AesDerivedKeyParams
4202
+ | HmacImportParams
4203
+ | HkdfParams
4204
+ | Pbkdf2Params,
3772
4205
  extractable: boolean,
3773
- keyUsages: ReadonlyArray<KeyUsage>
4206
+ keyUsages: ReadonlyArray<KeyUsage>,
3774
4207
  ): Promise<CryptoKey>;
3775
4208
  /**
3776
4209
  * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
@@ -3800,7 +4233,11 @@ declare module 'node:crypto' {
3800
4233
  * - `'AES-GCM'`
3801
4234
  * @since v15.0.0
3802
4235
  */
3803
- encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
4236
+ encrypt(
4237
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4238
+ key: CryptoKey,
4239
+ data: BufferSource,
4240
+ ): Promise<ArrayBuffer>;
3804
4241
  /**
3805
4242
  * Exports the given key into the specified format, if supported.
3806
4243
  *
@@ -3815,8 +4252,8 @@ declare module 'node:crypto' {
3815
4252
  * @returns `<Promise>` containing `<ArrayBuffer>`.
3816
4253
  * @since v15.0.0
3817
4254
  */
3818
- exportKey(format: 'jwk', key: CryptoKey): Promise<JsonWebKey>;
3819
- exportKey(format: Exclude<KeyFormat, 'jwk'>, key: CryptoKey): Promise<ArrayBuffer>;
4255
+ exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
4256
+ exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
3820
4257
  /**
3821
4258
  * Using the method and parameters provided in `algorithm`,
3822
4259
  * `subtle.generateKey()` attempts to generate new keying material.
@@ -3843,9 +4280,21 @@ declare module 'node:crypto' {
3843
4280
  * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
3844
4281
  * @since v15.0.0
3845
4282
  */
3846
- generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
3847
- generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
3848
- generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
4283
+ generateKey(
4284
+ algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
4285
+ extractable: boolean,
4286
+ keyUsages: ReadonlyArray<KeyUsage>,
4287
+ ): Promise<CryptoKeyPair>;
4288
+ generateKey(
4289
+ algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
4290
+ extractable: boolean,
4291
+ keyUsages: ReadonlyArray<KeyUsage>,
4292
+ ): Promise<CryptoKey>;
4293
+ generateKey(
4294
+ algorithm: AlgorithmIdentifier,
4295
+ extractable: boolean,
4296
+ keyUsages: KeyUsage[],
4297
+ ): Promise<CryptoKeyPair | CryptoKey>;
3849
4298
  /**
3850
4299
  * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
3851
4300
  * to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
@@ -3857,18 +4306,28 @@ declare module 'node:crypto' {
3857
4306
  * @since v15.0.0
3858
4307
  */
3859
4308
  importKey(
3860
- format: 'jwk',
4309
+ format: "jwk",
3861
4310
  keyData: JsonWebKey,
3862
- algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
4311
+ algorithm:
4312
+ | AlgorithmIdentifier
4313
+ | RsaHashedImportParams
4314
+ | EcKeyImportParams
4315
+ | HmacImportParams
4316
+ | AesKeyAlgorithm,
3863
4317
  extractable: boolean,
3864
- keyUsages: ReadonlyArray<KeyUsage>
4318
+ keyUsages: ReadonlyArray<KeyUsage>,
3865
4319
  ): Promise<CryptoKey>;
3866
4320
  importKey(
3867
- format: Exclude<KeyFormat, 'jwk'>,
4321
+ format: Exclude<KeyFormat, "jwk">,
3868
4322
  keyData: BufferSource,
3869
- algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
4323
+ algorithm:
4324
+ | AlgorithmIdentifier
4325
+ | RsaHashedImportParams
4326
+ | EcKeyImportParams
4327
+ | HmacImportParams
4328
+ | AesKeyAlgorithm,
3870
4329
  extractable: boolean,
3871
- keyUsages: KeyUsage[]
4330
+ keyUsages: KeyUsage[],
3872
4331
  ): Promise<CryptoKey>;
3873
4332
  /**
3874
4333
  * Using the method and parameters given by `algorithm` and the keying material provided by `key`,
@@ -3885,7 +4344,11 @@ declare module 'node:crypto' {
3885
4344
  * - `'HMAC'`
3886
4345
  * @since v15.0.0
3887
4346
  */
3888
- sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
4347
+ sign(
4348
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
4349
+ key: CryptoKey,
4350
+ data: BufferSource,
4351
+ ): Promise<ArrayBuffer>;
3889
4352
  /**
3890
4353
  * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
3891
4354
  * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
@@ -3926,9 +4389,14 @@ declare module 'node:crypto' {
3926
4389
  wrappedKey: BufferSource,
3927
4390
  unwrappingKey: CryptoKey,
3928
4391
  unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
3929
- unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
4392
+ unwrappedKeyAlgorithm:
4393
+ | AlgorithmIdentifier
4394
+ | RsaHashedImportParams
4395
+ | EcKeyImportParams
4396
+ | HmacImportParams
4397
+ | AesKeyAlgorithm,
3930
4398
  extractable: boolean,
3931
- keyUsages: KeyUsage[]
4399
+ keyUsages: KeyUsage[],
3932
4400
  ): Promise<CryptoKey>;
3933
4401
  /**
3934
4402
  * Using the method and parameters given in `algorithm` and the keying material provided by `key`,
@@ -3945,7 +4413,12 @@ declare module 'node:crypto' {
3945
4413
  * - `'HMAC'`
3946
4414
  * @since v15.0.0
3947
4415
  */
3948
- verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<boolean>;
4416
+ verify(
4417
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
4418
+ key: CryptoKey,
4419
+ signature: BufferSource,
4420
+ data: BufferSource,
4421
+ ): Promise<boolean>;
3949
4422
  /**
3950
4423
  * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
3951
4424
  * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
@@ -3964,10 +4437,15 @@ declare module 'node:crypto' {
3964
4437
  * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
3965
4438
  * @since v15.0.0
3966
4439
  */
3967
- wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise<ArrayBuffer>;
4440
+ wrapKey(
4441
+ format: KeyFormat,
4442
+ key: CryptoKey,
4443
+ wrappingKey: CryptoKey,
4444
+ wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4445
+ ): Promise<ArrayBuffer>;
3968
4446
  }
3969
4447
  }
3970
4448
  }
3971
- declare module 'crypto' {
3972
- export * from 'node:crypto';
4449
+ declare module "node:crypto" {
4450
+ export * from "crypto";
3973
4451
  }