@types/node 22.15.33 → 22.18.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node v22.18/README.md +15 -0
- {node v22.15 → node v22.18}/assert.d.ts +19 -0
- {node v22.15 → node v22.18}/buffer.buffer.d.ts +9 -0
- {node v22.15 → node v22.18}/buffer.d.ts +14 -6
- {node v22.15 → node v22.18}/child_process.d.ts +89 -162
- {node v22.15 → node v22.18}/cluster.d.ts +4 -5
- {node v22.15 → node v22.18}/crypto.d.ts +203 -167
- {node v22.15 → node v22.18}/dgram.d.ts +9 -8
- {node v22.15 → node v22.18}/dns/promises.d.ts +11 -10
- {node v22.15 → node v22.18}/dns.d.ts +19 -20
- {node v22.15 → node v22.18}/events.d.ts +80 -35
- {node v22.15 → node v22.18}/fs/promises.d.ts +78 -56
- {node v22.15 → node v22.18}/fs.d.ts +153 -129
- node v22.18/globals.d.ts +172 -0
- node v22.18/globals.typedarray.d.ts +38 -0
- {node v22.15 → node v22.18}/http.d.ts +112 -32
- {node v22.15 → node v22.18}/http2.d.ts +45 -26
- {node v22.15 → node v22.18}/https.d.ts +96 -62
- {node v22.15 → node v22.18}/index.d.ts +7 -3
- node v22.15/inspector.d.ts → node v22.18/inspector.generated.d.ts +219 -10
- {node v22.15 → node v22.18}/module.d.ts +70 -13
- {node v22.15 → node v22.18}/net.d.ts +12 -11
- {node v22.15 → node v22.18}/os.d.ts +14 -3
- {node v22.15 → node v22.18}/package.json +3 -83
- {node v22.15 → node v22.18}/perf_hooks.d.ts +6 -8
- {node v22.15 → node v22.18}/process.d.ts +15 -27
- {node v22.15 → node v22.18}/readline/promises.d.ts +1 -2
- {node v22.15 → node v22.18}/repl.d.ts +3 -5
- {node v22.15 → node v22.18}/sqlite.d.ts +212 -6
- {node v22.15 → node v22.18}/stream/consumers.d.ts +2 -2
- {node v22.15 → node v22.18}/stream/web.d.ts +8 -0
- {node v22.15 → node v22.18}/stream.d.ts +29 -33
- {node v22.15 → node v22.18}/string_decoder.d.ts +2 -2
- node v22.18/test.d.ts +2162 -0
- {node v22.15 → node v22.18}/tls.d.ts +90 -66
- {node v22.15 → node v22.18}/ts5.6/buffer.buffer.d.ts +10 -2
- node v22.18/ts5.6/globals.typedarray.d.ts +34 -0
- {node v22.15 → node v22.18}/ts5.6/index.d.ts +7 -3
- {node v22.15 → node v22.18}/url.d.ts +13 -4
- {node v22.15 → node v22.18}/util.d.ts +21 -6
- {node v22.15 → node v22.18}/v8.d.ts +33 -35
- {node v22.15 → node v22.18}/vm.d.ts +21 -50
- {node v22.15 → node v22.18}/wasi.d.ts +1 -1
- node v22.18/web-globals/abortcontroller.d.ts +34 -0
- node v22.18/web-globals/domexception.d.ts +68 -0
- node v22.15/dom-events.d.ts → node v22.18/web-globals/events.d.ts +49 -51
- node v22.18/web-globals/fetch.d.ts +46 -0
- node v22.18/web-globals/navigator.d.ts +22 -0
- node v22.18/web-globals/storage.d.ts +24 -0
- {node v22.15 → node v22.18}/worker_threads.d.ts +86 -67
- {node v22.15 → node v22.18}/zlib.d.ts +33 -26
- node v22.15/README.md +0 -15
- node v22.15/globals.d.ts +0 -364
- node v22.15/globals.typedarray.d.ts +0 -21
- node v22.15/test.d.ts +0 -2278
- node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
- {node v22.15 → node v22.18}/LICENSE +0 -0
- {node v22.15 → node v22.18}/assert/strict.d.ts +0 -0
- {node v22.15 → node v22.18}/async_hooks.d.ts +1 -1
- {node v22.15 → node v22.18}/compatibility/disposable.d.ts +0 -0
- {node v22.15 → node v22.18}/compatibility/index.d.ts +0 -0
- {node v22.15 → node v22.18}/compatibility/indexable.d.ts +0 -0
- {node v22.15 → node v22.18}/compatibility/iterators.d.ts +0 -0
- {node v22.15 → node v22.18}/console.d.ts +0 -0
- {node v22.15 → node v22.18}/constants.d.ts +0 -0
- {node v22.15 → node v22.18}/diagnostics_channel.d.ts +0 -0
- {node v22.15 → node v22.18}/domain.d.ts +0 -0
- {node v22.15 → node v22.18}/path.d.ts +0 -0
- {node v22.15 → node v22.18}/punycode.d.ts +0 -0
- {node v22.15 → node v22.18}/querystring.d.ts +0 -0
- {node v22.15 → node v22.18}/readline.d.ts +0 -0
- {node v22.15 → node v22.18}/sea.d.ts +0 -0
- {node v22.15 → node v22.18}/stream/promises.d.ts +0 -0
- {node v22.15 → node v22.18}/timers/promises.d.ts +0 -0
- {node v22.15 → node v22.18}/timers.d.ts +0 -0
- {node v22.15 → node v22.18}/trace_events.d.ts +0 -0
- {node v22.15 → node v22.18}/tty.d.ts +0 -0
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/crypto.js)
|
|
18
18
|
*/
|
|
19
19
|
declare module "crypto" {
|
|
20
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
20
21
|
import * as stream from "node:stream";
|
|
21
22
|
import { PeerCertificate } from "node:tls";
|
|
22
23
|
/**
|
|
@@ -44,7 +45,7 @@ declare module "crypto" {
|
|
|
44
45
|
* @param encoding The `encoding` of the `spkac` string.
|
|
45
46
|
* @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
|
|
46
47
|
*/
|
|
47
|
-
static exportChallenge(spkac: BinaryLike):
|
|
48
|
+
static exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
48
49
|
/**
|
|
49
50
|
* ```js
|
|
50
51
|
* const { Certificate } = await import('node:crypto');
|
|
@@ -57,7 +58,7 @@ declare module "crypto" {
|
|
|
57
58
|
* @param encoding The `encoding` of the `spkac` string.
|
|
58
59
|
* @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
|
|
59
60
|
*/
|
|
60
|
-
static exportPublicKey(spkac: BinaryLike, encoding?: string):
|
|
61
|
+
static exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
61
62
|
/**
|
|
62
63
|
* ```js
|
|
63
64
|
* import { Buffer } from 'node:buffer';
|
|
@@ -78,7 +79,7 @@ declare module "crypto" {
|
|
|
78
79
|
* @returns The challenge component of the `spkac` data structure,
|
|
79
80
|
* which includes a public key and a challenge.
|
|
80
81
|
*/
|
|
81
|
-
exportChallenge(spkac: BinaryLike):
|
|
82
|
+
exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
82
83
|
/**
|
|
83
84
|
* @deprecated
|
|
84
85
|
* @param spkac
|
|
@@ -86,7 +87,7 @@ declare module "crypto" {
|
|
|
86
87
|
* @returns The public key component of the `spkac` data structure,
|
|
87
88
|
* which includes a public key and a challenge.
|
|
88
89
|
*/
|
|
89
|
-
exportPublicKey(spkac: BinaryLike, encoding?: string):
|
|
90
|
+
exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
90
91
|
/**
|
|
91
92
|
* @deprecated
|
|
92
93
|
* @param spkac
|
|
@@ -402,7 +403,7 @@ declare module "crypto" {
|
|
|
402
403
|
* @since v0.1.92
|
|
403
404
|
* @param encoding The `encoding` of the return value.
|
|
404
405
|
*/
|
|
405
|
-
digest():
|
|
406
|
+
digest(): NonSharedBuffer;
|
|
406
407
|
digest(encoding: BinaryToTextEncoding): string;
|
|
407
408
|
}
|
|
408
409
|
/**
|
|
@@ -496,7 +497,7 @@ declare module "crypto" {
|
|
|
496
497
|
* @since v0.1.94
|
|
497
498
|
* @param encoding The `encoding` of the return value.
|
|
498
499
|
*/
|
|
499
|
-
digest():
|
|
500
|
+
digest(): NonSharedBuffer;
|
|
500
501
|
digest(encoding: BinaryToTextEncoding): string;
|
|
501
502
|
}
|
|
502
503
|
type KeyObjectType = "secret" | "public" | "private";
|
|
@@ -510,50 +511,50 @@ declare module "crypto" {
|
|
|
510
511
|
format: "jwk";
|
|
511
512
|
}
|
|
512
513
|
interface JsonWebKey {
|
|
513
|
-
crv?: string
|
|
514
|
-
d?: string
|
|
515
|
-
dp?: string
|
|
516
|
-
dq?: string
|
|
517
|
-
e?: string
|
|
518
|
-
k?: string
|
|
519
|
-
kty?: string
|
|
520
|
-
n?: string
|
|
521
|
-
p?: string
|
|
522
|
-
q?: string
|
|
523
|
-
qi?: string
|
|
524
|
-
x?: string
|
|
525
|
-
y?: string
|
|
514
|
+
crv?: string;
|
|
515
|
+
d?: string;
|
|
516
|
+
dp?: string;
|
|
517
|
+
dq?: string;
|
|
518
|
+
e?: string;
|
|
519
|
+
k?: string;
|
|
520
|
+
kty?: string;
|
|
521
|
+
n?: string;
|
|
522
|
+
p?: string;
|
|
523
|
+
q?: string;
|
|
524
|
+
qi?: string;
|
|
525
|
+
x?: string;
|
|
526
|
+
y?: string;
|
|
526
527
|
[key: string]: unknown;
|
|
527
528
|
}
|
|
528
529
|
interface AsymmetricKeyDetails {
|
|
529
530
|
/**
|
|
530
531
|
* Key size in bits (RSA, DSA).
|
|
531
532
|
*/
|
|
532
|
-
modulusLength?: number
|
|
533
|
+
modulusLength?: number;
|
|
533
534
|
/**
|
|
534
535
|
* Public exponent (RSA).
|
|
535
536
|
*/
|
|
536
|
-
publicExponent?: bigint
|
|
537
|
+
publicExponent?: bigint;
|
|
537
538
|
/**
|
|
538
539
|
* Name of the message digest (RSA-PSS).
|
|
539
540
|
*/
|
|
540
|
-
hashAlgorithm?: string
|
|
541
|
+
hashAlgorithm?: string;
|
|
541
542
|
/**
|
|
542
543
|
* Name of the message digest used by MGF1 (RSA-PSS).
|
|
543
544
|
*/
|
|
544
|
-
mgf1HashAlgorithm?: string
|
|
545
|
+
mgf1HashAlgorithm?: string;
|
|
545
546
|
/**
|
|
546
547
|
* Minimal salt length in bytes (RSA-PSS).
|
|
547
548
|
*/
|
|
548
|
-
saltLength?: number
|
|
549
|
+
saltLength?: number;
|
|
549
550
|
/**
|
|
550
551
|
* Size of q in bits (DSA).
|
|
551
552
|
*/
|
|
552
|
-
divisorLength?: number
|
|
553
|
+
divisorLength?: number;
|
|
553
554
|
/**
|
|
554
555
|
* Name of the curve (EC).
|
|
555
556
|
*/
|
|
556
|
-
namedCurve?: string
|
|
557
|
+
namedCurve?: string;
|
|
557
558
|
}
|
|
558
559
|
/**
|
|
559
560
|
* Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
|
|
@@ -608,7 +609,7 @@ declare module "crypto" {
|
|
|
608
609
|
* keys.
|
|
609
610
|
* @since v11.6.0
|
|
610
611
|
*/
|
|
611
|
-
asymmetricKeyType?: KeyType
|
|
612
|
+
asymmetricKeyType?: KeyType;
|
|
612
613
|
/**
|
|
613
614
|
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
614
615
|
* this object contains information about the key. None of the information obtained
|
|
@@ -622,7 +623,7 @@ declare module "crypto" {
|
|
|
622
623
|
* Other key details might be exposed via this API using additional attributes.
|
|
623
624
|
* @since v15.7.0
|
|
624
625
|
*/
|
|
625
|
-
asymmetricKeyDetails?: AsymmetricKeyDetails
|
|
626
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
626
627
|
/**
|
|
627
628
|
* For symmetric keys, the following encoding options can be used:
|
|
628
629
|
*
|
|
@@ -646,8 +647,8 @@ declare module "crypto" {
|
|
|
646
647
|
* PKCS#1 and SEC1 encryption.
|
|
647
648
|
* @since v11.6.0
|
|
648
649
|
*/
|
|
649
|
-
export(options: KeyExportOptions<"pem">): string |
|
|
650
|
-
export(options?: KeyExportOptions<"der">):
|
|
650
|
+
export(options: KeyExportOptions<"pem">): string | NonSharedBuffer;
|
|
651
|
+
export(options?: KeyExportOptions<"der">): NonSharedBuffer;
|
|
651
652
|
export(options?: JwkKeyExportOptions): JsonWebKey;
|
|
652
653
|
/**
|
|
653
654
|
* Returns `true` or `false` depending on whether the keys have exactly the same
|
|
@@ -661,7 +662,7 @@ declare module "crypto" {
|
|
|
661
662
|
* property is `undefined` for asymmetric keys.
|
|
662
663
|
* @since v11.6.0
|
|
663
664
|
*/
|
|
664
|
-
symmetricKeySize?: number
|
|
665
|
+
symmetricKeySize?: number;
|
|
665
666
|
/**
|
|
666
667
|
* Converts a `KeyObject` instance to a `CryptoKey`.
|
|
667
668
|
* @since 22.10.0
|
|
@@ -896,8 +897,8 @@ declare module "crypto" {
|
|
|
896
897
|
* @param inputEncoding The `encoding` of the data.
|
|
897
898
|
* @param outputEncoding The `encoding` of the return value.
|
|
898
899
|
*/
|
|
899
|
-
update(data: BinaryLike):
|
|
900
|
-
update(data: string, inputEncoding: Encoding):
|
|
900
|
+
update(data: BinaryLike): NonSharedBuffer;
|
|
901
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
901
902
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
902
903
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
903
904
|
/**
|
|
@@ -908,7 +909,7 @@ declare module "crypto" {
|
|
|
908
909
|
* @param outputEncoding The `encoding` of the return value.
|
|
909
910
|
* @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
910
911
|
*/
|
|
911
|
-
final():
|
|
912
|
+
final(): NonSharedBuffer;
|
|
912
913
|
final(outputEncoding: BufferEncoding): string;
|
|
913
914
|
/**
|
|
914
915
|
* When using block encryption algorithms, the `Cipher` class will automatically
|
|
@@ -934,7 +935,7 @@ declare module "crypto" {
|
|
|
934
935
|
plaintextLength: number;
|
|
935
936
|
},
|
|
936
937
|
): this;
|
|
937
|
-
getAuthTag():
|
|
938
|
+
getAuthTag(): NonSharedBuffer;
|
|
938
939
|
}
|
|
939
940
|
interface CipherGCM extends Cipher {
|
|
940
941
|
setAAD(
|
|
@@ -943,7 +944,7 @@ declare module "crypto" {
|
|
|
943
944
|
plaintextLength: number;
|
|
944
945
|
},
|
|
945
946
|
): this;
|
|
946
|
-
getAuthTag():
|
|
947
|
+
getAuthTag(): NonSharedBuffer;
|
|
947
948
|
}
|
|
948
949
|
interface CipherOCB extends Cipher {
|
|
949
950
|
setAAD(
|
|
@@ -952,7 +953,7 @@ declare module "crypto" {
|
|
|
952
953
|
plaintextLength: number;
|
|
953
954
|
},
|
|
954
955
|
): this;
|
|
955
|
-
getAuthTag():
|
|
956
|
+
getAuthTag(): NonSharedBuffer;
|
|
956
957
|
}
|
|
957
958
|
interface CipherChaCha20Poly1305 extends Cipher {
|
|
958
959
|
setAAD(
|
|
@@ -961,7 +962,7 @@ declare module "crypto" {
|
|
|
961
962
|
plaintextLength: number;
|
|
962
963
|
},
|
|
963
964
|
): this;
|
|
964
|
-
getAuthTag():
|
|
965
|
+
getAuthTag(): NonSharedBuffer;
|
|
965
966
|
}
|
|
966
967
|
/**
|
|
967
968
|
* Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
|
|
@@ -1146,8 +1147,8 @@ declare module "crypto" {
|
|
|
1146
1147
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1147
1148
|
* @param outputEncoding The `encoding` of the return value.
|
|
1148
1149
|
*/
|
|
1149
|
-
update(data: NodeJS.ArrayBufferView):
|
|
1150
|
-
update(data: string, inputEncoding: Encoding):
|
|
1150
|
+
update(data: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
1151
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
1151
1152
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
1152
1153
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
1153
1154
|
/**
|
|
@@ -1158,7 +1159,7 @@ declare module "crypto" {
|
|
|
1158
1159
|
* @param outputEncoding The `encoding` of the return value.
|
|
1159
1160
|
* @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
1160
1161
|
*/
|
|
1161
|
-
final():
|
|
1162
|
+
final(): NonSharedBuffer;
|
|
1162
1163
|
final(outputEncoding: BufferEncoding): string;
|
|
1163
1164
|
/**
|
|
1164
1165
|
* When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
|
|
@@ -1430,7 +1431,7 @@ declare module "crypto" {
|
|
|
1430
1431
|
* called. Multiple calls to `sign.sign()` will result in an error being thrown.
|
|
1431
1432
|
* @since v0.1.92
|
|
1432
1433
|
*/
|
|
1433
|
-
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput):
|
|
1434
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
1434
1435
|
sign(
|
|
1435
1436
|
privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
1436
1437
|
outputFormat: BinaryToTextEncoding,
|
|
@@ -1589,7 +1590,7 @@ declare module "crypto" {
|
|
|
1589
1590
|
* @since v0.5.0
|
|
1590
1591
|
* @param encoding The `encoding` of the return value.
|
|
1591
1592
|
*/
|
|
1592
|
-
generateKeys():
|
|
1593
|
+
generateKeys(): NonSharedBuffer;
|
|
1593
1594
|
generateKeys(encoding: BinaryToTextEncoding): string;
|
|
1594
1595
|
/**
|
|
1595
1596
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
@@ -1604,8 +1605,16 @@ declare module "crypto" {
|
|
|
1604
1605
|
* @param inputEncoding The `encoding` of an `otherPublicKey` string.
|
|
1605
1606
|
* @param outputEncoding The `encoding` of the return value.
|
|
1606
1607
|
*/
|
|
1607
|
-
computeSecret(
|
|
1608
|
-
|
|
1608
|
+
computeSecret(
|
|
1609
|
+
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1610
|
+
inputEncoding?: null,
|
|
1611
|
+
outputEncoding?: null,
|
|
1612
|
+
): NonSharedBuffer;
|
|
1613
|
+
computeSecret(
|
|
1614
|
+
otherPublicKey: string,
|
|
1615
|
+
inputEncoding: BinaryToTextEncoding,
|
|
1616
|
+
outputEncoding?: null,
|
|
1617
|
+
): NonSharedBuffer;
|
|
1609
1618
|
computeSecret(
|
|
1610
1619
|
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1611
1620
|
inputEncoding: null,
|
|
@@ -1623,7 +1632,7 @@ declare module "crypto" {
|
|
|
1623
1632
|
* @since v0.5.0
|
|
1624
1633
|
* @param encoding The `encoding` of the return value.
|
|
1625
1634
|
*/
|
|
1626
|
-
getPrime():
|
|
1635
|
+
getPrime(): NonSharedBuffer;
|
|
1627
1636
|
getPrime(encoding: BinaryToTextEncoding): string;
|
|
1628
1637
|
/**
|
|
1629
1638
|
* Returns the Diffie-Hellman generator in the specified `encoding`.
|
|
@@ -1632,7 +1641,7 @@ declare module "crypto" {
|
|
|
1632
1641
|
* @since v0.5.0
|
|
1633
1642
|
* @param encoding The `encoding` of the return value.
|
|
1634
1643
|
*/
|
|
1635
|
-
getGenerator():
|
|
1644
|
+
getGenerator(): NonSharedBuffer;
|
|
1636
1645
|
getGenerator(encoding: BinaryToTextEncoding): string;
|
|
1637
1646
|
/**
|
|
1638
1647
|
* Returns the Diffie-Hellman public key in the specified `encoding`.
|
|
@@ -1641,7 +1650,7 @@ declare module "crypto" {
|
|
|
1641
1650
|
* @since v0.5.0
|
|
1642
1651
|
* @param encoding The `encoding` of the return value.
|
|
1643
1652
|
*/
|
|
1644
|
-
getPublicKey():
|
|
1653
|
+
getPublicKey(): NonSharedBuffer;
|
|
1645
1654
|
getPublicKey(encoding: BinaryToTextEncoding): string;
|
|
1646
1655
|
/**
|
|
1647
1656
|
* Returns the Diffie-Hellman private key in the specified `encoding`.
|
|
@@ -1650,7 +1659,7 @@ declare module "crypto" {
|
|
|
1650
1659
|
* @since v0.5.0
|
|
1651
1660
|
* @param encoding The `encoding` of the return value.
|
|
1652
1661
|
*/
|
|
1653
|
-
getPrivateKey():
|
|
1662
|
+
getPrivateKey(): NonSharedBuffer;
|
|
1654
1663
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
1655
1664
|
/**
|
|
1656
1665
|
* Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected
|
|
@@ -1794,7 +1803,7 @@ declare module "crypto" {
|
|
|
1794
1803
|
iterations: number,
|
|
1795
1804
|
keylen: number,
|
|
1796
1805
|
digest: string,
|
|
1797
|
-
callback: (err: Error | null, derivedKey:
|
|
1806
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
1798
1807
|
): void;
|
|
1799
1808
|
/**
|
|
1800
1809
|
* Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
|
@@ -1831,7 +1840,7 @@ declare module "crypto" {
|
|
|
1831
1840
|
iterations: number,
|
|
1832
1841
|
keylen: number,
|
|
1833
1842
|
digest: string,
|
|
1834
|
-
):
|
|
1843
|
+
): NonSharedBuffer;
|
|
1835
1844
|
/**
|
|
1836
1845
|
* Generates cryptographically strong pseudorandom data. The `size` argument
|
|
1837
1846
|
* is a number indicating the number of bytes to generate.
|
|
@@ -1884,10 +1893,10 @@ declare module "crypto" {
|
|
|
1884
1893
|
* @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
|
|
1885
1894
|
* @return if the `callback` function is not provided.
|
|
1886
1895
|
*/
|
|
1887
|
-
function randomBytes(size: number):
|
|
1888
|
-
function randomBytes(size: number, callback: (err: Error | null, buf:
|
|
1889
|
-
function pseudoRandomBytes(size: number):
|
|
1890
|
-
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf:
|
|
1896
|
+
function randomBytes(size: number): NonSharedBuffer;
|
|
1897
|
+
function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
1898
|
+
function pseudoRandomBytes(size: number): NonSharedBuffer;
|
|
1899
|
+
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
1891
1900
|
/**
|
|
1892
1901
|
* Return a random integer `n` such that `min <= n < max`. This
|
|
1893
1902
|
* implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
|
|
@@ -2117,14 +2126,14 @@ declare module "crypto" {
|
|
|
2117
2126
|
password: BinaryLike,
|
|
2118
2127
|
salt: BinaryLike,
|
|
2119
2128
|
keylen: number,
|
|
2120
|
-
callback: (err: Error | null, derivedKey:
|
|
2129
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
2121
2130
|
): void;
|
|
2122
2131
|
function scrypt(
|
|
2123
2132
|
password: BinaryLike,
|
|
2124
2133
|
salt: BinaryLike,
|
|
2125
2134
|
keylen: number,
|
|
2126
2135
|
options: ScryptOptions,
|
|
2127
|
-
callback: (err: Error | null, derivedKey:
|
|
2136
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
2128
2137
|
): void;
|
|
2129
2138
|
/**
|
|
2130
2139
|
* Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
|
|
@@ -2156,7 +2165,12 @@ declare module "crypto" {
|
|
|
2156
2165
|
* ```
|
|
2157
2166
|
* @since v10.5.0
|
|
2158
2167
|
*/
|
|
2159
|
-
function scryptSync(
|
|
2168
|
+
function scryptSync(
|
|
2169
|
+
password: BinaryLike,
|
|
2170
|
+
salt: BinaryLike,
|
|
2171
|
+
keylen: number,
|
|
2172
|
+
options?: ScryptOptions,
|
|
2173
|
+
): NonSharedBuffer;
|
|
2160
2174
|
interface RsaPublicKey {
|
|
2161
2175
|
key: KeyLike;
|
|
2162
2176
|
padding?: number | undefined;
|
|
@@ -2185,7 +2199,7 @@ declare module "crypto" {
|
|
|
2185
2199
|
function publicEncrypt(
|
|
2186
2200
|
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2187
2201
|
buffer: NodeJS.ArrayBufferView | string,
|
|
2188
|
-
):
|
|
2202
|
+
): NonSharedBuffer;
|
|
2189
2203
|
/**
|
|
2190
2204
|
* Decrypts `buffer` with `key`.`buffer` was previously encrypted using
|
|
2191
2205
|
* the corresponding private key, for example using {@link privateEncrypt}.
|
|
@@ -2200,7 +2214,7 @@ declare module "crypto" {
|
|
|
2200
2214
|
function publicDecrypt(
|
|
2201
2215
|
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2202
2216
|
buffer: NodeJS.ArrayBufferView | string,
|
|
2203
|
-
):
|
|
2217
|
+
): NonSharedBuffer;
|
|
2204
2218
|
/**
|
|
2205
2219
|
* Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
|
|
2206
2220
|
* the corresponding public key, for example using {@link publicEncrypt}.
|
|
@@ -2209,7 +2223,10 @@ declare module "crypto" {
|
|
|
2209
2223
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
|
|
2210
2224
|
* @since v0.11.14
|
|
2211
2225
|
*/
|
|
2212
|
-
function privateDecrypt(
|
|
2226
|
+
function privateDecrypt(
|
|
2227
|
+
privateKey: RsaPrivateKey | KeyLike,
|
|
2228
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2229
|
+
): NonSharedBuffer;
|
|
2213
2230
|
/**
|
|
2214
2231
|
* Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
|
|
2215
2232
|
* the corresponding public key, for example using {@link publicDecrypt}.
|
|
@@ -2218,7 +2235,10 @@ declare module "crypto" {
|
|
|
2218
2235
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
|
|
2219
2236
|
* @since v1.1.0
|
|
2220
2237
|
*/
|
|
2221
|
-
function privateEncrypt(
|
|
2238
|
+
function privateEncrypt(
|
|
2239
|
+
privateKey: RsaPrivateKey | KeyLike,
|
|
2240
|
+
buffer: NodeJS.ArrayBufferView | string,
|
|
2241
|
+
): NonSharedBuffer;
|
|
2222
2242
|
/**
|
|
2223
2243
|
* ```js
|
|
2224
2244
|
* const {
|
|
@@ -2347,7 +2367,7 @@ declare module "crypto" {
|
|
|
2347
2367
|
inputEncoding?: BinaryToTextEncoding,
|
|
2348
2368
|
outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
|
|
2349
2369
|
format?: "uncompressed" | "compressed" | "hybrid",
|
|
2350
|
-
):
|
|
2370
|
+
): NonSharedBuffer | string;
|
|
2351
2371
|
/**
|
|
2352
2372
|
* Generates private and public EC Diffie-Hellman key values, and returns
|
|
2353
2373
|
* the public key in the specified `format` and `encoding`. This key should be
|
|
@@ -2360,7 +2380,7 @@ declare module "crypto" {
|
|
|
2360
2380
|
* @param encoding The `encoding` of the return value.
|
|
2361
2381
|
* @param [format='uncompressed']
|
|
2362
2382
|
*/
|
|
2363
|
-
generateKeys():
|
|
2383
|
+
generateKeys(): NonSharedBuffer;
|
|
2364
2384
|
generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2365
2385
|
/**
|
|
2366
2386
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
@@ -2379,8 +2399,8 @@ declare module "crypto" {
|
|
|
2379
2399
|
* @param inputEncoding The `encoding` of the `otherPublicKey` string.
|
|
2380
2400
|
* @param outputEncoding The `encoding` of the return value.
|
|
2381
2401
|
*/
|
|
2382
|
-
computeSecret(otherPublicKey: NodeJS.ArrayBufferView):
|
|
2383
|
-
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding):
|
|
2402
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
2403
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer;
|
|
2384
2404
|
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
2385
2405
|
computeSecret(
|
|
2386
2406
|
otherPublicKey: string,
|
|
@@ -2394,7 +2414,7 @@ declare module "crypto" {
|
|
|
2394
2414
|
* @param encoding The `encoding` of the return value.
|
|
2395
2415
|
* @return The EC Diffie-Hellman in the specified `encoding`.
|
|
2396
2416
|
*/
|
|
2397
|
-
getPrivateKey():
|
|
2417
|
+
getPrivateKey(): NonSharedBuffer;
|
|
2398
2418
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
2399
2419
|
/**
|
|
2400
2420
|
* The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
|
|
@@ -2406,7 +2426,7 @@ declare module "crypto" {
|
|
|
2406
2426
|
* @param [format='uncompressed']
|
|
2407
2427
|
* @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
|
|
2408
2428
|
*/
|
|
2409
|
-
getPublicKey(encoding?: null, format?: ECDHKeyFormat):
|
|
2429
|
+
getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
|
|
2410
2430
|
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2411
2431
|
/**
|
|
2412
2432
|
* Sets the EC Diffie-Hellman private key.
|
|
@@ -2505,15 +2525,15 @@ declare module "crypto" {
|
|
|
2505
2525
|
/**
|
|
2506
2526
|
* Name of the message digest
|
|
2507
2527
|
*/
|
|
2508
|
-
hashAlgorithm?: string;
|
|
2528
|
+
hashAlgorithm?: string | undefined;
|
|
2509
2529
|
/**
|
|
2510
2530
|
* Name of the message digest used by MGF1
|
|
2511
2531
|
*/
|
|
2512
|
-
mgf1HashAlgorithm?: string;
|
|
2532
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2513
2533
|
/**
|
|
2514
2534
|
* Minimal salt length in bytes
|
|
2515
2535
|
*/
|
|
2516
|
-
saltLength?: string;
|
|
2536
|
+
saltLength?: string | undefined;
|
|
2517
2537
|
}
|
|
2518
2538
|
interface DSAKeyPairKeyObjectOptions {
|
|
2519
2539
|
/**
|
|
@@ -2556,15 +2576,15 @@ declare module "crypto" {
|
|
|
2556
2576
|
/**
|
|
2557
2577
|
* Name of the message digest
|
|
2558
2578
|
*/
|
|
2559
|
-
hashAlgorithm?: string;
|
|
2579
|
+
hashAlgorithm?: string | undefined;
|
|
2560
2580
|
/**
|
|
2561
2581
|
* Name of the message digest used by MGF1
|
|
2562
2582
|
*/
|
|
2563
|
-
mgf1HashAlgorithm?: string;
|
|
2583
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
2564
2584
|
/**
|
|
2565
2585
|
* Minimal salt length in bytes
|
|
2566
2586
|
*/
|
|
2567
|
-
saltLength?: string;
|
|
2587
|
+
saltLength?: string | undefined;
|
|
2568
2588
|
publicKeyEncoding: {
|
|
2569
2589
|
type: "spki";
|
|
2570
2590
|
format: PubF;
|
|
@@ -2687,15 +2707,15 @@ declare module "crypto" {
|
|
|
2687
2707
|
function generateKeyPairSync(
|
|
2688
2708
|
type: "rsa",
|
|
2689
2709
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
2690
|
-
): KeyPairSyncResult<string,
|
|
2710
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2691
2711
|
function generateKeyPairSync(
|
|
2692
2712
|
type: "rsa",
|
|
2693
2713
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
2694
|
-
): KeyPairSyncResult<
|
|
2714
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2695
2715
|
function generateKeyPairSync(
|
|
2696
2716
|
type: "rsa",
|
|
2697
2717
|
options: RSAKeyPairOptions<"der", "der">,
|
|
2698
|
-
): KeyPairSyncResult<
|
|
2718
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2699
2719
|
function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2700
2720
|
function generateKeyPairSync(
|
|
2701
2721
|
type: "rsa-pss",
|
|
@@ -2704,15 +2724,15 @@ declare module "crypto" {
|
|
|
2704
2724
|
function generateKeyPairSync(
|
|
2705
2725
|
type: "rsa-pss",
|
|
2706
2726
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2707
|
-
): KeyPairSyncResult<string,
|
|
2727
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2708
2728
|
function generateKeyPairSync(
|
|
2709
2729
|
type: "rsa-pss",
|
|
2710
2730
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2711
|
-
): KeyPairSyncResult<
|
|
2731
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2712
2732
|
function generateKeyPairSync(
|
|
2713
2733
|
type: "rsa-pss",
|
|
2714
2734
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2715
|
-
): KeyPairSyncResult<
|
|
2735
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2716
2736
|
function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2717
2737
|
function generateKeyPairSync(
|
|
2718
2738
|
type: "dsa",
|
|
@@ -2721,15 +2741,15 @@ declare module "crypto" {
|
|
|
2721
2741
|
function generateKeyPairSync(
|
|
2722
2742
|
type: "dsa",
|
|
2723
2743
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
2724
|
-
): KeyPairSyncResult<string,
|
|
2744
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2725
2745
|
function generateKeyPairSync(
|
|
2726
2746
|
type: "dsa",
|
|
2727
2747
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
2728
|
-
): KeyPairSyncResult<
|
|
2748
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2729
2749
|
function generateKeyPairSync(
|
|
2730
2750
|
type: "dsa",
|
|
2731
2751
|
options: DSAKeyPairOptions<"der", "der">,
|
|
2732
|
-
): KeyPairSyncResult<
|
|
2752
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2733
2753
|
function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2734
2754
|
function generateKeyPairSync(
|
|
2735
2755
|
type: "ec",
|
|
@@ -2738,15 +2758,15 @@ declare module "crypto" {
|
|
|
2738
2758
|
function generateKeyPairSync(
|
|
2739
2759
|
type: "ec",
|
|
2740
2760
|
options: ECKeyPairOptions<"pem", "der">,
|
|
2741
|
-
): KeyPairSyncResult<string,
|
|
2761
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2742
2762
|
function generateKeyPairSync(
|
|
2743
2763
|
type: "ec",
|
|
2744
2764
|
options: ECKeyPairOptions<"der", "pem">,
|
|
2745
|
-
): KeyPairSyncResult<
|
|
2765
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2746
2766
|
function generateKeyPairSync(
|
|
2747
2767
|
type: "ec",
|
|
2748
2768
|
options: ECKeyPairOptions<"der", "der">,
|
|
2749
|
-
): KeyPairSyncResult<
|
|
2769
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2750
2770
|
function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2751
2771
|
function generateKeyPairSync(
|
|
2752
2772
|
type: "ed25519",
|
|
@@ -2755,15 +2775,15 @@ declare module "crypto" {
|
|
|
2755
2775
|
function generateKeyPairSync(
|
|
2756
2776
|
type: "ed25519",
|
|
2757
2777
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
2758
|
-
): KeyPairSyncResult<string,
|
|
2778
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2759
2779
|
function generateKeyPairSync(
|
|
2760
2780
|
type: "ed25519",
|
|
2761
2781
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
2762
|
-
): KeyPairSyncResult<
|
|
2782
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2763
2783
|
function generateKeyPairSync(
|
|
2764
2784
|
type: "ed25519",
|
|
2765
2785
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
2766
|
-
): KeyPairSyncResult<
|
|
2786
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2767
2787
|
function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2768
2788
|
function generateKeyPairSync(
|
|
2769
2789
|
type: "ed448",
|
|
@@ -2772,15 +2792,15 @@ declare module "crypto" {
|
|
|
2772
2792
|
function generateKeyPairSync(
|
|
2773
2793
|
type: "ed448",
|
|
2774
2794
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
2775
|
-
): KeyPairSyncResult<string,
|
|
2795
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2776
2796
|
function generateKeyPairSync(
|
|
2777
2797
|
type: "ed448",
|
|
2778
2798
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
2779
|
-
): KeyPairSyncResult<
|
|
2799
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2780
2800
|
function generateKeyPairSync(
|
|
2781
2801
|
type: "ed448",
|
|
2782
2802
|
options: ED448KeyPairOptions<"der", "der">,
|
|
2783
|
-
): KeyPairSyncResult<
|
|
2803
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2784
2804
|
function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2785
2805
|
function generateKeyPairSync(
|
|
2786
2806
|
type: "x25519",
|
|
@@ -2789,15 +2809,15 @@ declare module "crypto" {
|
|
|
2789
2809
|
function generateKeyPairSync(
|
|
2790
2810
|
type: "x25519",
|
|
2791
2811
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
2792
|
-
): KeyPairSyncResult<string,
|
|
2812
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2793
2813
|
function generateKeyPairSync(
|
|
2794
2814
|
type: "x25519",
|
|
2795
2815
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
2796
|
-
): KeyPairSyncResult<
|
|
2816
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2797
2817
|
function generateKeyPairSync(
|
|
2798
2818
|
type: "x25519",
|
|
2799
2819
|
options: X25519KeyPairOptions<"der", "der">,
|
|
2800
|
-
): KeyPairSyncResult<
|
|
2820
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2801
2821
|
function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2802
2822
|
function generateKeyPairSync(
|
|
2803
2823
|
type: "x448",
|
|
@@ -2806,15 +2826,15 @@ declare module "crypto" {
|
|
|
2806
2826
|
function generateKeyPairSync(
|
|
2807
2827
|
type: "x448",
|
|
2808
2828
|
options: X448KeyPairOptions<"pem", "der">,
|
|
2809
|
-
): KeyPairSyncResult<string,
|
|
2829
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2810
2830
|
function generateKeyPairSync(
|
|
2811
2831
|
type: "x448",
|
|
2812
2832
|
options: X448KeyPairOptions<"der", "pem">,
|
|
2813
|
-
): KeyPairSyncResult<
|
|
2833
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2814
2834
|
function generateKeyPairSync(
|
|
2815
2835
|
type: "x448",
|
|
2816
2836
|
options: X448KeyPairOptions<"der", "der">,
|
|
2817
|
-
): KeyPairSyncResult<
|
|
2837
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2818
2838
|
function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2819
2839
|
/**
|
|
2820
2840
|
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
@@ -2863,17 +2883,17 @@ declare module "crypto" {
|
|
|
2863
2883
|
function generateKeyPair(
|
|
2864
2884
|
type: "rsa",
|
|
2865
2885
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
2866
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
2886
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2867
2887
|
): void;
|
|
2868
2888
|
function generateKeyPair(
|
|
2869
2889
|
type: "rsa",
|
|
2870
2890
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
2871
|
-
callback: (err: Error | null, publicKey:
|
|
2891
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2872
2892
|
): void;
|
|
2873
2893
|
function generateKeyPair(
|
|
2874
2894
|
type: "rsa",
|
|
2875
2895
|
options: RSAKeyPairOptions<"der", "der">,
|
|
2876
|
-
callback: (err: Error | null, publicKey:
|
|
2896
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2877
2897
|
): void;
|
|
2878
2898
|
function generateKeyPair(
|
|
2879
2899
|
type: "rsa",
|
|
@@ -2888,17 +2908,17 @@ declare module "crypto" {
|
|
|
2888
2908
|
function generateKeyPair(
|
|
2889
2909
|
type: "rsa-pss",
|
|
2890
2910
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2891
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
2911
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2892
2912
|
): void;
|
|
2893
2913
|
function generateKeyPair(
|
|
2894
2914
|
type: "rsa-pss",
|
|
2895
2915
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2896
|
-
callback: (err: Error | null, publicKey:
|
|
2916
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2897
2917
|
): void;
|
|
2898
2918
|
function generateKeyPair(
|
|
2899
2919
|
type: "rsa-pss",
|
|
2900
2920
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2901
|
-
callback: (err: Error | null, publicKey:
|
|
2921
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2902
2922
|
): void;
|
|
2903
2923
|
function generateKeyPair(
|
|
2904
2924
|
type: "rsa-pss",
|
|
@@ -2913,17 +2933,17 @@ declare module "crypto" {
|
|
|
2913
2933
|
function generateKeyPair(
|
|
2914
2934
|
type: "dsa",
|
|
2915
2935
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
2916
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
2936
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2917
2937
|
): void;
|
|
2918
2938
|
function generateKeyPair(
|
|
2919
2939
|
type: "dsa",
|
|
2920
2940
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
2921
|
-
callback: (err: Error | null, publicKey:
|
|
2941
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2922
2942
|
): void;
|
|
2923
2943
|
function generateKeyPair(
|
|
2924
2944
|
type: "dsa",
|
|
2925
2945
|
options: DSAKeyPairOptions<"der", "der">,
|
|
2926
|
-
callback: (err: Error | null, publicKey:
|
|
2946
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2927
2947
|
): void;
|
|
2928
2948
|
function generateKeyPair(
|
|
2929
2949
|
type: "dsa",
|
|
@@ -2938,17 +2958,17 @@ declare module "crypto" {
|
|
|
2938
2958
|
function generateKeyPair(
|
|
2939
2959
|
type: "ec",
|
|
2940
2960
|
options: ECKeyPairOptions<"pem", "der">,
|
|
2941
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
2961
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2942
2962
|
): void;
|
|
2943
2963
|
function generateKeyPair(
|
|
2944
2964
|
type: "ec",
|
|
2945
2965
|
options: ECKeyPairOptions<"der", "pem">,
|
|
2946
|
-
callback: (err: Error | null, publicKey:
|
|
2966
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2947
2967
|
): void;
|
|
2948
2968
|
function generateKeyPair(
|
|
2949
2969
|
type: "ec",
|
|
2950
2970
|
options: ECKeyPairOptions<"der", "der">,
|
|
2951
|
-
callback: (err: Error | null, publicKey:
|
|
2971
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2952
2972
|
): void;
|
|
2953
2973
|
function generateKeyPair(
|
|
2954
2974
|
type: "ec",
|
|
@@ -2963,17 +2983,17 @@ declare module "crypto" {
|
|
|
2963
2983
|
function generateKeyPair(
|
|
2964
2984
|
type: "ed25519",
|
|
2965
2985
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
2966
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
2986
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2967
2987
|
): void;
|
|
2968
2988
|
function generateKeyPair(
|
|
2969
2989
|
type: "ed25519",
|
|
2970
2990
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
2971
|
-
callback: (err: Error | null, publicKey:
|
|
2991
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2972
2992
|
): void;
|
|
2973
2993
|
function generateKeyPair(
|
|
2974
2994
|
type: "ed25519",
|
|
2975
2995
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
2976
|
-
callback: (err: Error | null, publicKey:
|
|
2996
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2977
2997
|
): void;
|
|
2978
2998
|
function generateKeyPair(
|
|
2979
2999
|
type: "ed25519",
|
|
@@ -2988,17 +3008,17 @@ declare module "crypto" {
|
|
|
2988
3008
|
function generateKeyPair(
|
|
2989
3009
|
type: "ed448",
|
|
2990
3010
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
2991
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3011
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2992
3012
|
): void;
|
|
2993
3013
|
function generateKeyPair(
|
|
2994
3014
|
type: "ed448",
|
|
2995
3015
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
2996
|
-
callback: (err: Error | null, publicKey:
|
|
3016
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2997
3017
|
): void;
|
|
2998
3018
|
function generateKeyPair(
|
|
2999
3019
|
type: "ed448",
|
|
3000
3020
|
options: ED448KeyPairOptions<"der", "der">,
|
|
3001
|
-
callback: (err: Error | null, publicKey:
|
|
3021
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3002
3022
|
): void;
|
|
3003
3023
|
function generateKeyPair(
|
|
3004
3024
|
type: "ed448",
|
|
@@ -3013,17 +3033,17 @@ declare module "crypto" {
|
|
|
3013
3033
|
function generateKeyPair(
|
|
3014
3034
|
type: "x25519",
|
|
3015
3035
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
3016
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3036
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3017
3037
|
): void;
|
|
3018
3038
|
function generateKeyPair(
|
|
3019
3039
|
type: "x25519",
|
|
3020
3040
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
3021
|
-
callback: (err: Error | null, publicKey:
|
|
3041
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3022
3042
|
): void;
|
|
3023
3043
|
function generateKeyPair(
|
|
3024
3044
|
type: "x25519",
|
|
3025
3045
|
options: X25519KeyPairOptions<"der", "der">,
|
|
3026
|
-
callback: (err: Error | null, publicKey:
|
|
3046
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3027
3047
|
): void;
|
|
3028
3048
|
function generateKeyPair(
|
|
3029
3049
|
type: "x25519",
|
|
@@ -3038,17 +3058,17 @@ declare module "crypto" {
|
|
|
3038
3058
|
function generateKeyPair(
|
|
3039
3059
|
type: "x448",
|
|
3040
3060
|
options: X448KeyPairOptions<"pem", "der">,
|
|
3041
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3061
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3042
3062
|
): void;
|
|
3043
3063
|
function generateKeyPair(
|
|
3044
3064
|
type: "x448",
|
|
3045
3065
|
options: X448KeyPairOptions<"der", "pem">,
|
|
3046
|
-
callback: (err: Error | null, publicKey:
|
|
3066
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3047
3067
|
): void;
|
|
3048
3068
|
function generateKeyPair(
|
|
3049
3069
|
type: "x448",
|
|
3050
3070
|
options: X448KeyPairOptions<"der", "der">,
|
|
3051
|
-
callback: (err: Error | null, publicKey:
|
|
3071
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3052
3072
|
): void;
|
|
3053
3073
|
function generateKeyPair(
|
|
3054
3074
|
type: "x448",
|
|
@@ -3068,21 +3088,21 @@ declare module "crypto" {
|
|
|
3068
3088
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
3069
3089
|
): Promise<{
|
|
3070
3090
|
publicKey: string;
|
|
3071
|
-
privateKey:
|
|
3091
|
+
privateKey: NonSharedBuffer;
|
|
3072
3092
|
}>;
|
|
3073
3093
|
function __promisify__(
|
|
3074
3094
|
type: "rsa",
|
|
3075
3095
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
3076
3096
|
): Promise<{
|
|
3077
|
-
publicKey:
|
|
3097
|
+
publicKey: NonSharedBuffer;
|
|
3078
3098
|
privateKey: string;
|
|
3079
3099
|
}>;
|
|
3080
3100
|
function __promisify__(
|
|
3081
3101
|
type: "rsa",
|
|
3082
3102
|
options: RSAKeyPairOptions<"der", "der">,
|
|
3083
3103
|
): Promise<{
|
|
3084
|
-
publicKey:
|
|
3085
|
-
privateKey:
|
|
3104
|
+
publicKey: NonSharedBuffer;
|
|
3105
|
+
privateKey: NonSharedBuffer;
|
|
3086
3106
|
}>;
|
|
3087
3107
|
function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3088
3108
|
function __promisify__(
|
|
@@ -3097,21 +3117,21 @@ declare module "crypto" {
|
|
|
3097
3117
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
3098
3118
|
): Promise<{
|
|
3099
3119
|
publicKey: string;
|
|
3100
|
-
privateKey:
|
|
3120
|
+
privateKey: NonSharedBuffer;
|
|
3101
3121
|
}>;
|
|
3102
3122
|
function __promisify__(
|
|
3103
3123
|
type: "rsa-pss",
|
|
3104
3124
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
3105
3125
|
): Promise<{
|
|
3106
|
-
publicKey:
|
|
3126
|
+
publicKey: NonSharedBuffer;
|
|
3107
3127
|
privateKey: string;
|
|
3108
3128
|
}>;
|
|
3109
3129
|
function __promisify__(
|
|
3110
3130
|
type: "rsa-pss",
|
|
3111
3131
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
3112
3132
|
): Promise<{
|
|
3113
|
-
publicKey:
|
|
3114
|
-
privateKey:
|
|
3133
|
+
publicKey: NonSharedBuffer;
|
|
3134
|
+
privateKey: NonSharedBuffer;
|
|
3115
3135
|
}>;
|
|
3116
3136
|
function __promisify__(
|
|
3117
3137
|
type: "rsa-pss",
|
|
@@ -3129,21 +3149,21 @@ declare module "crypto" {
|
|
|
3129
3149
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
3130
3150
|
): Promise<{
|
|
3131
3151
|
publicKey: string;
|
|
3132
|
-
privateKey:
|
|
3152
|
+
privateKey: NonSharedBuffer;
|
|
3133
3153
|
}>;
|
|
3134
3154
|
function __promisify__(
|
|
3135
3155
|
type: "dsa",
|
|
3136
3156
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
3137
3157
|
): Promise<{
|
|
3138
|
-
publicKey:
|
|
3158
|
+
publicKey: NonSharedBuffer;
|
|
3139
3159
|
privateKey: string;
|
|
3140
3160
|
}>;
|
|
3141
3161
|
function __promisify__(
|
|
3142
3162
|
type: "dsa",
|
|
3143
3163
|
options: DSAKeyPairOptions<"der", "der">,
|
|
3144
3164
|
): Promise<{
|
|
3145
|
-
publicKey:
|
|
3146
|
-
privateKey:
|
|
3165
|
+
publicKey: NonSharedBuffer;
|
|
3166
|
+
privateKey: NonSharedBuffer;
|
|
3147
3167
|
}>;
|
|
3148
3168
|
function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3149
3169
|
function __promisify__(
|
|
@@ -3158,21 +3178,21 @@ declare module "crypto" {
|
|
|
3158
3178
|
options: ECKeyPairOptions<"pem", "der">,
|
|
3159
3179
|
): Promise<{
|
|
3160
3180
|
publicKey: string;
|
|
3161
|
-
privateKey:
|
|
3181
|
+
privateKey: NonSharedBuffer;
|
|
3162
3182
|
}>;
|
|
3163
3183
|
function __promisify__(
|
|
3164
3184
|
type: "ec",
|
|
3165
3185
|
options: ECKeyPairOptions<"der", "pem">,
|
|
3166
3186
|
): Promise<{
|
|
3167
|
-
publicKey:
|
|
3187
|
+
publicKey: NonSharedBuffer;
|
|
3168
3188
|
privateKey: string;
|
|
3169
3189
|
}>;
|
|
3170
3190
|
function __promisify__(
|
|
3171
3191
|
type: "ec",
|
|
3172
3192
|
options: ECKeyPairOptions<"der", "der">,
|
|
3173
3193
|
): Promise<{
|
|
3174
|
-
publicKey:
|
|
3175
|
-
privateKey:
|
|
3194
|
+
publicKey: NonSharedBuffer;
|
|
3195
|
+
privateKey: NonSharedBuffer;
|
|
3176
3196
|
}>;
|
|
3177
3197
|
function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3178
3198
|
function __promisify__(
|
|
@@ -3187,21 +3207,21 @@ declare module "crypto" {
|
|
|
3187
3207
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
3188
3208
|
): Promise<{
|
|
3189
3209
|
publicKey: string;
|
|
3190
|
-
privateKey:
|
|
3210
|
+
privateKey: NonSharedBuffer;
|
|
3191
3211
|
}>;
|
|
3192
3212
|
function __promisify__(
|
|
3193
3213
|
type: "ed25519",
|
|
3194
3214
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
3195
3215
|
): Promise<{
|
|
3196
|
-
publicKey:
|
|
3216
|
+
publicKey: NonSharedBuffer;
|
|
3197
3217
|
privateKey: string;
|
|
3198
3218
|
}>;
|
|
3199
3219
|
function __promisify__(
|
|
3200
3220
|
type: "ed25519",
|
|
3201
3221
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
3202
3222
|
): Promise<{
|
|
3203
|
-
publicKey:
|
|
3204
|
-
privateKey:
|
|
3223
|
+
publicKey: NonSharedBuffer;
|
|
3224
|
+
privateKey: NonSharedBuffer;
|
|
3205
3225
|
}>;
|
|
3206
3226
|
function __promisify__(
|
|
3207
3227
|
type: "ed25519",
|
|
@@ -3219,21 +3239,21 @@ declare module "crypto" {
|
|
|
3219
3239
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
3220
3240
|
): Promise<{
|
|
3221
3241
|
publicKey: string;
|
|
3222
|
-
privateKey:
|
|
3242
|
+
privateKey: NonSharedBuffer;
|
|
3223
3243
|
}>;
|
|
3224
3244
|
function __promisify__(
|
|
3225
3245
|
type: "ed448",
|
|
3226
3246
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
3227
3247
|
): Promise<{
|
|
3228
|
-
publicKey:
|
|
3248
|
+
publicKey: NonSharedBuffer;
|
|
3229
3249
|
privateKey: string;
|
|
3230
3250
|
}>;
|
|
3231
3251
|
function __promisify__(
|
|
3232
3252
|
type: "ed448",
|
|
3233
3253
|
options: ED448KeyPairOptions<"der", "der">,
|
|
3234
3254
|
): Promise<{
|
|
3235
|
-
publicKey:
|
|
3236
|
-
privateKey:
|
|
3255
|
+
publicKey: NonSharedBuffer;
|
|
3256
|
+
privateKey: NonSharedBuffer;
|
|
3237
3257
|
}>;
|
|
3238
3258
|
function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3239
3259
|
function __promisify__(
|
|
@@ -3248,21 +3268,21 @@ declare module "crypto" {
|
|
|
3248
3268
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
3249
3269
|
): Promise<{
|
|
3250
3270
|
publicKey: string;
|
|
3251
|
-
privateKey:
|
|
3271
|
+
privateKey: NonSharedBuffer;
|
|
3252
3272
|
}>;
|
|
3253
3273
|
function __promisify__(
|
|
3254
3274
|
type: "x25519",
|
|
3255
3275
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
3256
3276
|
): Promise<{
|
|
3257
|
-
publicKey:
|
|
3277
|
+
publicKey: NonSharedBuffer;
|
|
3258
3278
|
privateKey: string;
|
|
3259
3279
|
}>;
|
|
3260
3280
|
function __promisify__(
|
|
3261
3281
|
type: "x25519",
|
|
3262
3282
|
options: X25519KeyPairOptions<"der", "der">,
|
|
3263
3283
|
): Promise<{
|
|
3264
|
-
publicKey:
|
|
3265
|
-
privateKey:
|
|
3284
|
+
publicKey: NonSharedBuffer;
|
|
3285
|
+
privateKey: NonSharedBuffer;
|
|
3266
3286
|
}>;
|
|
3267
3287
|
function __promisify__(
|
|
3268
3288
|
type: "x25519",
|
|
@@ -3280,21 +3300,21 @@ declare module "crypto" {
|
|
|
3280
3300
|
options: X448KeyPairOptions<"pem", "der">,
|
|
3281
3301
|
): Promise<{
|
|
3282
3302
|
publicKey: string;
|
|
3283
|
-
privateKey:
|
|
3303
|
+
privateKey: NonSharedBuffer;
|
|
3284
3304
|
}>;
|
|
3285
3305
|
function __promisify__(
|
|
3286
3306
|
type: "x448",
|
|
3287
3307
|
options: X448KeyPairOptions<"der", "pem">,
|
|
3288
3308
|
): Promise<{
|
|
3289
|
-
publicKey:
|
|
3309
|
+
publicKey: NonSharedBuffer;
|
|
3290
3310
|
privateKey: string;
|
|
3291
3311
|
}>;
|
|
3292
3312
|
function __promisify__(
|
|
3293
3313
|
type: "x448",
|
|
3294
3314
|
options: X448KeyPairOptions<"der", "der">,
|
|
3295
3315
|
): Promise<{
|
|
3296
|
-
publicKey:
|
|
3297
|
-
privateKey:
|
|
3316
|
+
publicKey: NonSharedBuffer;
|
|
3317
|
+
privateKey: NonSharedBuffer;
|
|
3298
3318
|
}>;
|
|
3299
3319
|
function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3300
3320
|
}
|
|
@@ -3314,12 +3334,12 @@ declare module "crypto" {
|
|
|
3314
3334
|
algorithm: string | null | undefined,
|
|
3315
3335
|
data: NodeJS.ArrayBufferView,
|
|
3316
3336
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
3317
|
-
):
|
|
3337
|
+
): NonSharedBuffer;
|
|
3318
3338
|
function sign(
|
|
3319
3339
|
algorithm: string | null | undefined,
|
|
3320
3340
|
data: NodeJS.ArrayBufferView,
|
|
3321
3341
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
3322
|
-
callback: (error: Error | null, data:
|
|
3342
|
+
callback: (error: Error | null, data: NonSharedBuffer) => void,
|
|
3323
3343
|
): void;
|
|
3324
3344
|
/**
|
|
3325
3345
|
* 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
|
|
@@ -3355,7 +3375,7 @@ declare module "crypto" {
|
|
|
3355
3375
|
* Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES).
|
|
3356
3376
|
* @since v13.9.0, v12.17.0
|
|
3357
3377
|
*/
|
|
3358
|
-
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }):
|
|
3378
|
+
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
|
|
3359
3379
|
/**
|
|
3360
3380
|
* A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data
|
|
3361
3381
|
* (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm`
|
|
@@ -3385,12 +3405,12 @@ declare module "crypto" {
|
|
|
3385
3405
|
* @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v22.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest.
|
|
3386
3406
|
*/
|
|
3387
3407
|
function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string;
|
|
3388
|
-
function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"):
|
|
3408
|
+
function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): NonSharedBuffer;
|
|
3389
3409
|
function hash(
|
|
3390
3410
|
algorithm: string,
|
|
3391
3411
|
data: BinaryLike,
|
|
3392
3412
|
outputEncoding?: BinaryToTextEncoding | "buffer",
|
|
3393
|
-
): string |
|
|
3413
|
+
): string | NonSharedBuffer;
|
|
3394
3414
|
type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
|
|
3395
3415
|
interface CipherInfoOptions {
|
|
3396
3416
|
/**
|
|
@@ -3554,23 +3574,23 @@ declare module "crypto" {
|
|
|
3554
3574
|
/**
|
|
3555
3575
|
* @default 'always'
|
|
3556
3576
|
*/
|
|
3557
|
-
subject?: "always" | "default" | "never";
|
|
3577
|
+
subject?: "always" | "default" | "never" | undefined;
|
|
3558
3578
|
/**
|
|
3559
3579
|
* @default true
|
|
3560
3580
|
*/
|
|
3561
|
-
wildcards?: boolean;
|
|
3581
|
+
wildcards?: boolean | undefined;
|
|
3562
3582
|
/**
|
|
3563
3583
|
* @default true
|
|
3564
3584
|
*/
|
|
3565
|
-
partialWildcards?: boolean;
|
|
3585
|
+
partialWildcards?: boolean | undefined;
|
|
3566
3586
|
/**
|
|
3567
3587
|
* @default false
|
|
3568
3588
|
*/
|
|
3569
|
-
multiLabelWildcards?: boolean;
|
|
3589
|
+
multiLabelWildcards?: boolean | undefined;
|
|
3570
3590
|
/**
|
|
3571
3591
|
* @default false
|
|
3572
3592
|
*/
|
|
3573
|
-
singleLabelSubdomains?: boolean;
|
|
3593
|
+
singleLabelSubdomains?: boolean | undefined;
|
|
3574
3594
|
}
|
|
3575
3595
|
/**
|
|
3576
3596
|
* Encapsulates an X509 certificate and provides read-only access to
|
|
@@ -3672,7 +3692,7 @@ declare module "crypto" {
|
|
|
3672
3692
|
* available.
|
|
3673
3693
|
* @since v15.9.0
|
|
3674
3694
|
*/
|
|
3675
|
-
readonly issuerCertificate
|
|
3695
|
+
readonly issuerCertificate: X509Certificate | undefined;
|
|
3676
3696
|
/**
|
|
3677
3697
|
* The public key `KeyObject` for this certificate.
|
|
3678
3698
|
* @since v15.6.0
|
|
@@ -3682,7 +3702,7 @@ declare module "crypto" {
|
|
|
3682
3702
|
* A `Buffer` containing the DER encoding of this certificate.
|
|
3683
3703
|
* @since v15.6.0
|
|
3684
3704
|
*/
|
|
3685
|
-
readonly raw:
|
|
3705
|
+
readonly raw: NonSharedBuffer;
|
|
3686
3706
|
/**
|
|
3687
3707
|
* The serial number of this certificate.
|
|
3688
3708
|
*
|
|
@@ -3764,7 +3784,23 @@ declare module "crypto" {
|
|
|
3764
3784
|
*/
|
|
3765
3785
|
checkIP(ip: string): string | undefined;
|
|
3766
3786
|
/**
|
|
3767
|
-
* Checks whether this certificate was issued by the given `otherCert
|
|
3787
|
+
* Checks whether this certificate was potentially issued by the given `otherCert`
|
|
3788
|
+
* by comparing the certificate metadata.
|
|
3789
|
+
*
|
|
3790
|
+
* This is useful for pruning a list of possible issuer certificates which have been
|
|
3791
|
+
* selected using a more rudimentary filtering routine, i.e. just based on subject
|
|
3792
|
+
* and issuer names.
|
|
3793
|
+
*
|
|
3794
|
+
* Finally, to verify that this certificate's signature was produced by a private key
|
|
3795
|
+
* corresponding to `otherCert`'s public key use `x509.verify(publicKey)`
|
|
3796
|
+
* with `otherCert`'s public key represented as a `KeyObject`
|
|
3797
|
+
* like so
|
|
3798
|
+
*
|
|
3799
|
+
* ```js
|
|
3800
|
+
* if (!x509.verify(otherCert.publicKey)) {
|
|
3801
|
+
* throw new Error('otherCert did not issue x509');
|
|
3802
|
+
* }
|
|
3803
|
+
* ```
|
|
3768
3804
|
* @since v15.6.0
|
|
3769
3805
|
*/
|
|
3770
3806
|
checkIssued(otherCert: X509Certificate): boolean;
|