@types/node 22.18.11 → 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/crypto.d.ts CHANGED
@@ -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): Buffer;
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): Buffer;
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): Buffer;
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): Buffer;
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(): Buffer;
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(): Buffer;
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 | Buffer;
650
- export(options?: KeyExportOptions<"der">): Buffer;
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
@@ -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): Buffer;
900
- update(data: string, inputEncoding: Encoding): Buffer;
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(): Buffer;
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(): Buffer;
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(): Buffer;
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(): Buffer;
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(): Buffer;
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): Buffer;
1150
- update(data: string, inputEncoding: Encoding): Buffer;
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(): Buffer;
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): Buffer;
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(): Buffer;
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(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
1608
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
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(): Buffer;
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(): Buffer;
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(): Buffer;
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(): Buffer;
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: Buffer) => void,
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
- ): Buffer;
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): Buffer;
1888
- function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
1889
- function pseudoRandomBytes(size: number): Buffer;
1890
- function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
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: Buffer) => void,
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: Buffer) => void,
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(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
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
- ): Buffer;
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
- ): Buffer;
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(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): Buffer;
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(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): Buffer;
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
- ): Buffer | string;
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(): Buffer;
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): Buffer;
2383
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
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(): Buffer;
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): Buffer;
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.
@@ -2687,15 +2707,15 @@ declare module "crypto" {
2687
2707
  function generateKeyPairSync(
2688
2708
  type: "rsa",
2689
2709
  options: RSAKeyPairOptions<"pem", "der">,
2690
- ): KeyPairSyncResult<string, Buffer>;
2710
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2691
2711
  function generateKeyPairSync(
2692
2712
  type: "rsa",
2693
2713
  options: RSAKeyPairOptions<"der", "pem">,
2694
- ): KeyPairSyncResult<Buffer, string>;
2714
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2695
2715
  function generateKeyPairSync(
2696
2716
  type: "rsa",
2697
2717
  options: RSAKeyPairOptions<"der", "der">,
2698
- ): KeyPairSyncResult<Buffer, Buffer>;
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, Buffer>;
2727
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2708
2728
  function generateKeyPairSync(
2709
2729
  type: "rsa-pss",
2710
2730
  options: RSAPSSKeyPairOptions<"der", "pem">,
2711
- ): KeyPairSyncResult<Buffer, string>;
2731
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2712
2732
  function generateKeyPairSync(
2713
2733
  type: "rsa-pss",
2714
2734
  options: RSAPSSKeyPairOptions<"der", "der">,
2715
- ): KeyPairSyncResult<Buffer, Buffer>;
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, Buffer>;
2744
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2725
2745
  function generateKeyPairSync(
2726
2746
  type: "dsa",
2727
2747
  options: DSAKeyPairOptions<"der", "pem">,
2728
- ): KeyPairSyncResult<Buffer, string>;
2748
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2729
2749
  function generateKeyPairSync(
2730
2750
  type: "dsa",
2731
2751
  options: DSAKeyPairOptions<"der", "der">,
2732
- ): KeyPairSyncResult<Buffer, Buffer>;
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, Buffer>;
2761
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2742
2762
  function generateKeyPairSync(
2743
2763
  type: "ec",
2744
2764
  options: ECKeyPairOptions<"der", "pem">,
2745
- ): KeyPairSyncResult<Buffer, string>;
2765
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2746
2766
  function generateKeyPairSync(
2747
2767
  type: "ec",
2748
2768
  options: ECKeyPairOptions<"der", "der">,
2749
- ): KeyPairSyncResult<Buffer, Buffer>;
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, Buffer>;
2778
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2759
2779
  function generateKeyPairSync(
2760
2780
  type: "ed25519",
2761
2781
  options: ED25519KeyPairOptions<"der", "pem">,
2762
- ): KeyPairSyncResult<Buffer, string>;
2782
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2763
2783
  function generateKeyPairSync(
2764
2784
  type: "ed25519",
2765
2785
  options: ED25519KeyPairOptions<"der", "der">,
2766
- ): KeyPairSyncResult<Buffer, Buffer>;
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, Buffer>;
2795
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2776
2796
  function generateKeyPairSync(
2777
2797
  type: "ed448",
2778
2798
  options: ED448KeyPairOptions<"der", "pem">,
2779
- ): KeyPairSyncResult<Buffer, string>;
2799
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2780
2800
  function generateKeyPairSync(
2781
2801
  type: "ed448",
2782
2802
  options: ED448KeyPairOptions<"der", "der">,
2783
- ): KeyPairSyncResult<Buffer, Buffer>;
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, Buffer>;
2812
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2793
2813
  function generateKeyPairSync(
2794
2814
  type: "x25519",
2795
2815
  options: X25519KeyPairOptions<"der", "pem">,
2796
- ): KeyPairSyncResult<Buffer, string>;
2816
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2797
2817
  function generateKeyPairSync(
2798
2818
  type: "x25519",
2799
2819
  options: X25519KeyPairOptions<"der", "der">,
2800
- ): KeyPairSyncResult<Buffer, Buffer>;
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, Buffer>;
2829
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2810
2830
  function generateKeyPairSync(
2811
2831
  type: "x448",
2812
2832
  options: X448KeyPairOptions<"der", "pem">,
2813
- ): KeyPairSyncResult<Buffer, string>;
2833
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2814
2834
  function generateKeyPairSync(
2815
2835
  type: "x448",
2816
2836
  options: X448KeyPairOptions<"der", "der">,
2817
- ): KeyPairSyncResult<Buffer, Buffer>;
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer) => void,
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: Buffer, privateKey: string) => void,
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: Buffer, privateKey: Buffer) => void,
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: Buffer;
3091
+ privateKey: NonSharedBuffer;
3072
3092
  }>;
3073
3093
  function __promisify__(
3074
3094
  type: "rsa",
3075
3095
  options: RSAKeyPairOptions<"der", "pem">,
3076
3096
  ): Promise<{
3077
- publicKey: Buffer;
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: Buffer;
3085
- privateKey: Buffer;
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: Buffer;
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: Buffer;
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: Buffer;
3114
- privateKey: Buffer;
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: Buffer;
3152
+ privateKey: NonSharedBuffer;
3133
3153
  }>;
3134
3154
  function __promisify__(
3135
3155
  type: "dsa",
3136
3156
  options: DSAKeyPairOptions<"der", "pem">,
3137
3157
  ): Promise<{
3138
- publicKey: Buffer;
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: Buffer;
3146
- privateKey: Buffer;
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: Buffer;
3181
+ privateKey: NonSharedBuffer;
3162
3182
  }>;
3163
3183
  function __promisify__(
3164
3184
  type: "ec",
3165
3185
  options: ECKeyPairOptions<"der", "pem">,
3166
3186
  ): Promise<{
3167
- publicKey: Buffer;
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: Buffer;
3175
- privateKey: Buffer;
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: Buffer;
3210
+ privateKey: NonSharedBuffer;
3191
3211
  }>;
3192
3212
  function __promisify__(
3193
3213
  type: "ed25519",
3194
3214
  options: ED25519KeyPairOptions<"der", "pem">,
3195
3215
  ): Promise<{
3196
- publicKey: Buffer;
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: Buffer;
3204
- privateKey: Buffer;
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: Buffer;
3242
+ privateKey: NonSharedBuffer;
3223
3243
  }>;
3224
3244
  function __promisify__(
3225
3245
  type: "ed448",
3226
3246
  options: ED448KeyPairOptions<"der", "pem">,
3227
3247
  ): Promise<{
3228
- publicKey: Buffer;
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: Buffer;
3236
- privateKey: Buffer;
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: Buffer;
3271
+ privateKey: NonSharedBuffer;
3252
3272
  }>;
3253
3273
  function __promisify__(
3254
3274
  type: "x25519",
3255
3275
  options: X25519KeyPairOptions<"der", "pem">,
3256
3276
  ): Promise<{
3257
- publicKey: Buffer;
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: Buffer;
3265
- privateKey: Buffer;
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: Buffer;
3303
+ privateKey: NonSharedBuffer;
3284
3304
  }>;
3285
3305
  function __promisify__(
3286
3306
  type: "x448",
3287
3307
  options: X448KeyPairOptions<"der", "pem">,
3288
3308
  ): Promise<{
3289
- publicKey: Buffer;
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: Buffer;
3297
- privateKey: Buffer;
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
- ): Buffer;
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: Buffer) => void,
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 }): Buffer;
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"): 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 | Buffer;
3413
+ ): string | NonSharedBuffer;
3394
3414
  type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
3395
3415
  interface CipherInfoOptions {
3396
3416
  /**
@@ -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: Buffer;
3705
+ readonly raw: NonSharedBuffer;
3686
3706
  /**
3687
3707
  * The serial number of this certificate.
3688
3708
  *