@types/node 20.19.22 → 20.19.23
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 v20.19/README.md +1 -1
- node v20.19/buffer.buffer.d.ts +9 -0
- node v20.19/buffer.d.ts +8 -4
- node v20.19/child_process.d.ts +50 -33
- node v20.19/crypto.d.ts +151 -131
- node v20.19/dgram.d.ts +9 -8
- node v20.19/fs/promises.d.ts +41 -19
- node v20.19/fs.d.ts +89 -76
- node v20.19/globals.typedarray.d.ts +17 -0
- node v20.19/http.d.ts +41 -22
- node v20.19/http2.d.ts +29 -22
- node v20.19/https.d.ts +82 -50
- node v20.19/net.d.ts +7 -6
- node v20.19/os.d.ts +3 -2
- node v20.19/package.json +2 -2
- node v20.19/process.d.ts +2 -1
- node v20.19/stream/consumers.d.ts +2 -2
- node v20.19/string_decoder.d.ts +2 -2
- node v20.19/tls.d.ts +88 -64
- node v20.19/ts5.6/buffer.buffer.d.ts +10 -2
- node v20.19/ts5.6/globals.typedarray.d.ts +15 -0
- node v20.19/url.d.ts +1 -1
- node v20.19/util.d.ts +1 -1
- node v20.19/v8.d.ts +4 -3
- node v20.19/vm.d.ts +4 -3
- node v20.19/zlib.d.ts +21 -20
node v20.19/crypto.d.ts
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/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";
|
|
@@ -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
|
|
@@ -933,8 +934,8 @@ declare module "crypto" {
|
|
|
933
934
|
* @param inputEncoding The `encoding` of the data.
|
|
934
935
|
* @param outputEncoding The `encoding` of the return value.
|
|
935
936
|
*/
|
|
936
|
-
update(data: BinaryLike):
|
|
937
|
-
update(data: string, inputEncoding: Encoding):
|
|
937
|
+
update(data: BinaryLike): NonSharedBuffer;
|
|
938
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
938
939
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
939
940
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
940
941
|
/**
|
|
@@ -945,7 +946,7 @@ declare module "crypto" {
|
|
|
945
946
|
* @param outputEncoding The `encoding` of the return value.
|
|
946
947
|
* @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
947
948
|
*/
|
|
948
|
-
final():
|
|
949
|
+
final(): NonSharedBuffer;
|
|
949
950
|
final(outputEncoding: BufferEncoding): string;
|
|
950
951
|
/**
|
|
951
952
|
* When using block encryption algorithms, the `Cipher` class will automatically
|
|
@@ -971,7 +972,7 @@ declare module "crypto" {
|
|
|
971
972
|
plaintextLength: number;
|
|
972
973
|
},
|
|
973
974
|
): this;
|
|
974
|
-
getAuthTag():
|
|
975
|
+
getAuthTag(): NonSharedBuffer;
|
|
975
976
|
}
|
|
976
977
|
interface CipherGCM extends Cipher {
|
|
977
978
|
setAAD(
|
|
@@ -980,7 +981,7 @@ declare module "crypto" {
|
|
|
980
981
|
plaintextLength: number;
|
|
981
982
|
},
|
|
982
983
|
): this;
|
|
983
|
-
getAuthTag():
|
|
984
|
+
getAuthTag(): NonSharedBuffer;
|
|
984
985
|
}
|
|
985
986
|
interface CipherOCB extends Cipher {
|
|
986
987
|
setAAD(
|
|
@@ -989,7 +990,7 @@ declare module "crypto" {
|
|
|
989
990
|
plaintextLength: number;
|
|
990
991
|
},
|
|
991
992
|
): this;
|
|
992
|
-
getAuthTag():
|
|
993
|
+
getAuthTag(): NonSharedBuffer;
|
|
993
994
|
}
|
|
994
995
|
interface CipherChaCha20Poly1305 extends Cipher {
|
|
995
996
|
setAAD(
|
|
@@ -998,7 +999,7 @@ declare module "crypto" {
|
|
|
998
999
|
plaintextLength: number;
|
|
999
1000
|
},
|
|
1000
1001
|
): this;
|
|
1001
|
-
getAuthTag():
|
|
1002
|
+
getAuthTag(): NonSharedBuffer;
|
|
1002
1003
|
}
|
|
1003
1004
|
/**
|
|
1004
1005
|
* Creates and returns a `Decipher` object that uses the given `algorithm` and `password` (key).
|
|
@@ -1222,8 +1223,8 @@ declare module "crypto" {
|
|
|
1222
1223
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1223
1224
|
* @param outputEncoding The `encoding` of the return value.
|
|
1224
1225
|
*/
|
|
1225
|
-
update(data: NodeJS.ArrayBufferView):
|
|
1226
|
-
update(data: string, inputEncoding: Encoding):
|
|
1226
|
+
update(data: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
1227
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
1227
1228
|
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
1228
1229
|
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
1229
1230
|
/**
|
|
@@ -1234,7 +1235,7 @@ declare module "crypto" {
|
|
|
1234
1235
|
* @param outputEncoding The `encoding` of the return value.
|
|
1235
1236
|
* @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
1236
1237
|
*/
|
|
1237
|
-
final():
|
|
1238
|
+
final(): NonSharedBuffer;
|
|
1238
1239
|
final(outputEncoding: BufferEncoding): string;
|
|
1239
1240
|
/**
|
|
1240
1241
|
* 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
|
|
@@ -1506,7 +1507,7 @@ declare module "crypto" {
|
|
|
1506
1507
|
* called. Multiple calls to `sign.sign()` will result in an error being thrown.
|
|
1507
1508
|
* @since v0.1.92
|
|
1508
1509
|
*/
|
|
1509
|
-
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput):
|
|
1510
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
1510
1511
|
sign(
|
|
1511
1512
|
privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
1512
1513
|
outputFormat: BinaryToTextEncoding,
|
|
@@ -1665,7 +1666,7 @@ declare module "crypto" {
|
|
|
1665
1666
|
* @since v0.5.0
|
|
1666
1667
|
* @param encoding The `encoding` of the return value.
|
|
1667
1668
|
*/
|
|
1668
|
-
generateKeys():
|
|
1669
|
+
generateKeys(): NonSharedBuffer;
|
|
1669
1670
|
generateKeys(encoding: BinaryToTextEncoding): string;
|
|
1670
1671
|
/**
|
|
1671
1672
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
@@ -1680,8 +1681,16 @@ declare module "crypto" {
|
|
|
1680
1681
|
* @param inputEncoding The `encoding` of an `otherPublicKey` string.
|
|
1681
1682
|
* @param outputEncoding The `encoding` of the return value.
|
|
1682
1683
|
*/
|
|
1683
|
-
computeSecret(
|
|
1684
|
-
|
|
1684
|
+
computeSecret(
|
|
1685
|
+
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1686
|
+
inputEncoding?: null,
|
|
1687
|
+
outputEncoding?: null,
|
|
1688
|
+
): NonSharedBuffer;
|
|
1689
|
+
computeSecret(
|
|
1690
|
+
otherPublicKey: string,
|
|
1691
|
+
inputEncoding: BinaryToTextEncoding,
|
|
1692
|
+
outputEncoding?: null,
|
|
1693
|
+
): NonSharedBuffer;
|
|
1685
1694
|
computeSecret(
|
|
1686
1695
|
otherPublicKey: NodeJS.ArrayBufferView,
|
|
1687
1696
|
inputEncoding: null,
|
|
@@ -1699,7 +1708,7 @@ declare module "crypto" {
|
|
|
1699
1708
|
* @since v0.5.0
|
|
1700
1709
|
* @param encoding The `encoding` of the return value.
|
|
1701
1710
|
*/
|
|
1702
|
-
getPrime():
|
|
1711
|
+
getPrime(): NonSharedBuffer;
|
|
1703
1712
|
getPrime(encoding: BinaryToTextEncoding): string;
|
|
1704
1713
|
/**
|
|
1705
1714
|
* Returns the Diffie-Hellman generator in the specified `encoding`.
|
|
@@ -1708,7 +1717,7 @@ declare module "crypto" {
|
|
|
1708
1717
|
* @since v0.5.0
|
|
1709
1718
|
* @param encoding The `encoding` of the return value.
|
|
1710
1719
|
*/
|
|
1711
|
-
getGenerator():
|
|
1720
|
+
getGenerator(): NonSharedBuffer;
|
|
1712
1721
|
getGenerator(encoding: BinaryToTextEncoding): string;
|
|
1713
1722
|
/**
|
|
1714
1723
|
* Returns the Diffie-Hellman public key in the specified `encoding`.
|
|
@@ -1717,7 +1726,7 @@ declare module "crypto" {
|
|
|
1717
1726
|
* @since v0.5.0
|
|
1718
1727
|
* @param encoding The `encoding` of the return value.
|
|
1719
1728
|
*/
|
|
1720
|
-
getPublicKey():
|
|
1729
|
+
getPublicKey(): NonSharedBuffer;
|
|
1721
1730
|
getPublicKey(encoding: BinaryToTextEncoding): string;
|
|
1722
1731
|
/**
|
|
1723
1732
|
* Returns the Diffie-Hellman private key in the specified `encoding`.
|
|
@@ -1726,7 +1735,7 @@ declare module "crypto" {
|
|
|
1726
1735
|
* @since v0.5.0
|
|
1727
1736
|
* @param encoding The `encoding` of the return value.
|
|
1728
1737
|
*/
|
|
1729
|
-
getPrivateKey():
|
|
1738
|
+
getPrivateKey(): NonSharedBuffer;
|
|
1730
1739
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
1731
1740
|
/**
|
|
1732
1741
|
* Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected
|
|
@@ -1870,7 +1879,7 @@ declare module "crypto" {
|
|
|
1870
1879
|
iterations: number,
|
|
1871
1880
|
keylen: number,
|
|
1872
1881
|
digest: string,
|
|
1873
|
-
callback: (err: Error | null, derivedKey:
|
|
1882
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
1874
1883
|
): void;
|
|
1875
1884
|
/**
|
|
1876
1885
|
* Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
|
@@ -1907,7 +1916,7 @@ declare module "crypto" {
|
|
|
1907
1916
|
iterations: number,
|
|
1908
1917
|
keylen: number,
|
|
1909
1918
|
digest: string,
|
|
1910
|
-
):
|
|
1919
|
+
): NonSharedBuffer;
|
|
1911
1920
|
/**
|
|
1912
1921
|
* Generates cryptographically strong pseudorandom data. The `size` argument
|
|
1913
1922
|
* is a number indicating the number of bytes to generate.
|
|
@@ -1960,10 +1969,10 @@ declare module "crypto" {
|
|
|
1960
1969
|
* @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
|
|
1961
1970
|
* @return if the `callback` function is not provided.
|
|
1962
1971
|
*/
|
|
1963
|
-
function randomBytes(size: number):
|
|
1964
|
-
function randomBytes(size: number, callback: (err: Error | null, buf:
|
|
1965
|
-
function pseudoRandomBytes(size: number):
|
|
1966
|
-
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf:
|
|
1972
|
+
function randomBytes(size: number): NonSharedBuffer;
|
|
1973
|
+
function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
1974
|
+
function pseudoRandomBytes(size: number): NonSharedBuffer;
|
|
1975
|
+
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
1967
1976
|
/**
|
|
1968
1977
|
* Return a random integer `n` such that `min <= n < max`. This
|
|
1969
1978
|
* implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
|
|
@@ -2193,14 +2202,14 @@ declare module "crypto" {
|
|
|
2193
2202
|
password: BinaryLike,
|
|
2194
2203
|
salt: BinaryLike,
|
|
2195
2204
|
keylen: number,
|
|
2196
|
-
callback: (err: Error | null, derivedKey:
|
|
2205
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
2197
2206
|
): void;
|
|
2198
2207
|
function scrypt(
|
|
2199
2208
|
password: BinaryLike,
|
|
2200
2209
|
salt: BinaryLike,
|
|
2201
2210
|
keylen: number,
|
|
2202
2211
|
options: ScryptOptions,
|
|
2203
|
-
callback: (err: Error | null, derivedKey:
|
|
2212
|
+
callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
|
|
2204
2213
|
): void;
|
|
2205
2214
|
/**
|
|
2206
2215
|
* Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
|
|
@@ -2232,7 +2241,12 @@ declare module "crypto" {
|
|
|
2232
2241
|
* ```
|
|
2233
2242
|
* @since v10.5.0
|
|
2234
2243
|
*/
|
|
2235
|
-
function scryptSync(
|
|
2244
|
+
function scryptSync(
|
|
2245
|
+
password: BinaryLike,
|
|
2246
|
+
salt: BinaryLike,
|
|
2247
|
+
keylen: number,
|
|
2248
|
+
options?: ScryptOptions,
|
|
2249
|
+
): NonSharedBuffer;
|
|
2236
2250
|
interface RsaPublicKey {
|
|
2237
2251
|
key: KeyLike;
|
|
2238
2252
|
padding?: number | undefined;
|
|
@@ -2258,7 +2272,10 @@ declare module "crypto" {
|
|
|
2258
2272
|
* be passed instead of a public key.
|
|
2259
2273
|
* @since v0.11.14
|
|
2260
2274
|
*/
|
|
2261
|
-
function publicEncrypt(
|
|
2275
|
+
function publicEncrypt(
|
|
2276
|
+
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2277
|
+
buffer: NodeJS.ArrayBufferView,
|
|
2278
|
+
): NonSharedBuffer;
|
|
2262
2279
|
/**
|
|
2263
2280
|
* Decrypts `buffer` with `key`.`buffer` was previously encrypted using
|
|
2264
2281
|
* the corresponding private key, for example using {@link privateEncrypt}.
|
|
@@ -2270,7 +2287,10 @@ declare module "crypto" {
|
|
|
2270
2287
|
* be passed instead of a public key.
|
|
2271
2288
|
* @since v1.1.0
|
|
2272
2289
|
*/
|
|
2273
|
-
function publicDecrypt(
|
|
2290
|
+
function publicDecrypt(
|
|
2291
|
+
key: RsaPublicKey | RsaPrivateKey | KeyLike,
|
|
2292
|
+
buffer: NodeJS.ArrayBufferView,
|
|
2293
|
+
): NonSharedBuffer;
|
|
2274
2294
|
/**
|
|
2275
2295
|
* Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
|
|
2276
2296
|
* the corresponding public key, for example using {@link publicEncrypt}.
|
|
@@ -2279,7 +2299,7 @@ declare module "crypto" {
|
|
|
2279
2299
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
|
|
2280
2300
|
* @since v0.11.14
|
|
2281
2301
|
*/
|
|
2282
|
-
function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView):
|
|
2302
|
+
function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
2283
2303
|
/**
|
|
2284
2304
|
* Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
|
|
2285
2305
|
* the corresponding public key, for example using {@link publicDecrypt}.
|
|
@@ -2288,7 +2308,7 @@ declare module "crypto" {
|
|
|
2288
2308
|
* object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
|
|
2289
2309
|
* @since v1.1.0
|
|
2290
2310
|
*/
|
|
2291
|
-
function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView):
|
|
2311
|
+
function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
2292
2312
|
/**
|
|
2293
2313
|
* ```js
|
|
2294
2314
|
* const {
|
|
@@ -2417,7 +2437,7 @@ declare module "crypto" {
|
|
|
2417
2437
|
inputEncoding?: BinaryToTextEncoding,
|
|
2418
2438
|
outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
|
|
2419
2439
|
format?: "uncompressed" | "compressed" | "hybrid",
|
|
2420
|
-
):
|
|
2440
|
+
): NonSharedBuffer | string;
|
|
2421
2441
|
/**
|
|
2422
2442
|
* Generates private and public EC Diffie-Hellman key values, and returns
|
|
2423
2443
|
* the public key in the specified `format` and `encoding`. This key should be
|
|
@@ -2430,7 +2450,7 @@ declare module "crypto" {
|
|
|
2430
2450
|
* @param encoding The `encoding` of the return value.
|
|
2431
2451
|
* @param [format='uncompressed']
|
|
2432
2452
|
*/
|
|
2433
|
-
generateKeys():
|
|
2453
|
+
generateKeys(): NonSharedBuffer;
|
|
2434
2454
|
generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2435
2455
|
/**
|
|
2436
2456
|
* Computes the shared secret using `otherPublicKey` as the other
|
|
@@ -2449,8 +2469,8 @@ declare module "crypto" {
|
|
|
2449
2469
|
* @param inputEncoding The `encoding` of the `otherPublicKey` string.
|
|
2450
2470
|
* @param outputEncoding The `encoding` of the return value.
|
|
2451
2471
|
*/
|
|
2452
|
-
computeSecret(otherPublicKey: NodeJS.ArrayBufferView):
|
|
2453
|
-
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding):
|
|
2472
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
2473
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer;
|
|
2454
2474
|
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
2455
2475
|
computeSecret(
|
|
2456
2476
|
otherPublicKey: string,
|
|
@@ -2464,7 +2484,7 @@ declare module "crypto" {
|
|
|
2464
2484
|
* @param encoding The `encoding` of the return value.
|
|
2465
2485
|
* @return The EC Diffie-Hellman in the specified `encoding`.
|
|
2466
2486
|
*/
|
|
2467
|
-
getPrivateKey():
|
|
2487
|
+
getPrivateKey(): NonSharedBuffer;
|
|
2468
2488
|
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
2469
2489
|
/**
|
|
2470
2490
|
* 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.
|
|
@@ -2476,7 +2496,7 @@ declare module "crypto" {
|
|
|
2476
2496
|
* @param [format='uncompressed']
|
|
2477
2497
|
* @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
|
|
2478
2498
|
*/
|
|
2479
|
-
getPublicKey(encoding?: null, format?: ECDHKeyFormat):
|
|
2499
|
+
getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
|
|
2480
2500
|
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
2481
2501
|
/**
|
|
2482
2502
|
* Sets the EC Diffie-Hellman private key.
|
|
@@ -2757,15 +2777,15 @@ declare module "crypto" {
|
|
|
2757
2777
|
function generateKeyPairSync(
|
|
2758
2778
|
type: "rsa",
|
|
2759
2779
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
2760
|
-
): KeyPairSyncResult<string,
|
|
2780
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2761
2781
|
function generateKeyPairSync(
|
|
2762
2782
|
type: "rsa",
|
|
2763
2783
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
2764
|
-
): KeyPairSyncResult<
|
|
2784
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2765
2785
|
function generateKeyPairSync(
|
|
2766
2786
|
type: "rsa",
|
|
2767
2787
|
options: RSAKeyPairOptions<"der", "der">,
|
|
2768
|
-
): KeyPairSyncResult<
|
|
2788
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2769
2789
|
function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2770
2790
|
function generateKeyPairSync(
|
|
2771
2791
|
type: "rsa-pss",
|
|
@@ -2774,15 +2794,15 @@ declare module "crypto" {
|
|
|
2774
2794
|
function generateKeyPairSync(
|
|
2775
2795
|
type: "rsa-pss",
|
|
2776
2796
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2777
|
-
): KeyPairSyncResult<string,
|
|
2797
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2778
2798
|
function generateKeyPairSync(
|
|
2779
2799
|
type: "rsa-pss",
|
|
2780
2800
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2781
|
-
): KeyPairSyncResult<
|
|
2801
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2782
2802
|
function generateKeyPairSync(
|
|
2783
2803
|
type: "rsa-pss",
|
|
2784
2804
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2785
|
-
): KeyPairSyncResult<
|
|
2805
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2786
2806
|
function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2787
2807
|
function generateKeyPairSync(
|
|
2788
2808
|
type: "dsa",
|
|
@@ -2791,15 +2811,15 @@ declare module "crypto" {
|
|
|
2791
2811
|
function generateKeyPairSync(
|
|
2792
2812
|
type: "dsa",
|
|
2793
2813
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
2794
|
-
): KeyPairSyncResult<string,
|
|
2814
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2795
2815
|
function generateKeyPairSync(
|
|
2796
2816
|
type: "dsa",
|
|
2797
2817
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
2798
|
-
): KeyPairSyncResult<
|
|
2818
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2799
2819
|
function generateKeyPairSync(
|
|
2800
2820
|
type: "dsa",
|
|
2801
2821
|
options: DSAKeyPairOptions<"der", "der">,
|
|
2802
|
-
): KeyPairSyncResult<
|
|
2822
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2803
2823
|
function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2804
2824
|
function generateKeyPairSync(
|
|
2805
2825
|
type: "ec",
|
|
@@ -2808,15 +2828,15 @@ declare module "crypto" {
|
|
|
2808
2828
|
function generateKeyPairSync(
|
|
2809
2829
|
type: "ec",
|
|
2810
2830
|
options: ECKeyPairOptions<"pem", "der">,
|
|
2811
|
-
): KeyPairSyncResult<string,
|
|
2831
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2812
2832
|
function generateKeyPairSync(
|
|
2813
2833
|
type: "ec",
|
|
2814
2834
|
options: ECKeyPairOptions<"der", "pem">,
|
|
2815
|
-
): KeyPairSyncResult<
|
|
2835
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2816
2836
|
function generateKeyPairSync(
|
|
2817
2837
|
type: "ec",
|
|
2818
2838
|
options: ECKeyPairOptions<"der", "der">,
|
|
2819
|
-
): KeyPairSyncResult<
|
|
2839
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2820
2840
|
function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2821
2841
|
function generateKeyPairSync(
|
|
2822
2842
|
type: "ed25519",
|
|
@@ -2825,15 +2845,15 @@ declare module "crypto" {
|
|
|
2825
2845
|
function generateKeyPairSync(
|
|
2826
2846
|
type: "ed25519",
|
|
2827
2847
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
2828
|
-
): KeyPairSyncResult<string,
|
|
2848
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2829
2849
|
function generateKeyPairSync(
|
|
2830
2850
|
type: "ed25519",
|
|
2831
2851
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
2832
|
-
): KeyPairSyncResult<
|
|
2852
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2833
2853
|
function generateKeyPairSync(
|
|
2834
2854
|
type: "ed25519",
|
|
2835
2855
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
2836
|
-
): KeyPairSyncResult<
|
|
2856
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2837
2857
|
function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2838
2858
|
function generateKeyPairSync(
|
|
2839
2859
|
type: "ed448",
|
|
@@ -2842,15 +2862,15 @@ declare module "crypto" {
|
|
|
2842
2862
|
function generateKeyPairSync(
|
|
2843
2863
|
type: "ed448",
|
|
2844
2864
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
2845
|
-
): KeyPairSyncResult<string,
|
|
2865
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2846
2866
|
function generateKeyPairSync(
|
|
2847
2867
|
type: "ed448",
|
|
2848
2868
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
2849
|
-
): KeyPairSyncResult<
|
|
2869
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2850
2870
|
function generateKeyPairSync(
|
|
2851
2871
|
type: "ed448",
|
|
2852
2872
|
options: ED448KeyPairOptions<"der", "der">,
|
|
2853
|
-
): KeyPairSyncResult<
|
|
2873
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2854
2874
|
function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2855
2875
|
function generateKeyPairSync(
|
|
2856
2876
|
type: "x25519",
|
|
@@ -2859,15 +2879,15 @@ declare module "crypto" {
|
|
|
2859
2879
|
function generateKeyPairSync(
|
|
2860
2880
|
type: "x25519",
|
|
2861
2881
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
2862
|
-
): KeyPairSyncResult<string,
|
|
2882
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2863
2883
|
function generateKeyPairSync(
|
|
2864
2884
|
type: "x25519",
|
|
2865
2885
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
2866
|
-
): KeyPairSyncResult<
|
|
2886
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2867
2887
|
function generateKeyPairSync(
|
|
2868
2888
|
type: "x25519",
|
|
2869
2889
|
options: X25519KeyPairOptions<"der", "der">,
|
|
2870
|
-
): KeyPairSyncResult<
|
|
2890
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2871
2891
|
function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2872
2892
|
function generateKeyPairSync(
|
|
2873
2893
|
type: "x448",
|
|
@@ -2876,15 +2896,15 @@ declare module "crypto" {
|
|
|
2876
2896
|
function generateKeyPairSync(
|
|
2877
2897
|
type: "x448",
|
|
2878
2898
|
options: X448KeyPairOptions<"pem", "der">,
|
|
2879
|
-
): KeyPairSyncResult<string,
|
|
2899
|
+
): KeyPairSyncResult<string, NonSharedBuffer>;
|
|
2880
2900
|
function generateKeyPairSync(
|
|
2881
2901
|
type: "x448",
|
|
2882
2902
|
options: X448KeyPairOptions<"der", "pem">,
|
|
2883
|
-
): KeyPairSyncResult<
|
|
2903
|
+
): KeyPairSyncResult<NonSharedBuffer, string>;
|
|
2884
2904
|
function generateKeyPairSync(
|
|
2885
2905
|
type: "x448",
|
|
2886
2906
|
options: X448KeyPairOptions<"der", "der">,
|
|
2887
|
-
): KeyPairSyncResult<
|
|
2907
|
+
): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
|
|
2888
2908
|
function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
2889
2909
|
/**
|
|
2890
2910
|
* Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
|
|
@@ -2933,17 +2953,17 @@ declare module "crypto" {
|
|
|
2933
2953
|
function generateKeyPair(
|
|
2934
2954
|
type: "rsa",
|
|
2935
2955
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
2936
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
2956
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2937
2957
|
): void;
|
|
2938
2958
|
function generateKeyPair(
|
|
2939
2959
|
type: "rsa",
|
|
2940
2960
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
2941
|
-
callback: (err: Error | null, publicKey:
|
|
2961
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2942
2962
|
): void;
|
|
2943
2963
|
function generateKeyPair(
|
|
2944
2964
|
type: "rsa",
|
|
2945
2965
|
options: RSAKeyPairOptions<"der", "der">,
|
|
2946
|
-
callback: (err: Error | null, publicKey:
|
|
2966
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2947
2967
|
): void;
|
|
2948
2968
|
function generateKeyPair(
|
|
2949
2969
|
type: "rsa",
|
|
@@ -2958,17 +2978,17 @@ declare module "crypto" {
|
|
|
2958
2978
|
function generateKeyPair(
|
|
2959
2979
|
type: "rsa-pss",
|
|
2960
2980
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
2961
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
2981
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2962
2982
|
): void;
|
|
2963
2983
|
function generateKeyPair(
|
|
2964
2984
|
type: "rsa-pss",
|
|
2965
2985
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
2966
|
-
callback: (err: Error | null, publicKey:
|
|
2986
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2967
2987
|
): void;
|
|
2968
2988
|
function generateKeyPair(
|
|
2969
2989
|
type: "rsa-pss",
|
|
2970
2990
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
2971
|
-
callback: (err: Error | null, publicKey:
|
|
2991
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2972
2992
|
): void;
|
|
2973
2993
|
function generateKeyPair(
|
|
2974
2994
|
type: "rsa-pss",
|
|
@@ -2983,17 +3003,17 @@ declare module "crypto" {
|
|
|
2983
3003
|
function generateKeyPair(
|
|
2984
3004
|
type: "dsa",
|
|
2985
3005
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
2986
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3006
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
2987
3007
|
): void;
|
|
2988
3008
|
function generateKeyPair(
|
|
2989
3009
|
type: "dsa",
|
|
2990
3010
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
2991
|
-
callback: (err: Error | null, publicKey:
|
|
3011
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
2992
3012
|
): void;
|
|
2993
3013
|
function generateKeyPair(
|
|
2994
3014
|
type: "dsa",
|
|
2995
3015
|
options: DSAKeyPairOptions<"der", "der">,
|
|
2996
|
-
callback: (err: Error | null, publicKey:
|
|
3016
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
2997
3017
|
): void;
|
|
2998
3018
|
function generateKeyPair(
|
|
2999
3019
|
type: "dsa",
|
|
@@ -3008,17 +3028,17 @@ declare module "crypto" {
|
|
|
3008
3028
|
function generateKeyPair(
|
|
3009
3029
|
type: "ec",
|
|
3010
3030
|
options: ECKeyPairOptions<"pem", "der">,
|
|
3011
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3031
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3012
3032
|
): void;
|
|
3013
3033
|
function generateKeyPair(
|
|
3014
3034
|
type: "ec",
|
|
3015
3035
|
options: ECKeyPairOptions<"der", "pem">,
|
|
3016
|
-
callback: (err: Error | null, publicKey:
|
|
3036
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3017
3037
|
): void;
|
|
3018
3038
|
function generateKeyPair(
|
|
3019
3039
|
type: "ec",
|
|
3020
3040
|
options: ECKeyPairOptions<"der", "der">,
|
|
3021
|
-
callback: (err: Error | null, publicKey:
|
|
3041
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3022
3042
|
): void;
|
|
3023
3043
|
function generateKeyPair(
|
|
3024
3044
|
type: "ec",
|
|
@@ -3033,17 +3053,17 @@ declare module "crypto" {
|
|
|
3033
3053
|
function generateKeyPair(
|
|
3034
3054
|
type: "ed25519",
|
|
3035
3055
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
3036
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3056
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3037
3057
|
): void;
|
|
3038
3058
|
function generateKeyPair(
|
|
3039
3059
|
type: "ed25519",
|
|
3040
3060
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
3041
|
-
callback: (err: Error | null, publicKey:
|
|
3061
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3042
3062
|
): void;
|
|
3043
3063
|
function generateKeyPair(
|
|
3044
3064
|
type: "ed25519",
|
|
3045
3065
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
3046
|
-
callback: (err: Error | null, publicKey:
|
|
3066
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3047
3067
|
): void;
|
|
3048
3068
|
function generateKeyPair(
|
|
3049
3069
|
type: "ed25519",
|
|
@@ -3058,17 +3078,17 @@ declare module "crypto" {
|
|
|
3058
3078
|
function generateKeyPair(
|
|
3059
3079
|
type: "ed448",
|
|
3060
3080
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
3061
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3081
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3062
3082
|
): void;
|
|
3063
3083
|
function generateKeyPair(
|
|
3064
3084
|
type: "ed448",
|
|
3065
3085
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
3066
|
-
callback: (err: Error | null, publicKey:
|
|
3086
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3067
3087
|
): void;
|
|
3068
3088
|
function generateKeyPair(
|
|
3069
3089
|
type: "ed448",
|
|
3070
3090
|
options: ED448KeyPairOptions<"der", "der">,
|
|
3071
|
-
callback: (err: Error | null, publicKey:
|
|
3091
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3072
3092
|
): void;
|
|
3073
3093
|
function generateKeyPair(
|
|
3074
3094
|
type: "ed448",
|
|
@@ -3083,17 +3103,17 @@ declare module "crypto" {
|
|
|
3083
3103
|
function generateKeyPair(
|
|
3084
3104
|
type: "x25519",
|
|
3085
3105
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
3086
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3106
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3087
3107
|
): void;
|
|
3088
3108
|
function generateKeyPair(
|
|
3089
3109
|
type: "x25519",
|
|
3090
3110
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
3091
|
-
callback: (err: Error | null, publicKey:
|
|
3111
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3092
3112
|
): void;
|
|
3093
3113
|
function generateKeyPair(
|
|
3094
3114
|
type: "x25519",
|
|
3095
3115
|
options: X25519KeyPairOptions<"der", "der">,
|
|
3096
|
-
callback: (err: Error | null, publicKey:
|
|
3116
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3097
3117
|
): void;
|
|
3098
3118
|
function generateKeyPair(
|
|
3099
3119
|
type: "x25519",
|
|
@@ -3108,17 +3128,17 @@ declare module "crypto" {
|
|
|
3108
3128
|
function generateKeyPair(
|
|
3109
3129
|
type: "x448",
|
|
3110
3130
|
options: X448KeyPairOptions<"pem", "der">,
|
|
3111
|
-
callback: (err: Error | null, publicKey: string, privateKey:
|
|
3131
|
+
callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
|
|
3112
3132
|
): void;
|
|
3113
3133
|
function generateKeyPair(
|
|
3114
3134
|
type: "x448",
|
|
3115
3135
|
options: X448KeyPairOptions<"der", "pem">,
|
|
3116
|
-
callback: (err: Error | null, publicKey:
|
|
3136
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
|
|
3117
3137
|
): void;
|
|
3118
3138
|
function generateKeyPair(
|
|
3119
3139
|
type: "x448",
|
|
3120
3140
|
options: X448KeyPairOptions<"der", "der">,
|
|
3121
|
-
callback: (err: Error | null, publicKey:
|
|
3141
|
+
callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
|
|
3122
3142
|
): void;
|
|
3123
3143
|
function generateKeyPair(
|
|
3124
3144
|
type: "x448",
|
|
@@ -3138,21 +3158,21 @@ declare module "crypto" {
|
|
|
3138
3158
|
options: RSAKeyPairOptions<"pem", "der">,
|
|
3139
3159
|
): Promise<{
|
|
3140
3160
|
publicKey: string;
|
|
3141
|
-
privateKey:
|
|
3161
|
+
privateKey: NonSharedBuffer;
|
|
3142
3162
|
}>;
|
|
3143
3163
|
function __promisify__(
|
|
3144
3164
|
type: "rsa",
|
|
3145
3165
|
options: RSAKeyPairOptions<"der", "pem">,
|
|
3146
3166
|
): Promise<{
|
|
3147
|
-
publicKey:
|
|
3167
|
+
publicKey: NonSharedBuffer;
|
|
3148
3168
|
privateKey: string;
|
|
3149
3169
|
}>;
|
|
3150
3170
|
function __promisify__(
|
|
3151
3171
|
type: "rsa",
|
|
3152
3172
|
options: RSAKeyPairOptions<"der", "der">,
|
|
3153
3173
|
): Promise<{
|
|
3154
|
-
publicKey:
|
|
3155
|
-
privateKey:
|
|
3174
|
+
publicKey: NonSharedBuffer;
|
|
3175
|
+
privateKey: NonSharedBuffer;
|
|
3156
3176
|
}>;
|
|
3157
3177
|
function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3158
3178
|
function __promisify__(
|
|
@@ -3167,21 +3187,21 @@ declare module "crypto" {
|
|
|
3167
3187
|
options: RSAPSSKeyPairOptions<"pem", "der">,
|
|
3168
3188
|
): Promise<{
|
|
3169
3189
|
publicKey: string;
|
|
3170
|
-
privateKey:
|
|
3190
|
+
privateKey: NonSharedBuffer;
|
|
3171
3191
|
}>;
|
|
3172
3192
|
function __promisify__(
|
|
3173
3193
|
type: "rsa-pss",
|
|
3174
3194
|
options: RSAPSSKeyPairOptions<"der", "pem">,
|
|
3175
3195
|
): Promise<{
|
|
3176
|
-
publicKey:
|
|
3196
|
+
publicKey: NonSharedBuffer;
|
|
3177
3197
|
privateKey: string;
|
|
3178
3198
|
}>;
|
|
3179
3199
|
function __promisify__(
|
|
3180
3200
|
type: "rsa-pss",
|
|
3181
3201
|
options: RSAPSSKeyPairOptions<"der", "der">,
|
|
3182
3202
|
): Promise<{
|
|
3183
|
-
publicKey:
|
|
3184
|
-
privateKey:
|
|
3203
|
+
publicKey: NonSharedBuffer;
|
|
3204
|
+
privateKey: NonSharedBuffer;
|
|
3185
3205
|
}>;
|
|
3186
3206
|
function __promisify__(
|
|
3187
3207
|
type: "rsa-pss",
|
|
@@ -3199,21 +3219,21 @@ declare module "crypto" {
|
|
|
3199
3219
|
options: DSAKeyPairOptions<"pem", "der">,
|
|
3200
3220
|
): Promise<{
|
|
3201
3221
|
publicKey: string;
|
|
3202
|
-
privateKey:
|
|
3222
|
+
privateKey: NonSharedBuffer;
|
|
3203
3223
|
}>;
|
|
3204
3224
|
function __promisify__(
|
|
3205
3225
|
type: "dsa",
|
|
3206
3226
|
options: DSAKeyPairOptions<"der", "pem">,
|
|
3207
3227
|
): Promise<{
|
|
3208
|
-
publicKey:
|
|
3228
|
+
publicKey: NonSharedBuffer;
|
|
3209
3229
|
privateKey: string;
|
|
3210
3230
|
}>;
|
|
3211
3231
|
function __promisify__(
|
|
3212
3232
|
type: "dsa",
|
|
3213
3233
|
options: DSAKeyPairOptions<"der", "der">,
|
|
3214
3234
|
): Promise<{
|
|
3215
|
-
publicKey:
|
|
3216
|
-
privateKey:
|
|
3235
|
+
publicKey: NonSharedBuffer;
|
|
3236
|
+
privateKey: NonSharedBuffer;
|
|
3217
3237
|
}>;
|
|
3218
3238
|
function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3219
3239
|
function __promisify__(
|
|
@@ -3228,21 +3248,21 @@ declare module "crypto" {
|
|
|
3228
3248
|
options: ECKeyPairOptions<"pem", "der">,
|
|
3229
3249
|
): Promise<{
|
|
3230
3250
|
publicKey: string;
|
|
3231
|
-
privateKey:
|
|
3251
|
+
privateKey: NonSharedBuffer;
|
|
3232
3252
|
}>;
|
|
3233
3253
|
function __promisify__(
|
|
3234
3254
|
type: "ec",
|
|
3235
3255
|
options: ECKeyPairOptions<"der", "pem">,
|
|
3236
3256
|
): Promise<{
|
|
3237
|
-
publicKey:
|
|
3257
|
+
publicKey: NonSharedBuffer;
|
|
3238
3258
|
privateKey: string;
|
|
3239
3259
|
}>;
|
|
3240
3260
|
function __promisify__(
|
|
3241
3261
|
type: "ec",
|
|
3242
3262
|
options: ECKeyPairOptions<"der", "der">,
|
|
3243
3263
|
): Promise<{
|
|
3244
|
-
publicKey:
|
|
3245
|
-
privateKey:
|
|
3264
|
+
publicKey: NonSharedBuffer;
|
|
3265
|
+
privateKey: NonSharedBuffer;
|
|
3246
3266
|
}>;
|
|
3247
3267
|
function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3248
3268
|
function __promisify__(
|
|
@@ -3257,21 +3277,21 @@ declare module "crypto" {
|
|
|
3257
3277
|
options: ED25519KeyPairOptions<"pem", "der">,
|
|
3258
3278
|
): Promise<{
|
|
3259
3279
|
publicKey: string;
|
|
3260
|
-
privateKey:
|
|
3280
|
+
privateKey: NonSharedBuffer;
|
|
3261
3281
|
}>;
|
|
3262
3282
|
function __promisify__(
|
|
3263
3283
|
type: "ed25519",
|
|
3264
3284
|
options: ED25519KeyPairOptions<"der", "pem">,
|
|
3265
3285
|
): Promise<{
|
|
3266
|
-
publicKey:
|
|
3286
|
+
publicKey: NonSharedBuffer;
|
|
3267
3287
|
privateKey: string;
|
|
3268
3288
|
}>;
|
|
3269
3289
|
function __promisify__(
|
|
3270
3290
|
type: "ed25519",
|
|
3271
3291
|
options: ED25519KeyPairOptions<"der", "der">,
|
|
3272
3292
|
): Promise<{
|
|
3273
|
-
publicKey:
|
|
3274
|
-
privateKey:
|
|
3293
|
+
publicKey: NonSharedBuffer;
|
|
3294
|
+
privateKey: NonSharedBuffer;
|
|
3275
3295
|
}>;
|
|
3276
3296
|
function __promisify__(
|
|
3277
3297
|
type: "ed25519",
|
|
@@ -3289,21 +3309,21 @@ declare module "crypto" {
|
|
|
3289
3309
|
options: ED448KeyPairOptions<"pem", "der">,
|
|
3290
3310
|
): Promise<{
|
|
3291
3311
|
publicKey: string;
|
|
3292
|
-
privateKey:
|
|
3312
|
+
privateKey: NonSharedBuffer;
|
|
3293
3313
|
}>;
|
|
3294
3314
|
function __promisify__(
|
|
3295
3315
|
type: "ed448",
|
|
3296
3316
|
options: ED448KeyPairOptions<"der", "pem">,
|
|
3297
3317
|
): Promise<{
|
|
3298
|
-
publicKey:
|
|
3318
|
+
publicKey: NonSharedBuffer;
|
|
3299
3319
|
privateKey: string;
|
|
3300
3320
|
}>;
|
|
3301
3321
|
function __promisify__(
|
|
3302
3322
|
type: "ed448",
|
|
3303
3323
|
options: ED448KeyPairOptions<"der", "der">,
|
|
3304
3324
|
): Promise<{
|
|
3305
|
-
publicKey:
|
|
3306
|
-
privateKey:
|
|
3325
|
+
publicKey: NonSharedBuffer;
|
|
3326
|
+
privateKey: NonSharedBuffer;
|
|
3307
3327
|
}>;
|
|
3308
3328
|
function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3309
3329
|
function __promisify__(
|
|
@@ -3318,21 +3338,21 @@ declare module "crypto" {
|
|
|
3318
3338
|
options: X25519KeyPairOptions<"pem", "der">,
|
|
3319
3339
|
): Promise<{
|
|
3320
3340
|
publicKey: string;
|
|
3321
|
-
privateKey:
|
|
3341
|
+
privateKey: NonSharedBuffer;
|
|
3322
3342
|
}>;
|
|
3323
3343
|
function __promisify__(
|
|
3324
3344
|
type: "x25519",
|
|
3325
3345
|
options: X25519KeyPairOptions<"der", "pem">,
|
|
3326
3346
|
): Promise<{
|
|
3327
|
-
publicKey:
|
|
3347
|
+
publicKey: NonSharedBuffer;
|
|
3328
3348
|
privateKey: string;
|
|
3329
3349
|
}>;
|
|
3330
3350
|
function __promisify__(
|
|
3331
3351
|
type: "x25519",
|
|
3332
3352
|
options: X25519KeyPairOptions<"der", "der">,
|
|
3333
3353
|
): Promise<{
|
|
3334
|
-
publicKey:
|
|
3335
|
-
privateKey:
|
|
3354
|
+
publicKey: NonSharedBuffer;
|
|
3355
|
+
privateKey: NonSharedBuffer;
|
|
3336
3356
|
}>;
|
|
3337
3357
|
function __promisify__(
|
|
3338
3358
|
type: "x25519",
|
|
@@ -3350,21 +3370,21 @@ declare module "crypto" {
|
|
|
3350
3370
|
options: X448KeyPairOptions<"pem", "der">,
|
|
3351
3371
|
): Promise<{
|
|
3352
3372
|
publicKey: string;
|
|
3353
|
-
privateKey:
|
|
3373
|
+
privateKey: NonSharedBuffer;
|
|
3354
3374
|
}>;
|
|
3355
3375
|
function __promisify__(
|
|
3356
3376
|
type: "x448",
|
|
3357
3377
|
options: X448KeyPairOptions<"der", "pem">,
|
|
3358
3378
|
): Promise<{
|
|
3359
|
-
publicKey:
|
|
3379
|
+
publicKey: NonSharedBuffer;
|
|
3360
3380
|
privateKey: string;
|
|
3361
3381
|
}>;
|
|
3362
3382
|
function __promisify__(
|
|
3363
3383
|
type: "x448",
|
|
3364
3384
|
options: X448KeyPairOptions<"der", "der">,
|
|
3365
3385
|
): Promise<{
|
|
3366
|
-
publicKey:
|
|
3367
|
-
privateKey:
|
|
3386
|
+
publicKey: NonSharedBuffer;
|
|
3387
|
+
privateKey: NonSharedBuffer;
|
|
3368
3388
|
}>;
|
|
3369
3389
|
function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
3370
3390
|
}
|
|
@@ -3384,12 +3404,12 @@ declare module "crypto" {
|
|
|
3384
3404
|
algorithm: string | null | undefined,
|
|
3385
3405
|
data: NodeJS.ArrayBufferView,
|
|
3386
3406
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
3387
|
-
):
|
|
3407
|
+
): NonSharedBuffer;
|
|
3388
3408
|
function sign(
|
|
3389
3409
|
algorithm: string | null | undefined,
|
|
3390
3410
|
data: NodeJS.ArrayBufferView,
|
|
3391
3411
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
3392
|
-
callback: (error: Error | null, data:
|
|
3412
|
+
callback: (error: Error | null, data: NonSharedBuffer) => void,
|
|
3393
3413
|
): void;
|
|
3394
3414
|
/**
|
|
3395
3415
|
* 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
|
|
@@ -3425,7 +3445,7 @@ declare module "crypto" {
|
|
|
3425
3445
|
* 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).
|
|
3426
3446
|
* @since v13.9.0, v12.17.0
|
|
3427
3447
|
*/
|
|
3428
|
-
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }):
|
|
3448
|
+
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
|
|
3429
3449
|
/**
|
|
3430
3450
|
* 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
|
|
3431
3451
|
* (<= 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`
|
|
@@ -3455,12 +3475,12 @@ declare module "crypto" {
|
|
|
3455
3475
|
* @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v20.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest.
|
|
3456
3476
|
*/
|
|
3457
3477
|
function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string;
|
|
3458
|
-
function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"):
|
|
3478
|
+
function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): NonSharedBuffer;
|
|
3459
3479
|
function hash(
|
|
3460
3480
|
algorithm: string,
|
|
3461
3481
|
data: BinaryLike,
|
|
3462
3482
|
outputEncoding?: BinaryToTextEncoding | "buffer",
|
|
3463
|
-
): string |
|
|
3483
|
+
): string | NonSharedBuffer;
|
|
3464
3484
|
type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
|
|
3465
3485
|
interface CipherInfoOptions {
|
|
3466
3486
|
/**
|
|
@@ -3752,7 +3772,7 @@ declare module "crypto" {
|
|
|
3752
3772
|
* A `Buffer` containing the DER encoding of this certificate.
|
|
3753
3773
|
* @since v15.6.0
|
|
3754
3774
|
*/
|
|
3755
|
-
readonly raw:
|
|
3775
|
+
readonly raw: NonSharedBuffer;
|
|
3756
3776
|
/**
|
|
3757
3777
|
* The serial number of this certificate.
|
|
3758
3778
|
*
|