@types/node 14.14.15 → 14.14.16

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 (3) hide show
  1. node/README.md +1 -1
  2. node/crypto.d.ts +528 -152
  3. node/package.json +2 -2
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 23 Dec 2020 20:12:44 GMT
11
+ * Last updated: Wed, 23 Dec 2020 20:23:09 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node/crypto.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- declare module "crypto" {
2
- import * as stream from "stream";
1
+ declare module 'crypto' {
2
+ import * as stream from 'stream';
3
3
 
4
4
  interface Certificate {
5
5
  exportChallenge(spkac: BinaryLike): Buffer;
@@ -7,11 +7,12 @@ declare module "crypto" {
7
7
  verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
8
8
  }
9
9
  const Certificate: {
10
- new(): Certificate;
10
+ new (): Certificate;
11
11
  (): Certificate;
12
12
  };
13
13
 
14
- namespace constants { // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
14
+ namespace constants {
15
+ // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
15
16
  const OPENSSL_VERSION_NUMBER: number;
16
17
 
17
18
  /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
@@ -121,13 +122,13 @@ declare module "crypto" {
121
122
  function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
122
123
 
123
124
  // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
124
- type BinaryToTextEncoding = "base64" | "hex";
125
- type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "latin1";
126
- type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
125
+ type BinaryToTextEncoding = 'base64' | 'hex';
126
+ type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
127
+ type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
127
128
 
128
129
  type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
129
130
 
130
- type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
131
+ type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
131
132
 
132
133
  class Hash extends stream.Transform {
133
134
  private constructor();
@@ -192,16 +193,19 @@ declare module "crypto" {
192
193
  algorithm: CipherCCMTypes,
193
194
  key: CipherKey,
194
195
  iv: BinaryLike | null,
195
- options: CipherCCMOptions
196
+ options: CipherCCMOptions,
196
197
  ): CipherCCM;
197
198
  function createCipheriv(
198
199
  algorithm: CipherGCMTypes,
199
200
  key: CipherKey,
200
201
  iv: BinaryLike | null,
201
- options?: CipherGCMOptions
202
+ options?: CipherGCMOptions,
202
203
  ): CipherGCM;
203
204
  function createCipheriv(
204
- algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions
205
+ algorithm: string,
206
+ key: CipherKey,
207
+ iv: BinaryLike | null,
208
+ options?: stream.TransformOptions,
205
209
  ): Cipher;
206
210
 
207
211
  class Cipher extends stream.Transform {
@@ -243,7 +247,12 @@ declare module "crypto" {
243
247
  iv: BinaryLike | null,
244
248
  options?: CipherGCMOptions,
245
249
  ): DecipherGCM;
246
- function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
250
+ function createDecipheriv(
251
+ algorithm: string,
252
+ key: CipherKey,
253
+ iv: BinaryLike | null,
254
+ options?: stream.TransformOptions,
255
+ ): Decipher;
247
256
 
248
257
  class Decipher extends stream.Transform {
249
258
  private constructor();
@@ -296,13 +305,11 @@ declare module "crypto" {
296
305
  dsaEncoding?: DSAEncoding;
297
306
  }
298
307
 
299
- interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {
300
- }
308
+ interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
301
309
  interface SignKeyObjectInput extends SigningOptions {
302
310
  key: KeyObject;
303
311
  }
304
- interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {
305
- }
312
+ interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
306
313
  interface VerifyKeyObjectInput extends SigningOptions {
307
314
  key: KeyObject;
308
315
  }
@@ -315,7 +322,10 @@ declare module "crypto" {
315
322
  update(data: BinaryLike): Signer;
316
323
  update(data: string, input_encoding: Encoding): Signer;
317
324
  sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
318
- sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, output_format: BinaryToTextEncoding): string;
325
+ sign(
326
+ private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
327
+ output_format: BinaryToTextEncoding,
328
+ ): string;
319
329
  }
320
330
 
321
331
  function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
@@ -324,16 +334,32 @@ declare module "crypto" {
324
334
 
325
335
  update(data: BinaryLike): Verify;
326
336
  update(data: string, input_encoding: Encoding): Verify;
327
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
328
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
337
+ verify(
338
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
339
+ signature: NodeJS.ArrayBufferView,
340
+ ): boolean;
341
+ verify(
342
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
343
+ signature: string,
344
+ signature_format?: BinaryToTextEncoding,
345
+ ): boolean;
329
346
  // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
330
347
  // The signature field accepts a TypedArray type, but it is only available starting ES2017
331
348
  }
332
349
  function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
333
350
  function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
334
351
  function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding): DiffieHellman;
335
- function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
336
- function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding, generator: string, generator_encoding: BinaryToTextEncoding): DiffieHellman;
352
+ function createDiffieHellman(
353
+ prime: string,
354
+ prime_encoding: BinaryToTextEncoding,
355
+ generator: number | NodeJS.ArrayBufferView,
356
+ ): DiffieHellman;
357
+ function createDiffieHellman(
358
+ prime: string,
359
+ prime_encoding: BinaryToTextEncoding,
360
+ generator: string,
361
+ generator_encoding: BinaryToTextEncoding,
362
+ ): DiffieHellman;
337
363
  class DiffieHellman {
338
364
  private constructor();
339
365
  generateKeys(): Buffer;
@@ -341,7 +367,11 @@ declare module "crypto" {
341
367
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
342
368
  computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
343
369
  computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
344
- computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding, output_encoding: BinaryToTextEncoding): string;
370
+ computeSecret(
371
+ other_public_key: string,
372
+ input_encoding: BinaryToTextEncoding,
373
+ output_encoding: BinaryToTextEncoding,
374
+ ): string;
345
375
  getPrime(): Buffer;
346
376
  getPrime(encoding: BinaryToTextEncoding): string;
347
377
  getGenerator(): Buffer;
@@ -365,7 +395,13 @@ declare module "crypto" {
365
395
  digest: string,
366
396
  callback: (err: Error | null, derivedKey: Buffer) => any,
367
397
  ): void;
368
- function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer;
398
+ function pbkdf2Sync(
399
+ password: BinaryLike,
400
+ salt: BinaryLike,
401
+ iterations: number,
402
+ keylen: number,
403
+ digest: string,
404
+ ): Buffer;
369
405
 
370
406
  function randomBytes(size: number): Buffer;
371
407
  function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
@@ -378,11 +414,26 @@ declare module "crypto" {
378
414
  function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
379
415
 
380
416
  function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
381
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
382
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
383
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
417
+ function randomFill<T extends NodeJS.ArrayBufferView>(
418
+ buffer: T,
419
+ callback: (err: Error | null, buf: T) => void,
420
+ ): void;
421
+ function randomFill<T extends NodeJS.ArrayBufferView>(
422
+ buffer: T,
423
+ offset: number,
424
+ callback: (err: Error | null, buf: T) => void,
425
+ ): void;
426
+ function randomFill<T extends NodeJS.ArrayBufferView>(
427
+ buffer: T,
428
+ offset: number,
429
+ size: number,
430
+ callback: (err: Error | null, buf: T) => void,
431
+ ): void;
384
432
 
385
433
  interface ScryptOptions {
434
+ cost?: number;
435
+ blockSize?: number;
436
+ parallelization?: number;
386
437
  N?: number;
387
438
  r?: number;
388
439
  p?: number;
@@ -391,7 +442,8 @@ declare module "crypto" {
391
442
  function scrypt(
392
443
  password: BinaryLike,
393
444
  salt: BinaryLike,
394
- keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void,
445
+ keylen: number,
446
+ callback: (err: Error | null, derivedKey: Buffer) => void,
395
447
  ): void;
396
448
  function scrypt(
397
449
  password: BinaryLike,
@@ -430,15 +482,19 @@ declare module "crypto" {
430
482
  key: BinaryLike,
431
483
  curve: string,
432
484
  inputEncoding?: BinaryToTextEncoding,
433
- outputEncoding?: "latin1" | "hex" | "base64",
434
- format?: "uncompressed" | "compressed" | "hybrid",
485
+ outputEncoding?: 'latin1' | 'hex' | 'base64',
486
+ format?: 'uncompressed' | 'compressed' | 'hybrid',
435
487
  ): Buffer | string;
436
488
  generateKeys(): Buffer;
437
489
  generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
438
490
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
439
491
  computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
440
492
  computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
441
- computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding, output_encoding: BinaryToTextEncoding): string;
493
+ computeSecret(
494
+ other_public_key: string,
495
+ input_encoding: BinaryToTextEncoding,
496
+ output_encoding: BinaryToTextEncoding,
497
+ ): string;
442
498
  getPrivateKey(): Buffer;
443
499
  getPrivateKey(encoding: BinaryToTextEncoding): string;
444
500
  getPublicKey(): Buffer;
@@ -478,15 +534,15 @@ declare module "crypto" {
478
534
  }
479
535
 
480
536
  interface X25519KeyPairKeyObjectOptions {
481
- /**
482
- * No options.
483
- */
537
+ /**
538
+ * No options.
539
+ */
484
540
  }
485
541
 
486
542
  interface X448KeyPairKeyObjectOptions {
487
- /**
488
- * No options.
489
- */
543
+ /**
544
+ * No options.
545
+ */
490
546
  }
491
547
 
492
548
  interface ECKeyPairKeyObjectOptions {
@@ -618,132 +674,446 @@ declare module "crypto" {
618
674
  privateKey: T2;
619
675
  }
620
676
 
621
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
622
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
623
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
624
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
677
+ function generateKeyPairSync(
678
+ type: 'rsa',
679
+ options: RSAKeyPairOptions<'pem', 'pem'>,
680
+ ): KeyPairSyncResult<string, string>;
681
+ function generateKeyPairSync(
682
+ type: 'rsa',
683
+ options: RSAKeyPairOptions<'pem', 'der'>,
684
+ ): KeyPairSyncResult<string, Buffer>;
685
+ function generateKeyPairSync(
686
+ type: 'rsa',
687
+ options: RSAKeyPairOptions<'der', 'pem'>,
688
+ ): KeyPairSyncResult<Buffer, string>;
689
+ function generateKeyPairSync(
690
+ type: 'rsa',
691
+ options: RSAKeyPairOptions<'der', 'der'>,
692
+ ): KeyPairSyncResult<Buffer, Buffer>;
625
693
  function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
626
694
 
627
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
628
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
629
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
630
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
695
+ function generateKeyPairSync(
696
+ type: 'dsa',
697
+ options: DSAKeyPairOptions<'pem', 'pem'>,
698
+ ): KeyPairSyncResult<string, string>;
699
+ function generateKeyPairSync(
700
+ type: 'dsa',
701
+ options: DSAKeyPairOptions<'pem', 'der'>,
702
+ ): KeyPairSyncResult<string, Buffer>;
703
+ function generateKeyPairSync(
704
+ type: 'dsa',
705
+ options: DSAKeyPairOptions<'der', 'pem'>,
706
+ ): KeyPairSyncResult<Buffer, string>;
707
+ function generateKeyPairSync(
708
+ type: 'dsa',
709
+ options: DSAKeyPairOptions<'der', 'der'>,
710
+ ): KeyPairSyncResult<Buffer, Buffer>;
631
711
  function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
632
712
 
633
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
634
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
635
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
636
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
713
+ function generateKeyPairSync(
714
+ type: 'ec',
715
+ options: ECKeyPairOptions<'pem', 'pem'>,
716
+ ): KeyPairSyncResult<string, string>;
717
+ function generateKeyPairSync(
718
+ type: 'ec',
719
+ options: ECKeyPairOptions<'pem', 'der'>,
720
+ ): KeyPairSyncResult<string, Buffer>;
721
+ function generateKeyPairSync(
722
+ type: 'ec',
723
+ options: ECKeyPairOptions<'der', 'pem'>,
724
+ ): KeyPairSyncResult<Buffer, string>;
725
+ function generateKeyPairSync(
726
+ type: 'ec',
727
+ options: ECKeyPairOptions<'der', 'der'>,
728
+ ): KeyPairSyncResult<Buffer, Buffer>;
637
729
  function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
638
730
 
639
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
640
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
641
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
642
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
731
+ function generateKeyPairSync(
732
+ type: 'ed25519',
733
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
734
+ ): KeyPairSyncResult<string, string>;
735
+ function generateKeyPairSync(
736
+ type: 'ed25519',
737
+ options: ED25519KeyPairOptions<'pem', 'der'>,
738
+ ): KeyPairSyncResult<string, Buffer>;
739
+ function generateKeyPairSync(
740
+ type: 'ed25519',
741
+ options: ED25519KeyPairOptions<'der', 'pem'>,
742
+ ): KeyPairSyncResult<Buffer, string>;
743
+ function generateKeyPairSync(
744
+ type: 'ed25519',
745
+ options: ED25519KeyPairOptions<'der', 'der'>,
746
+ ): KeyPairSyncResult<Buffer, Buffer>;
643
747
  function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
644
748
 
645
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
646
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
647
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
648
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
749
+ function generateKeyPairSync(
750
+ type: 'ed448',
751
+ options: ED448KeyPairOptions<'pem', 'pem'>,
752
+ ): KeyPairSyncResult<string, string>;
753
+ function generateKeyPairSync(
754
+ type: 'ed448',
755
+ options: ED448KeyPairOptions<'pem', 'der'>,
756
+ ): KeyPairSyncResult<string, Buffer>;
757
+ function generateKeyPairSync(
758
+ type: 'ed448',
759
+ options: ED448KeyPairOptions<'der', 'pem'>,
760
+ ): KeyPairSyncResult<Buffer, string>;
761
+ function generateKeyPairSync(
762
+ type: 'ed448',
763
+ options: ED448KeyPairOptions<'der', 'der'>,
764
+ ): KeyPairSyncResult<Buffer, Buffer>;
649
765
  function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
650
766
 
651
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
652
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
653
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
654
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
767
+ function generateKeyPairSync(
768
+ type: 'x25519',
769
+ options: X25519KeyPairOptions<'pem', 'pem'>,
770
+ ): KeyPairSyncResult<string, string>;
771
+ function generateKeyPairSync(
772
+ type: 'x25519',
773
+ options: X25519KeyPairOptions<'pem', 'der'>,
774
+ ): KeyPairSyncResult<string, Buffer>;
775
+ function generateKeyPairSync(
776
+ type: 'x25519',
777
+ options: X25519KeyPairOptions<'der', 'pem'>,
778
+ ): KeyPairSyncResult<Buffer, string>;
779
+ function generateKeyPairSync(
780
+ type: 'x25519',
781
+ options: X25519KeyPairOptions<'der', 'der'>,
782
+ ): KeyPairSyncResult<Buffer, Buffer>;
655
783
  function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
656
784
 
657
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
658
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
659
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
660
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
785
+ function generateKeyPairSync(
786
+ type: 'x448',
787
+ options: X448KeyPairOptions<'pem', 'pem'>,
788
+ ): KeyPairSyncResult<string, string>;
789
+ function generateKeyPairSync(
790
+ type: 'x448',
791
+ options: X448KeyPairOptions<'pem', 'der'>,
792
+ ): KeyPairSyncResult<string, Buffer>;
793
+ function generateKeyPairSync(
794
+ type: 'x448',
795
+ options: X448KeyPairOptions<'der', 'pem'>,
796
+ ): KeyPairSyncResult<Buffer, string>;
797
+ function generateKeyPairSync(
798
+ type: 'x448',
799
+ options: X448KeyPairOptions<'der', 'der'>,
800
+ ): KeyPairSyncResult<Buffer, Buffer>;
661
801
  function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
662
802
 
663
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
664
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
665
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
666
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
667
- function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
668
-
669
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
670
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
671
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
672
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
673
- function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
674
-
675
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
676
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
677
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
678
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
679
- function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
680
-
681
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
682
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
683
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
684
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
685
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
686
-
687
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
688
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
689
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
690
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
691
- function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
692
-
693
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
694
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
695
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
696
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
697
- function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
698
-
699
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
700
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
701
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
702
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
703
- function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
803
+ function generateKeyPair(
804
+ type: 'rsa',
805
+ options: RSAKeyPairOptions<'pem', 'pem'>,
806
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
807
+ ): void;
808
+ function generateKeyPair(
809
+ type: 'rsa',
810
+ options: RSAKeyPairOptions<'pem', 'der'>,
811
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
812
+ ): void;
813
+ function generateKeyPair(
814
+ type: 'rsa',
815
+ options: RSAKeyPairOptions<'der', 'pem'>,
816
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
817
+ ): void;
818
+ function generateKeyPair(
819
+ type: 'rsa',
820
+ options: RSAKeyPairOptions<'der', 'der'>,
821
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
822
+ ): void;
823
+ function generateKeyPair(
824
+ type: 'rsa',
825
+ options: RSAKeyPairKeyObjectOptions,
826
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
827
+ ): void;
828
+
829
+ function generateKeyPair(
830
+ type: 'dsa',
831
+ options: DSAKeyPairOptions<'pem', 'pem'>,
832
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
833
+ ): void;
834
+ function generateKeyPair(
835
+ type: 'dsa',
836
+ options: DSAKeyPairOptions<'pem', 'der'>,
837
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
838
+ ): void;
839
+ function generateKeyPair(
840
+ type: 'dsa',
841
+ options: DSAKeyPairOptions<'der', 'pem'>,
842
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
843
+ ): void;
844
+ function generateKeyPair(
845
+ type: 'dsa',
846
+ options: DSAKeyPairOptions<'der', 'der'>,
847
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
848
+ ): void;
849
+ function generateKeyPair(
850
+ type: 'dsa',
851
+ options: DSAKeyPairKeyObjectOptions,
852
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
853
+ ): void;
854
+
855
+ function generateKeyPair(
856
+ type: 'ec',
857
+ options: ECKeyPairOptions<'pem', 'pem'>,
858
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
859
+ ): void;
860
+ function generateKeyPair(
861
+ type: 'ec',
862
+ options: ECKeyPairOptions<'pem', 'der'>,
863
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
864
+ ): void;
865
+ function generateKeyPair(
866
+ type: 'ec',
867
+ options: ECKeyPairOptions<'der', 'pem'>,
868
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
869
+ ): void;
870
+ function generateKeyPair(
871
+ type: 'ec',
872
+ options: ECKeyPairOptions<'der', 'der'>,
873
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
874
+ ): void;
875
+ function generateKeyPair(
876
+ type: 'ec',
877
+ options: ECKeyPairKeyObjectOptions,
878
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
879
+ ): void;
880
+
881
+ function generateKeyPair(
882
+ type: 'ed25519',
883
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
884
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
885
+ ): void;
886
+ function generateKeyPair(
887
+ type: 'ed25519',
888
+ options: ED25519KeyPairOptions<'pem', 'der'>,
889
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
890
+ ): void;
891
+ function generateKeyPair(
892
+ type: 'ed25519',
893
+ options: ED25519KeyPairOptions<'der', 'pem'>,
894
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
895
+ ): void;
896
+ function generateKeyPair(
897
+ type: 'ed25519',
898
+ options: ED25519KeyPairOptions<'der', 'der'>,
899
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
900
+ ): void;
901
+ function generateKeyPair(
902
+ type: 'ed25519',
903
+ options: ED25519KeyPairKeyObjectOptions | undefined,
904
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
905
+ ): void;
906
+
907
+ function generateKeyPair(
908
+ type: 'ed448',
909
+ options: ED448KeyPairOptions<'pem', 'pem'>,
910
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
911
+ ): void;
912
+ function generateKeyPair(
913
+ type: 'ed448',
914
+ options: ED448KeyPairOptions<'pem', 'der'>,
915
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
916
+ ): void;
917
+ function generateKeyPair(
918
+ type: 'ed448',
919
+ options: ED448KeyPairOptions<'der', 'pem'>,
920
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
921
+ ): void;
922
+ function generateKeyPair(
923
+ type: 'ed448',
924
+ options: ED448KeyPairOptions<'der', 'der'>,
925
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
926
+ ): void;
927
+ function generateKeyPair(
928
+ type: 'ed448',
929
+ options: ED448KeyPairKeyObjectOptions | undefined,
930
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
931
+ ): void;
932
+
933
+ function generateKeyPair(
934
+ type: 'x25519',
935
+ options: X25519KeyPairOptions<'pem', 'pem'>,
936
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
937
+ ): void;
938
+ function generateKeyPair(
939
+ type: 'x25519',
940
+ options: X25519KeyPairOptions<'pem', 'der'>,
941
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
942
+ ): void;
943
+ function generateKeyPair(
944
+ type: 'x25519',
945
+ options: X25519KeyPairOptions<'der', 'pem'>,
946
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
947
+ ): void;
948
+ function generateKeyPair(
949
+ type: 'x25519',
950
+ options: X25519KeyPairOptions<'der', 'der'>,
951
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
952
+ ): void;
953
+ function generateKeyPair(
954
+ type: 'x25519',
955
+ options: X25519KeyPairKeyObjectOptions | undefined,
956
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
957
+ ): void;
958
+
959
+ function generateKeyPair(
960
+ type: 'x448',
961
+ options: X448KeyPairOptions<'pem', 'pem'>,
962
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
963
+ ): void;
964
+ function generateKeyPair(
965
+ type: 'x448',
966
+ options: X448KeyPairOptions<'pem', 'der'>,
967
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
968
+ ): void;
969
+ function generateKeyPair(
970
+ type: 'x448',
971
+ options: X448KeyPairOptions<'der', 'pem'>,
972
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
973
+ ): void;
974
+ function generateKeyPair(
975
+ type: 'x448',
976
+ options: X448KeyPairOptions<'der', 'der'>,
977
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
978
+ ): void;
979
+ function generateKeyPair(
980
+ type: 'x448',
981
+ options: X448KeyPairKeyObjectOptions | undefined,
982
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
983
+ ): void;
704
984
 
705
985
  namespace generateKeyPair {
706
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
707
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
708
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
709
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
710
- function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
711
-
712
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
713
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
714
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
715
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
716
- function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
717
-
718
- function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
719
- function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
720
- function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
721
- function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
722
- function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
723
-
724
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
725
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
726
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
727
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
728
- function __promisify__(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
729
-
730
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
731
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
732
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
733
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
734
- function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
735
-
736
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
737
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
738
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
739
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
740
- function __promisify__(type: "x25519", options?: X25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
741
-
742
- function __promisify__(type: "x448", options: X448KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
743
- function __promisify__(type: "x448", options: X448KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
744
- function __promisify__(type: "x448", options: X448KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
745
- function __promisify__(type: "x448", options: X448KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
746
- function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
986
+ function __promisify__(
987
+ type: 'rsa',
988
+ options: RSAKeyPairOptions<'pem', 'pem'>,
989
+ ): Promise<{ publicKey: string; privateKey: string }>;
990
+ function __promisify__(
991
+ type: 'rsa',
992
+ options: RSAKeyPairOptions<'pem', 'der'>,
993
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
994
+ function __promisify__(
995
+ type: 'rsa',
996
+ options: RSAKeyPairOptions<'der', 'pem'>,
997
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
998
+ function __promisify__(
999
+ type: 'rsa',
1000
+ options: RSAKeyPairOptions<'der', 'der'>,
1001
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1002
+ function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1003
+
1004
+ function __promisify__(
1005
+ type: 'dsa',
1006
+ options: DSAKeyPairOptions<'pem', 'pem'>,
1007
+ ): Promise<{ publicKey: string; privateKey: string }>;
1008
+ function __promisify__(
1009
+ type: 'dsa',
1010
+ options: DSAKeyPairOptions<'pem', 'der'>,
1011
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1012
+ function __promisify__(
1013
+ type: 'dsa',
1014
+ options: DSAKeyPairOptions<'der', 'pem'>,
1015
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1016
+ function __promisify__(
1017
+ type: 'dsa',
1018
+ options: DSAKeyPairOptions<'der', 'der'>,
1019
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1020
+ function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1021
+
1022
+ function __promisify__(
1023
+ type: 'ec',
1024
+ options: ECKeyPairOptions<'pem', 'pem'>,
1025
+ ): Promise<{ publicKey: string; privateKey: string }>;
1026
+ function __promisify__(
1027
+ type: 'ec',
1028
+ options: ECKeyPairOptions<'pem', 'der'>,
1029
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1030
+ function __promisify__(
1031
+ type: 'ec',
1032
+ options: ECKeyPairOptions<'der', 'pem'>,
1033
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1034
+ function __promisify__(
1035
+ type: 'ec',
1036
+ options: ECKeyPairOptions<'der', 'der'>,
1037
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1038
+ function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1039
+
1040
+ function __promisify__(
1041
+ type: 'ed25519',
1042
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
1043
+ ): Promise<{ publicKey: string; privateKey: string }>;
1044
+ function __promisify__(
1045
+ type: 'ed25519',
1046
+ options: ED25519KeyPairOptions<'pem', 'der'>,
1047
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1048
+ function __promisify__(
1049
+ type: 'ed25519',
1050
+ options: ED25519KeyPairOptions<'der', 'pem'>,
1051
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1052
+ function __promisify__(
1053
+ type: 'ed25519',
1054
+ options: ED25519KeyPairOptions<'der', 'der'>,
1055
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1056
+ function __promisify__(
1057
+ type: 'ed25519',
1058
+ options?: ED25519KeyPairKeyObjectOptions,
1059
+ ): Promise<KeyPairKeyObjectResult>;
1060
+
1061
+ function __promisify__(
1062
+ type: 'ed448',
1063
+ options: ED448KeyPairOptions<'pem', 'pem'>,
1064
+ ): Promise<{ publicKey: string; privateKey: string }>;
1065
+ function __promisify__(
1066
+ type: 'ed448',
1067
+ options: ED448KeyPairOptions<'pem', 'der'>,
1068
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1069
+ function __promisify__(
1070
+ type: 'ed448',
1071
+ options: ED448KeyPairOptions<'der', 'pem'>,
1072
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1073
+ function __promisify__(
1074
+ type: 'ed448',
1075
+ options: ED448KeyPairOptions<'der', 'der'>,
1076
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1077
+ function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1078
+
1079
+ function __promisify__(
1080
+ type: 'x25519',
1081
+ options: X25519KeyPairOptions<'pem', 'pem'>,
1082
+ ): Promise<{ publicKey: string; privateKey: string }>;
1083
+ function __promisify__(
1084
+ type: 'x25519',
1085
+ options: X25519KeyPairOptions<'pem', 'der'>,
1086
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1087
+ function __promisify__(
1088
+ type: 'x25519',
1089
+ options: X25519KeyPairOptions<'der', 'pem'>,
1090
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1091
+ function __promisify__(
1092
+ type: 'x25519',
1093
+ options: X25519KeyPairOptions<'der', 'der'>,
1094
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1095
+ function __promisify__(
1096
+ type: 'x25519',
1097
+ options?: X25519KeyPairKeyObjectOptions,
1098
+ ): Promise<KeyPairKeyObjectResult>;
1099
+
1100
+ function __promisify__(
1101
+ type: 'x448',
1102
+ options: X448KeyPairOptions<'pem', 'pem'>,
1103
+ ): Promise<{ publicKey: string; privateKey: string }>;
1104
+ function __promisify__(
1105
+ type: 'x448',
1106
+ options: X448KeyPairOptions<'pem', 'der'>,
1107
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1108
+ function __promisify__(
1109
+ type: 'x448',
1110
+ options: X448KeyPairOptions<'der', 'pem'>,
1111
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1112
+ function __promisify__(
1113
+ type: 'x448',
1114
+ options: X448KeyPairOptions<'der', 'der'>,
1115
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1116
+ function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
747
1117
  }
748
1118
 
749
1119
  /**
@@ -754,7 +1124,11 @@ declare module "crypto" {
754
1124
  * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
755
1125
  * passed to [`crypto.createPrivateKey()`][].
756
1126
  */
757
- function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
1127
+ function sign(
1128
+ algorithm: string | null | undefined,
1129
+ data: NodeJS.ArrayBufferView,
1130
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
1131
+ ): Buffer;
758
1132
 
759
1133
  /**
760
1134
  * Calculates and returns the signature for `data` using the given private key and
@@ -764,15 +1138,17 @@ declare module "crypto" {
764
1138
  * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
765
1139
  * passed to [`crypto.createPublicKey()`][].
766
1140
  */
767
- function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
1141
+ function verify(
1142
+ algorithm: string | null | undefined,
1143
+ data: NodeJS.ArrayBufferView,
1144
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
1145
+ signature: NodeJS.ArrayBufferView,
1146
+ ): boolean;
768
1147
 
769
1148
  /**
770
1149
  * Computes the Diffie-Hellman secret based on a privateKey and a publicKey.
771
1150
  * Both keys must have the same asymmetricKeyType, which must be one of
772
1151
  * 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES).
773
1152
  */
774
- function diffieHellman(options: {
775
- privateKey: KeyObject;
776
- publicKey: KeyObject
777
- }): Buffer;
1153
+ function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
778
1154
  }
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.14.15",
3
+ "version": "14.14.16",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -246,6 +246,6 @@
246
246
  },
247
247
  "scripts": {},
248
248
  "dependencies": {},
249
- "typesPublisherContentHash": "a7c5ff032777be0555023d22f1ff40511b7f9f5b99cbad9620e747bf5c315d7d",
249
+ "typesPublisherContentHash": "2d4f09678c547a590a021a003c6ada9c287ace6cba79d28af6b988612252de2d",
250
250
  "typeScriptVersion": "3.3"
251
251
  }