| | |
| | | /** |
| | | * The `node:crypto` module provides cryptographic functionality that includes a |
| | | * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify |
| | | * functions. |
| | | * |
| | | * ```js |
| | | * const { createHmac } = await import('node:crypto'); |
| | | * |
| | | * const secret = 'abcdefg'; |
| | | * const hash = createHmac('sha256', secret) |
| | | * .update('I love cupcakes') |
| | | * .digest('hex'); |
| | | * console.log(hash); |
| | | * // Prints: |
| | | * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e |
| | | * ``` |
| | | * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/crypto.js) |
| | | */ |
| | | declare module "node:crypto" { |
| | | import { NonSharedBuffer } from "node:buffer"; |
| | | import * as stream from "node:stream"; |
| | |
| | | interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} |
| | | interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} |
| | | /** |
| | | * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, |
| | | * Ed25519, Ed448, X25519, X448, DH, and ML-DSA are currently supported. |
| | | * Generates a new asymmetric key pair of the given `type`. See the |
| | | * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). |
| | | * |
| | | * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function |
| | | * behaves as if `keyObject.export()` had been called on its result. Otherwise, |
| | |
| | | options?: T, |
| | | ): KeyPairExportResult<T>; |
| | | /** |
| | | * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, |
| | | * Ed25519, Ed448, X25519, X448, and DH are currently supported. |
| | | * Generates a new asymmetric key pair of the given `type`. See the |
| | | * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). |
| | | * |
| | | * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function |
| | | * behaves as if `keyObject.export()` had been called on its result. Otherwise, |