{
  "type": "module",
  "source": "doc/api/crypto.md",
  "modules": [
    {
      "textRaw": "Crypto",
      "name": "crypto",
      "introduced_in": "v0.3.6",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:crypto</code> module provides cryptographic functionality that includes a\nset of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify\nfunctions.</p>\n<pre><code class=\"language-mjs\">const { createHmac } = await import('node:crypto');\n\nconst secret = 'abcdefg';\nconst hash = createHmac('sha256', secret)\n               .update('I love cupcakes')\n               .digest('hex');\nconsole.log(hash);\n// Prints:\n//   c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e\n</code></pre>\n<pre><code class=\"language-cjs\">const { createHmac } = require('node:crypto');\n\nconst secret = 'abcdefg';\nconst hash = createHmac('sha256', secret)\n               .update('I love cupcakes')\n               .digest('hex');\nconsole.log(hash);\n// Prints:\n//   c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e\n</code></pre>",
      "modules": [
        {
          "textRaw": "Determining if crypto support is unavailable",
          "name": "determining_if_crypto_support_is_unavailable",
          "type": "module",
          "desc": "<p>It is possible for Node.js to be built without including support for the\n<code>node:crypto</code> module. In such cases, attempting to <code>import</code> from <code>crypto</code> or\ncalling <code>require('node:crypto')</code> will result in an error being thrown.</p>\n<p>When using CommonJS, the error thrown can be caught using try/catch:</p>\n<pre><code class=\"language-cjs\">let crypto;\ntry {\n  crypto = require('node:crypto');\n} catch (err) {\n  console.error('crypto support is disabled!');\n}\n</code></pre>\n<p>When using the lexical ESM <code>import</code> keyword, the error can only be\ncaught if a handler for <code>process.on('uncaughtException')</code> is registered\n<em>before</em> any attempt to load the module is made (using, for instance,\na preload module).</p>\n<p>When using ESM, if there is a chance that the code may be run on a build\nof Node.js where crypto support is not enabled, consider using the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\"><code>import()</code></a> function instead of the lexical <code>import</code> keyword:</p>\n<pre><code class=\"language-mjs\">let crypto;\ntry {\n  crypto = await import('node:crypto');\n} catch (err) {\n  console.error('crypto support is disabled!');\n}\n</code></pre>",
          "displayName": "Determining if crypto support is unavailable"
        },
        {
          "textRaw": "Asymmetric key types",
          "name": "asymmetric_key_types",
          "type": "module",
          "desc": "<p>The following table lists the asymmetric key types recognized by the\n<a href=\"#class-keyobject\"><code>KeyObject</code></a> API and the export/import formats supported for each key type.</p>\n<table>\n<thead>\n<tr>\n<th>Key Type</th>\n<th>Description</th>\n<th>OID</th>\n<th><code>'pem'</code></th>\n<th><code>'der'</code></th>\n<th><code>'jwk'</code></th>\n<th><code>'raw-public'</code></th>\n<th><code>'raw-private'</code></th>\n<th><code>'raw-seed'</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'dh'</code></td>\n<td>Diffie-Hellman</td>\n<td>1.2.840.113549.1.3.1</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'dsa'</code></td>\n<td>DSA</td>\n<td>1.2.840.10040.4.1</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ec'</code></td>\n<td>Elliptic curve</td>\n<td>1.2.840.10045.2.1</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ed25519'</code></td>\n<td>Ed25519</td>\n<td>1.3.101.112</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ed448'</code></td>\n<td>Ed448</td>\n<td>1.3.101.113</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ml-dsa-44'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-DSA-44</td>\n<td>2.16.840.1.101.3.4.3.17</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-dsa-65'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-DSA-65</td>\n<td>2.16.840.1.101.3.4.3.18</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-dsa-87'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-DSA-87</td>\n<td>2.16.840.1.101.3.4.3.19</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-kem-512'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-KEM-512</td>\n<td>2.16.840.1.101.3.4.4.1</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-kem-768'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-KEM-768</td>\n<td>2.16.840.1.101.3.4.4.2</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-kem-1024'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-KEM-1024</td>\n<td>2.16.840.1.101.3.4.4.3</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'rsa-pss'</code></td>\n<td>RSA PSS</td>\n<td>1.2.840.113549.1.1.10</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'rsa'</code></td>\n<td>RSA</td>\n<td>1.2.840.113549.1.1.1</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-128f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-128f</td>\n<td>2.16.840.1.101.3.4.3.21</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-128s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-128s</td>\n<td>2.16.840.1.101.3.4.3.20</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-192f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-192f</td>\n<td>2.16.840.1.101.3.4.3.23</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-192s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-10\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-192s</td>\n<td>2.16.840.1.101.3.4.3.22</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-256f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-11\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-256f</td>\n<td>2.16.840.1.101.3.4.3.25</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-256s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-12\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-256s</td>\n<td>2.16.840.1.101.3.4.3.24</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-128f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-13\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-128f</td>\n<td>2.16.840.1.101.3.4.3.27</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-128s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-14\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-128s</td>\n<td>2.16.840.1.101.3.4.3.26</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-192f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-15\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-192f</td>\n<td>2.16.840.1.101.3.4.3.29</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-192s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-16\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-192s</td>\n<td>2.16.840.1.101.3.4.3.28</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-256f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-17\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-256f</td>\n<td>2.16.840.1.101.3.4.3.31</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-256s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-18\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-256s</td>\n<td>2.16.840.1.101.3.4.3.30</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'x25519'</code></td>\n<td>X25519</td>\n<td>1.3.101.110</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'x448'</code></td>\n<td>X448</td>\n<td>1.3.101.111</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n</tbody>\n</table>",
          "modules": [
            {
              "textRaw": "Key formats",
              "name": "key_formats",
              "type": "module",
              "desc": "<p>Asymmetric keys can be represented in several formats. <strong>The recommended\napproach is to import key material into a <a href=\"#class-keyobject\"><code>KeyObject</code></a> once and reuse it</strong>\nfor all subsequent operations, as this avoids repeated parsing and delivers\nthe best performance.</p>\n<p>When a <a href=\"#class-keyobject\"><code>KeyObject</code></a> is not practical - for example, when key material\narrives in a protocol message and is used only once - most cryptographic\nfunctions also accept a PEM string or an object specifying the format\nand key material directly. See <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>,\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>, and <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a> for the full\noptions accepted by each format.</p>",
              "modules": [
                {
                  "textRaw": "KeyObject",
                  "name": "keyobject",
                  "type": "module",
                  "desc": "<p>A <a href=\"#class-keyobject\"><code>KeyObject</code></a> is the in-memory representation of a parsed key. It is\ncreated by <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>, <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>,\n<a href=\"#cryptocreatesecretkeykey-encoding\"><code>crypto.createSecretKey()</code></a>, or key generation functions such as\n<a href=\"#cryptogeneratekeypairtype-options-callback\"><code>crypto.generateKeyPair()</code></a>. The first cryptographic operation with a given\n<a href=\"#class-keyobject\"><code>KeyObject</code></a> may be slower than subsequent ones because OpenSSL lazily\ninitializes internal caches on first use.</p>",
                  "displayName": "KeyObject"
                },
                {
                  "textRaw": "PEM and DER",
                  "name": "pem_and_der",
                  "type": "module",
                  "desc": "<p>PEM and DER are the traditional encoding formats for asymmetric keys based on\nASN.1 structures.</p>\n<ul>\n<li><strong>PEM</strong> is a text encoding that wraps Base64-encoded DER data between\nheader and footer lines (e.g. <code>-----BEGIN PUBLIC KEY-----</code>). PEM strings can\nbe passed directly to most cryptographic operations.</li>\n<li><strong>DER</strong> is the binary encoding of the same ASN.1 structures. When providing\nDER input, the <code>type</code> (typically <code>'spki'</code> or <code>'pkcs8'</code>) must be specified\nexplicitly.</li>\n</ul>",
                  "displayName": "PEM and DER"
                },
                {
                  "textRaw": "JSON Web Key (JWK)",
                  "name": "json_web_key_(jwk)",
                  "type": "module",
                  "desc": "<p>JSON Web Key (JWK) is a JSON-based key representation defined in\n<a href=\"https://www.rfc-editor.org/rfc/rfc7517.txt\">RFC 7517</a>. JWK encodes each key component as an individual Base64url-encoded\nvalue inside a JSON object. For RSA keys, JWK avoids ASN.1 parsing overhead\nand is the fastest serialized import format.</p>",
                  "displayName": "JSON Web Key (JWK)"
                },
                {
                  "textRaw": "Raw key formats",
                  "name": "raw_key_formats",
                  "type": "module",
                  "stability": 1.1,
                  "stabilityText": "Active development",
                  "desc": "<p>The <code>'raw-public'</code>, <code>'raw-private'</code>, and <code>'raw-seed'</code> key formats allow\nimporting and exporting raw key material without any encoding wrapper.\nSee <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a>, <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>, and\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a> for usage details.</p>\n<p><code>'raw-public'</code> is generally the fastest way to import a public key.\n<code>'raw-private'</code> and <code>'raw-seed'</code> are not always faster than other formats\nbecause they only contain the private scalar or seed - importing them requires\nderiving the public key component (e.g. elliptic curve point multiplication or\nseed expansion), which can be expensive. Other formats include both private\nand public components, avoiding that computation.</p>",
                  "displayName": "Raw key formats"
                }
              ],
              "displayName": "Key formats"
            },
            {
              "textRaw": "Choosing a key format",
              "name": "choosing_a_key_format",
              "type": "module",
              "desc": "<p><strong>Always prefer a <a href=\"#class-keyobject\"><code>KeyObject</code></a></strong> - create one from whatever format you\nhave and reuse it. The guidance below applies only when choosing between\nserialization formats, either for importing into a <a href=\"#class-keyobject\"><code>KeyObject</code></a> or for\npassing key material inline when a <a href=\"#class-keyobject\"><code>KeyObject</code></a> is not practical.</p>",
              "modules": [
                {
                  "textRaw": "Importing keys",
                  "name": "importing_keys",
                  "type": "module",
                  "desc": "<p>When creating a <a href=\"#class-keyobject\"><code>KeyObject</code></a> for repeated use, the import cost is paid once,\nso choosing a faster format reduces startup latency.</p>\n<p>The import cost breaks down into two parts: <strong>parsing overhead</strong> (decoding the\nserialization wrapper) and <strong>key computation</strong> (any mathematical work needed to\nreconstruct the full key, such as deriving a public key from a private scalar\nor expanding a seed). Which part dominates depends on the key type. For\nexample:</p>\n<ul>\n<li>Public keys - <code>'raw-public'</code> is the fastest serialized format because the\nraw format skips all ASN.1 and Base64 decoding.</li>\n<li>EC private keys - <code>'raw-private'</code> is faster than PEM or DER because it\navoids ASN.1 parsing. However, for larger curves (e.g. P-384, P-521) the\nrequired derivation of the public point from the private scalar becomes\nexpensive, reducing the advantage.</li>\n<li>RSA keys - <code>'jwk'</code> is the fastest serialized format. JWK represents RSA\nkey components as individual Base64url-encoded integers, avoiding the\noverhead of ASN.1 parsing entirely.</li>\n</ul>",
                  "displayName": "Importing keys"
                },
                {
                  "textRaw": "Inline key material in operations",
                  "name": "inline_key_material_in_operations",
                  "type": "module",
                  "desc": "<p>When a <a href=\"#class-keyobject\"><code>KeyObject</code></a> cannot be reused (e.g. the key arrives as raw bytes in\na protocol message and is used only once), most cryptographic functions also\naccept a PEM string or an object specifying the format and key\nmaterial directly. In this case the total cost is the sum of key import and\nthe cryptographic computation itself.</p>\n<p>For operations where the cryptographic computation dominates - such as\nsigning with RSA or ECDH key agreement with P-384 or P-521 - the\nserialization format has negligible impact on overall throughput, so choose\nwhichever format is most convenient. For lightweight operations like Ed25519\nsigning or verification, the import cost is a larger fraction of the total,\nso a faster format like <code>'raw-public'</code> or <code>'raw-private'</code> can meaningfully\nimprove throughput.</p>\n<p>Even if the same key material is used only a few times, it is worth importing it\ninto a <a href=\"#class-keyobject\"><code>KeyObject</code></a> rather than passing the raw or PEM representation\nrepeatedly.</p>",
                  "displayName": "Inline key material in operations"
                }
              ],
              "displayName": "Choosing a key format"
            },
            {
              "textRaw": "Examples",
              "name": "examples",
              "type": "module",
              "desc": "<p>Example: Reusing a <a href=\"#class-keyobject\"><code>KeyObject</code></a> across sign and verify operations:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst { generateKeyPair, sign, verify } = await import('node:crypto');\n\nconst { publicKey, privateKey } = await promisify(generateKeyPair)('ed25519');\n\n// A KeyObject holds the parsed key in memory and can be reused\n// across multiple operations without re-parsing.\nconst data = new TextEncoder().encode('message to sign');\nconst signature = sign(null, data, privateKey);\nverify(null, data, publicKey, signature);\n</code></pre>\n<p>Example: Importing keys of various formats into <a href=\"#class-keyobject\"><code>KeyObject</code></a>s:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst {\n  createPrivateKey, createPublicKey, generateKeyPair,\n} = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ed25519');\n\n// PEM\nconst privatePem = generated.privateKey.export({ format: 'pem', type: 'pkcs8' });\nconst publicPem = generated.publicKey.export({ format: 'pem', type: 'spki' });\ncreatePrivateKey(privatePem);\ncreatePublicKey(publicPem);\n\n// DER - requires explicit type\nconst privateDer = generated.privateKey.export({ format: 'der', type: 'pkcs8' });\nconst publicDer = generated.publicKey.export({ format: 'der', type: 'spki' });\ncreatePrivateKey({ key: privateDer, format: 'der', type: 'pkcs8' });\ncreatePublicKey({ key: publicDer, format: 'der', type: 'spki' });\n\n// JWK\nconst privateJwk = generated.privateKey.export({ format: 'jwk' });\nconst publicJwk = generated.publicKey.export({ format: 'jwk' });\ncreatePrivateKey({ key: privateJwk, format: 'jwk' });\ncreatePublicKey({ key: publicJwk, format: 'jwk' });\n\n// Raw\nconst rawPriv = generated.privateKey.export({ format: 'raw-private' });\nconst rawPub = generated.publicKey.export({ format: 'raw-public' });\ncreatePrivateKey({ key: rawPriv, format: 'raw-private', asymmetricKeyType: 'ed25519' });\ncreatePublicKey({ key: rawPub, format: 'raw-public', asymmetricKeyType: 'ed25519' });\n</code></pre>\n<p>Example: Passing key material directly to <a href=\"#cryptosignalgorithm-data-key-callback\"><code>crypto.sign()</code></a> and\n<a href=\"#cryptoverifyalgorithm-data-key-signature-callback\"><code>crypto.verify()</code></a> without creating a <a href=\"#class-keyobject\"><code>KeyObject</code></a> first:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst { generateKeyPair, sign, verify } = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ed25519');\n\nconst data = new TextEncoder().encode('message to sign');\n\n// PEM strings\nconst privatePem = generated.privateKey.export({ format: 'pem', type: 'pkcs8' });\nconst publicPem = generated.publicKey.export({ format: 'pem', type: 'spki' });\nconst sig1 = sign(null, data, privatePem);\nverify(null, data, publicPem, sig1);\n\n// JWK objects\nconst privateJwk = generated.privateKey.export({ format: 'jwk' });\nconst publicJwk = generated.publicKey.export({ format: 'jwk' });\nconst sig2 = sign(null, data, { key: privateJwk, format: 'jwk' });\nverify(null, data, { key: publicJwk, format: 'jwk' }, sig2);\n\n// Raw key bytes\nconst rawPriv = generated.privateKey.export({ format: 'raw-private' });\nconst rawPub = generated.publicKey.export({ format: 'raw-public' });\nconst sig3 = sign(null, data, {\n  key: rawPriv, format: 'raw-private', asymmetricKeyType: 'ed25519',\n});\nverify(null, data, {\n  key: rawPub, format: 'raw-public', asymmetricKeyType: 'ed25519',\n}, sig3);\n</code></pre>\n<p>Example: For EC keys, the <code>namedCurve</code> option is required when importing\nraw keys:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst {\n  createPrivateKey, createPublicKey, generateKeyPair, sign, verify,\n} = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ec', {\n  namedCurve: 'P-256',\n});\n\n// Export the raw EC public key (uncompressed by default).\nconst rawPublicKey = generated.publicKey.export({ format: 'raw-public' });\n\n// The following is equivalent.\nconst rawPublicKeyUncompressed = generated.publicKey.export({\n  format: 'raw-public',\n  type: 'uncompressed',\n});\n\n// Export compressed point format.\nconst rawPublicKeyCompressed = generated.publicKey.export({\n  format: 'raw-public',\n  type: 'compressed',\n});\n\n// Export the raw EC private key.\nconst rawPrivateKey = generated.privateKey.export({ format: 'raw-private' });\n\n// Import the raw EC keys.\n// Both compressed and uncompressed point formats are accepted.\nconst publicKey = createPublicKey({\n  key: rawPublicKey,\n  format: 'raw-public',\n  asymmetricKeyType: 'ec',\n  namedCurve: 'P-256',\n});\nconst privateKey = createPrivateKey({\n  key: rawPrivateKey,\n  format: 'raw-private',\n  asymmetricKeyType: 'ec',\n  namedCurve: 'P-256',\n});\n\nconst data = new TextEncoder().encode('message to sign');\nconst signature = sign('sha256', data, privateKey);\nverify('sha256', data, publicKey, signature);\n</code></pre>\n<p>Example: Exporting raw seeds and importing them:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst {\n  createPrivateKey, decapsulate, encapsulate, generateKeyPair,\n} = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ml-kem-768');\n\n// Export the raw seed (64 bytes for ML-KEM).\nconst seed = generated.privateKey.export({ format: 'raw-seed' });\n\n// Import the raw seed.\nconst privateKey = createPrivateKey({\n  key: seed,\n  format: 'raw-seed',\n  asymmetricKeyType: 'ml-kem-768',\n});\n\nconst { ciphertext } = encapsulate(generated.publicKey);\ndecapsulate(privateKey, ciphertext);\n</code></pre>",
              "displayName": "Examples"
            }
          ],
          "displayName": "Asymmetric key types"
        },
        {
          "textRaw": "`node:crypto` module methods and properties",
          "name": "`node:crypto`_module_methods_and_properties",
          "type": "module",
          "methods": [
            {
              "textRaw": "`crypto.argon2(algorithm, parameters, callback)`",
              "name": "argon2",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string} Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`.",
                      "name": "algorithm",
                      "type": "string",
                      "desc": "Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`."
                    },
                    {
                      "textRaw": "`parameters` {Object}",
                      "name": "parameters",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`message` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, this is the password for password hashing applications of Argon2.",
                          "name": "message",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, this is the password for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`nonce` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.",
                          "name": "nonce",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`parallelism` {number} REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be greater than 1 and less than `2**24-1`.",
                          "name": "parallelism",
                          "type": "number",
                          "desc": "REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be greater than 1 and less than `2**24-1`."
                        },
                        {
                          "textRaw": "`tagLength` {number} REQUIRED, the length of the key to generate. Must be greater than 4 and less than `2**32-1`.",
                          "name": "tagLength",
                          "type": "number",
                          "desc": "REQUIRED, the length of the key to generate. Must be greater than 4 and less than `2**32-1`."
                        },
                        {
                          "textRaw": "`memory` {number} REQUIRED, memory cost in 1KiB blocks. Must be greater than `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`.",
                          "name": "memory",
                          "type": "number",
                          "desc": "REQUIRED, memory cost in 1KiB blocks. Must be greater than `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`."
                        },
                        {
                          "textRaw": "`passes` {number} REQUIRED, number of passes (iterations). Must be greater than 1 and less than `2**32-1`.",
                          "name": "passes",
                          "type": "number",
                          "desc": "REQUIRED, number of passes (iterations). Must be greater than 1 and less than `2**32-1`."
                        },
                        {
                          "textRaw": "`secret` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "secret",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes."
                        },
                        {
                          "textRaw": "`associatedData` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "associatedData",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {Buffer}",
                          "name": "derivedKey",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Provides an asynchronous <a href=\"https://www.rfc-editor.org/rfc/rfc9106.html\">Argon2</a> implementation. Argon2 is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>nonce</code> should be as unique as possible. It is recommended that a nonce is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>message</code>, <code>nonce</code>, <code>secret</code> or <code>associatedData</code>, please\nconsider <a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>The <code>callback</code> function is called with two arguments: <code>err</code> and <code>derivedKey</code>.\n<code>err</code> is an exception object when key derivation fails, otherwise <code>err</code> is\n<code>null</code>. <code>derivedKey</code> is passed to the callback as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const { argon2, randomBytes } = await import('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nargon2('argon2id', parameters, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { argon2, randomBytes } = require('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nargon2('argon2id', parameters, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.argon2Sync(algorithm, parameters)`",
              "name": "argon2Sync",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string} Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`.",
                      "name": "algorithm",
                      "type": "string",
                      "desc": "Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`."
                    },
                    {
                      "textRaw": "`parameters` {Object}",
                      "name": "parameters",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`message` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, this is the password for password hashing applications of Argon2.",
                          "name": "message",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, this is the password for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`nonce` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.",
                          "name": "nonce",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`parallelism` {number} REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be greater than 1 and less than `2**24-1`.",
                          "name": "parallelism",
                          "type": "number",
                          "desc": "REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be greater than 1 and less than `2**24-1`."
                        },
                        {
                          "textRaw": "`tagLength` {number} REQUIRED, the length of the key to generate. Must be greater than 4 and less than `2**32-1`.",
                          "name": "tagLength",
                          "type": "number",
                          "desc": "REQUIRED, the length of the key to generate. Must be greater than 4 and less than `2**32-1`."
                        },
                        {
                          "textRaw": "`memory` {number} REQUIRED, memory cost in 1KiB blocks. Must be greater than `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`.",
                          "name": "memory",
                          "type": "number",
                          "desc": "REQUIRED, memory cost in 1KiB blocks. Must be greater than `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`."
                        },
                        {
                          "textRaw": "`passes` {number} REQUIRED, number of passes (iterations). Must be greater than 1 and less than `2**32-1`.",
                          "name": "passes",
                          "type": "number",
                          "desc": "REQUIRED, number of passes (iterations). Must be greater than 1 and less than `2**32-1`."
                        },
                        {
                          "textRaw": "`secret` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "secret",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes."
                        },
                        {
                          "textRaw": "`associatedData` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "associatedData",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous <a href=\"https://www.rfc-editor.org/rfc/rfc9106.html\">Argon2</a> implementation. Argon2 is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>nonce</code> should be as unique as possible. It is recommended that a nonce is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>message</code>, <code>nonce</code>, <code>secret</code> or <code>associatedData</code>, please\nconsider <a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>An exception is thrown when key derivation fails, otherwise the derived key is\nreturned as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const { argon2Sync, randomBytes } = await import('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nconst derivedKey = argon2Sync('argon2id', parameters);\nconsole.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n</code></pre>\n<pre><code class=\"language-cjs\">const { argon2Sync, randomBytes } = require('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nconst derivedKey = argon2Sync('argon2id', parameters);\nconsole.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n</code></pre>"
            },
            {
              "textRaw": "`crypto.checkPrime(candidate[, options], callback)`",
              "name": "checkPrime",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`candidate` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint} A possible prime encoded as a sequence of big endian octets of arbitrary length.",
                      "name": "candidate",
                      "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint",
                      "desc": "A possible prime encoded as a sequence of big endian octets of arbitrary length."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`checks` {number} The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details. **Default:** `0`",
                          "name": "checks",
                          "type": "number",
                          "default": "`0`",
                          "desc": "The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error} Set to an {Error} object if an error occurred during check.",
                          "name": "err",
                          "type": "Error",
                          "desc": "Set to an {Error} object if an error occurred during check."
                        },
                        {
                          "textRaw": "`result` {boolean} `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.",
                          "name": "result",
                          "type": "boolean",
                          "desc": "`true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Checks the primality of the <code>candidate</code>.</p>"
            },
            {
              "textRaw": "`crypto.checkPrimeSync(candidate[, options])`",
              "name": "checkPrimeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`candidate` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint} A possible prime encoded as a sequence of big endian octets of arbitrary length.",
                      "name": "candidate",
                      "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint",
                      "desc": "A possible prime encoded as a sequence of big endian octets of arbitrary length."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`checks` {number} The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details. **Default:** `0`",
                          "name": "checks",
                          "type": "number",
                          "default": "`0`",
                          "desc": "The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`."
                  }
                }
              ],
              "desc": "<p>Checks the primality of the <code>candidate</code>.</p>"
            },
            {
              "textRaw": "`crypto.createCipheriv(algorithm, key, iv[, options])`",
              "name": "createCipheriv",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": [
                      "v17.9.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42427",
                    "description": "The `authTagLength` option is now optional when using the `chacha20-poly1305` cipher and defaults to 16 bytes."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The password and iv arguments can be an ArrayBuffer and are each limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `key` argument can now be a `KeyObject`."
                  },
                  {
                    "version": [
                      "v11.2.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/24081",
                    "description": "The cipher `chacha20-poly1305` (the IETF variant of ChaCha20-Poly1305) is now supported."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21447",
                    "description": "Ciphers in OCB mode are now supported."
                  },
                  {
                    "version": "v10.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20235",
                    "description": "The `authTagLength` option can now be used to produce shorter authentication tags in GCM mode and defaults to 16 bytes."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18644",
                    "description": "The `iv` parameter may now be `null` for ciphers which do not need an initialization vector."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`iv` {string|ArrayBuffer|Buffer|TypedArray|DataView|null}",
                      "name": "iv",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|null"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Cipheriv}",
                    "name": "return",
                    "type": "Cipheriv"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Cipheriv</code> object, with the given <code>algorithm</code>, <code>key</code> and\ninitialization vector (<code>iv</code>).</p>\n<p>The <code>options</code> argument controls stream behavior and is optional except when a\ncipher in CCM or OCB mode (e.g. <code>'aes-128-ccm'</code>) is used. In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"#ccm-mode\">CCM mode</a>. In GCM mode, the <code>authTagLength</code>\noption is not required but can be used to set the length of the authentication\ntag that will be returned by <code>getAuthTag()</code> and defaults to 16 bytes.\nFor <code>chacha20-poly1305</code>, the <code>authTagLength</code> option defaults to 16 bytes.</p>\n<p>The <code>algorithm</code> is dependent on OpenSSL, examples are <code>'aes192'</code>, etc. On\nrecent OpenSSL releases, <code>openssl list -cipher-algorithms</code> will\ndisplay the available cipher algorithms.</p>\n<p>The <code>key</code> is the raw key used by the <code>algorithm</code> and <code>iv</code> is an\n<a href=\"https://en.wikipedia.org/wiki/Initialization_vector\">initialization vector</a>. Both arguments must be <code>'utf8'</code> encoded strings,\n<a href=\"buffer.html\">Buffers</a>, <code>TypedArray</code>, or <code>DataView</code>s. The <code>key</code> may optionally be\na <a href=\"#class-keyobject\"><code>KeyObject</code></a> of type <code>secret</code>. If the cipher does not need\nan initialization vector, <code>iv</code> may be <code>null</code>.</p>\n<p>When passing strings for <code>key</code> or <code>iv</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>Initialization vectors should be unpredictable and unique; ideally, they will be\ncryptographically random. They do not have to be secret: IVs are typically just\nadded to ciphertext messages unencrypted. It may sound contradictory that\nsomething has to be unpredictable and unique, but does not have to be secret;\nremember that an attacker must not be able to predict ahead of time what a\ngiven IV will be.</p>"
            },
            {
              "textRaw": "`crypto.createDecipheriv(algorithm, key, iv[, options])`",
              "name": "createDecipheriv",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": [
                      "v17.9.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42427",
                    "description": "The `authTagLength` option is now optional when using the `chacha20-poly1305` cipher and defaults to 16 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `key` argument can now be a `KeyObject`."
                  },
                  {
                    "version": [
                      "v11.2.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/24081",
                    "description": "The cipher `chacha20-poly1305` (the IETF variant of ChaCha20-Poly1305) is now supported."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21447",
                    "description": "Ciphers in OCB mode are now supported."
                  },
                  {
                    "version": "v10.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20039",
                    "description": "The `authTagLength` option can now be used to restrict accepted GCM authentication tag lengths."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18644",
                    "description": "The `iv` parameter may now be `null` for ciphers which do not need an initialization vector."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`iv` {string|ArrayBuffer|Buffer|TypedArray|DataView|null}",
                      "name": "iv",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|null"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv}",
                    "name": "return",
                    "type": "Decipheriv"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Decipheriv</code> object that uses the given <code>algorithm</code>, <code>key</code>\nand initialization vector (<code>iv</code>).</p>\n<p>The <code>options</code> argument controls stream behavior and is optional except when a\ncipher in CCM or OCB mode (e.g. <code>'aes-128-ccm'</code>) is used. In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"#ccm-mode\">CCM mode</a>.\nFor AES-GCM and <code>chacha20-poly1305</code>, the <code>authTagLength</code> option defaults to 16\nbytes and must be set to a different value if a different length is used.</p>\n<p>The <code>algorithm</code> is dependent on OpenSSL, examples are <code>'aes192'</code>, etc. On\nrecent OpenSSL releases, <code>openssl list -cipher-algorithms</code> will\ndisplay the available cipher algorithms.</p>\n<p>The <code>key</code> is the raw key used by the <code>algorithm</code> and <code>iv</code> is an\n<a href=\"https://en.wikipedia.org/wiki/Initialization_vector\">initialization vector</a>. Both arguments must be <code>'utf8'</code> encoded strings,\n<a href=\"buffer.html\">Buffers</a>, <code>TypedArray</code>, or <code>DataView</code>s. The <code>key</code> may optionally be\na <a href=\"#class-keyobject\"><code>KeyObject</code></a> of type <code>secret</code>. If the cipher does not need\nan initialization vector, <code>iv</code> may be <code>null</code>.</p>\n<p>When passing strings for <code>key</code> or <code>iv</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>Initialization vectors should be unpredictable and unique; ideally, they will be\ncryptographically random. They do not have to be secret: IVs are typically just\nadded to ciphertext messages unencrypted. It may sound contradictory that\nsomething has to be unpredictable and unique, but does not have to be secret;\nremember that an attacker must not be able to predict ahead of time what a given\nIV will be.</p>"
            },
            {
              "textRaw": "`crypto.createDiffieHellman(prime[, primeEncoding][, generator][, generatorEncoding])`",
              "name": "createDiffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `prime` argument can be any `TypedArray` or `DataView` now."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11983",
                    "description": "The `prime` argument can be a `Uint8Array` now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default for the encoding parameters changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prime` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "prime",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`primeEncoding` {string} The encoding of the `prime` string.",
                      "name": "primeEncoding",
                      "type": "string",
                      "desc": "The encoding of the `prime` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`generator` {number|string|ArrayBuffer|Buffer|TypedArray|DataView} **Default:** `2`",
                      "name": "generator",
                      "type": "number|string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "default": "`2`",
                      "optional": true
                    },
                    {
                      "textRaw": "`generatorEncoding` {string} The encoding of the `generator` string.",
                      "name": "generatorEncoding",
                      "type": "string",
                      "desc": "The encoding of the `generator` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellman}",
                    "name": "return",
                    "type": "DiffieHellman"
                  }
                }
              ],
              "desc": "<p>Creates a <code>DiffieHellman</code> key exchange object using the supplied <code>prime</code> and an\noptional specific <code>generator</code>.</p>\n<p>The <code>generator</code> argument can be a number, string, or <a href=\"buffer.html\"><code>Buffer</code></a>. If\n<code>generator</code> is not specified, the value <code>2</code> is used.</p>\n<p>If <code>primeEncoding</code> is specified, <code>prime</code> is expected to be a string; otherwise\na <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code> is expected.</p>\n<p>If <code>generatorEncoding</code> is specified, <code>generator</code> is expected to be a string;\notherwise a number, <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code> is expected.</p>"
            },
            {
              "textRaw": "`crypto.createDiffieHellman(primeLength[, generator])`",
              "name": "createDiffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`primeLength` {number}",
                      "name": "primeLength",
                      "type": "number"
                    },
                    {
                      "textRaw": "`generator` {number} **Default:** `2`",
                      "name": "generator",
                      "type": "number",
                      "default": "`2`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellman}",
                    "name": "return",
                    "type": "DiffieHellman"
                  }
                }
              ],
              "desc": "<p>Creates a <code>DiffieHellman</code> key exchange object and generates a prime of\n<code>primeLength</code> bits using an optional specific numeric <code>generator</code>.\nIf <code>generator</code> is not specified, the value <code>2</code> is used.</p>"
            },
            {
              "textRaw": "`crypto.createDiffieHellmanGroup(name)`",
              "name": "createDiffieHellmanGroup",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellmanGroup}",
                    "name": "return",
                    "type": "DiffieHellmanGroup"
                  }
                }
              ],
              "desc": "<p>An alias for <a href=\"#cryptogetdiffiehellmangroupname\"><code>crypto.getDiffieHellman()</code></a></p>"
            },
            {
              "textRaw": "`crypto.createECDH(curveName)`",
              "name": "createECDH",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`curveName` {string}",
                      "name": "curveName",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ECDH}",
                    "name": "return",
                    "type": "ECDH"
                  }
                }
              ],
              "desc": "<p>Creates an Elliptic Curve Diffie-Hellman (<code>ECDH</code>) key exchange object using a\npredefined curve specified by the <code>curveName</code> string. Use\n<a href=\"#cryptogetcurves\"><code>crypto.getCurves()</code></a> to obtain a list of available curve names. On recent\nOpenSSL releases, <code>openssl ecparam -list_curves</code> will also display the name\nand description of each available elliptic curve.</p>"
            },
            {
              "textRaw": "`crypto.createHash(algorithm[, options])`",
              "name": "createHash",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v12.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28805",
                    "description": "The `outputLength` option was added for XOF hash functions."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Hash}",
                    "name": "return",
                    "type": "Hash"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Hash</code> object that can be used to generate hash digests\nusing the given <code>algorithm</code>. Optional <code>options</code> argument controls stream\nbehavior. For XOF hash functions such as <code>'shake256'</code>, the <code>outputLength</code> option\ncan be used to specify the desired output length in bytes.</p>\n<p>The <code>algorithm</code> is dependent on the available algorithms supported by the\nversion of OpenSSL on the platform. Examples are <code>'sha256'</code>, <code>'sha512'</code>, etc.\nOn recent releases of OpenSSL, <code>openssl list -digest-algorithms</code> will\ndisplay the available digest algorithms.</p>\n<p>Example: generating the sha256 sum of a file</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n} from 'node:fs';\nimport { argv } from 'node:process';\nconst {\n  createHash,\n} = await import('node:crypto');\n\nconst filename = argv[2];\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hash.update(data);\n  else {\n    console.log(`${hash.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n} = require('node:fs');\nconst {\n  createHash,\n} = require('node:crypto');\nconst { argv } = require('node:process');\n\nconst filename = argv[2];\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hash.update(data);\n  else {\n    console.log(`${hash.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.createHmac(algorithm, key[, options])`",
              "name": "createHmac",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer or CryptoKey. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `key` argument can now be a `KeyObject`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `key` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `key` is a string."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Hmac}",
                    "name": "return",
                    "type": "Hmac"
                  }
                }
              ],
              "desc": "<p>Creates and returns an <code>Hmac</code> object that uses the given <code>algorithm</code> and <code>key</code>.\nOptional <code>options</code> argument controls stream behavior.</p>\n<p>The <code>algorithm</code> is dependent on the available algorithms supported by the\nversion of OpenSSL on the platform. Examples are <code>'sha256'</code>, <code>'sha512'</code>, etc.\nOn recent releases of OpenSSL, <code>openssl list -digest-algorithms</code> will\ndisplay the available digest algorithms.</p>\n<p>The <code>key</code> is the HMAC key used to generate the cryptographic HMAC hash. If it is\na <a href=\"#class-keyobject\"><code>KeyObject</code></a>, its type must be <code>secret</code>. If it is a string, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>. If it was\nobtained from a cryptographically secure source of entropy, such as\n<a href=\"#cryptorandombytessize-callback\"><code>crypto.randomBytes()</code></a> or <a href=\"#cryptogeneratekeytype-options-callback\"><code>crypto.generateKey()</code></a>, its length should not\nexceed the block size of <code>algorithm</code> (e.g., 512 bits for SHA-256).</p>\n<p>Example: generating the sha256 HMAC of a file</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n} from 'node:fs';\nimport { argv } from 'node:process';\nconst {\n  createHmac,\n} = await import('node:crypto');\n\nconst filename = argv[2];\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hmac.update(data);\n  else {\n    console.log(`${hmac.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n} = require('node:fs');\nconst {\n  createHmac,\n} = require('node:crypto');\nconst { argv } = require('node:process');\n\nconst filename = argv[2];\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hmac.update(data);\n  else {\n    console.log(`${hmac.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.createPrivateKey(key)`",
              "name": "createPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62240",
                    "description": "Added support for `'raw-private'` and `'raw-seed'` formats."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA keys."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37254",
                    "description": "The key can also be a JWK object."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|Object} The key material, either in PEM, DER, JWK, or raw format.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|Object",
                          "desc": "The key material, either in PEM, DER, JWK, or raw format."
                        },
                        {
                          "textRaw": "`format` {string} Must be `'pem'`, `'der'`, `'jwk'`, `'raw-private'`, or `'raw-seed'`. **Default:** `'pem'`.",
                          "name": "format",
                          "type": "string",
                          "default": "`'pem'`",
                          "desc": "Must be `'pem'`, `'der'`, `'jwk'`, `'raw-private'`, or `'raw-seed'`."
                        },
                        {
                          "textRaw": "`type` {string} Must be `'pkcs1'`, `'pkcs8'` or `'sec1'`. This option is required only if the `format` is `'der'` and ignored otherwise.",
                          "name": "type",
                          "type": "string",
                          "desc": "Must be `'pkcs1'`, `'pkcs8'` or `'sec1'`. This option is required only if the `format` is `'der'` and ignored otherwise."
                        },
                        {
                          "textRaw": "`passphrase` {string|Buffer} The passphrase to use for decryption.",
                          "name": "passphrase",
                          "type": "string|Buffer",
                          "desc": "The passphrase to use for decryption."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `key` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `key` is a string."
                        },
                        {
                          "textRaw": "`asymmetricKeyType` {string} Required when `format` is `'raw-private'` or `'raw-seed'` and ignored otherwise. Must be a supported key type.",
                          "name": "asymmetricKeyType",
                          "type": "string",
                          "desc": "Required when `format` is `'raw-private'` or `'raw-seed'` and ignored otherwise. Must be a supported key type."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise.",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Creates and returns a new key object containing a private key. If <code>key</code> is a\nstring or <code>Buffer</code>, <code>format</code> is assumed to be <code>'pem'</code>; otherwise, <code>key</code>\nmust be an object with the properties described above.</p>\n<p>If the private key is encrypted, a <code>passphrase</code> must be specified. The length\nof the passphrase is limited to 1024 bytes.</p>"
            },
            {
              "textRaw": "`crypto.createPublicKey(key)`",
              "name": "createPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62240",
                    "description": "Added support for `'raw-public'` format."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA keys."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37254",
                    "description": "The key can also be a JWK object."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  },
                  {
                    "version": "v11.13.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26278",
                    "description": "The `key` argument can now be a `KeyObject` with type `private`."
                  },
                  {
                    "version": "v11.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25217",
                    "description": "The `key` argument can now be a private key."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|Object} The key material, either in PEM, DER, JWK, or raw format.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|Object",
                          "desc": "The key material, either in PEM, DER, JWK, or raw format."
                        },
                        {
                          "textRaw": "`format` {string} Must be `'pem'`, `'der'`, `'jwk'`, or `'raw-public'`. **Default:** `'pem'`.",
                          "name": "format",
                          "type": "string",
                          "default": "`'pem'`",
                          "desc": "Must be `'pem'`, `'der'`, `'jwk'`, or `'raw-public'`."
                        },
                        {
                          "textRaw": "`type` {string} Must be `'pkcs1'` or `'spki'`. This option is required only if the `format` is `'der'` and ignored otherwise.",
                          "name": "type",
                          "type": "string",
                          "desc": "Must be `'pkcs1'` or `'spki'`. This option is required only if the `format` is `'der'` and ignored otherwise."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `key` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `key` is a string."
                        },
                        {
                          "textRaw": "`asymmetricKeyType` {string} Required when `format` is `'raw-public'` and ignored otherwise. Must be a supported key type.",
                          "name": "asymmetricKeyType",
                          "type": "string",
                          "desc": "Required when `format` is `'raw-public'` and ignored otherwise. Must be a supported key type."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise.",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Creates and returns a new key object containing a public key. If <code>key</code> is a\nstring or <code>Buffer</code>, <code>format</code> is assumed to be <code>'pem'</code>; if <code>key</code> is a <code>KeyObject</code>\nwith type <code>'private'</code>, the public key is derived from the given private key;\notherwise, <code>key</code> must be an object with the properties described above.</p>\n<p>If the format is <code>'pem'</code>, the <code>'key'</code> may also be an X.509 certificate.</p>\n<p>Because public keys can be derived from private keys, a private key may be\npassed instead of a public key. In that case, this function behaves as if\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a> had been called, except that the type of the\nreturned <code>KeyObject</code> will be <code>'public'</code> and that the private key cannot be\nextracted from the returned <code>KeyObject</code>. Similarly, if a <code>KeyObject</code> with type\n<code>'private'</code> is given, a new <code>KeyObject</code> with type <code>'public'</code> will be returned\nand it will be impossible to extract the private key from the returned object.</p>"
            },
            {
              "textRaw": "`crypto.createSecretKey(key[, encoding])`",
              "name": "createSecretKey",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44201",
                    "description": "The key can now be zero-length."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer or string. The encoding argument was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The string encoding when `key` is a string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The string encoding when `key` is a string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Creates and returns a new key object containing a secret key for symmetric\nencryption or <code>Hmac</code>.</p>"
            },
            {
              "textRaw": "`crypto.createSign(algorithm[, options])`",
              "name": "createSign",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.Writable` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.Writable` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Sign}",
                    "name": "return",
                    "type": "Sign"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Sign</code> object that uses the given <code>algorithm</code>. Use\n<a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a> to obtain the names of the available digest algorithms.\nOptional <code>options</code> argument controls the <code>stream.Writable</code> behavior.</p>\n<p>In some cases, a <code>Sign</code> instance can be created using the name of a signature\nalgorithm, such as <code>'RSA-SHA256'</code>, instead of a digest algorithm. This will use\nthe corresponding digest algorithm. This does not work for all signature\nalgorithms, such as <code>'ecdsa-with-SHA256'</code>, so it is best to always use digest\nalgorithm names.</p>"
            },
            {
              "textRaw": "`crypto.createVerify(algorithm[, options])`",
              "name": "createVerify",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.Writable` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.Writable` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Verify}",
                    "name": "return",
                    "type": "Verify"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Verify</code> object that uses the given algorithm.\nUse <a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a> to obtain an array of names of the available\nsigning algorithms. Optional <code>options</code> argument controls the\n<code>stream.Writable</code> behavior.</p>\n<p>In some cases, a <code>Verify</code> instance can be created using the name of a signature\nalgorithm, such as <code>'RSA-SHA256'</code>, instead of a digest algorithm. This will use\nthe corresponding digest algorithm. This does not work for all signature\nalgorithms, such as <code>'ecdsa-with-SHA256'</code>, so it is best to always use digest\nalgorithm names.</p>"
            },
            {
              "textRaw": "`crypto.decapsulate(key, ciphertext[, callback])`",
              "name": "decapsulate",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} Private Key",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "Private Key"
                    },
                    {
                      "textRaw": "`ciphertext` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "ciphertext",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`sharedKey` {Buffer}",
                          "name": "sharedKey",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Key decapsulation using a KEM algorithm with a private key.</p>\n<p>Supported key types and their KEM algorithms are:</p>\n<ul>\n<li><code>'rsa'</code><sup><a href=\"#user-content-fn-openssl30\" id=\"user-content-fnref-openssl30\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup> RSA Secret Value Encapsulation</li>\n<li><code>'ec'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)</li>\n<li><code>'x25519'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X25519, HKDF-SHA256)</li>\n<li><code>'x448'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X448, HKDF-SHA512)</li>\n<li><code>'ml-kem-512'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-768'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-2\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-1024'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-3\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n</ul>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.diffieHellman(options[, callback])`",
              "name": "diffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": "v23.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57274",
                    "description": "Optional callback argument added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`privateKey` {KeyObject}",
                          "name": "privateKey",
                          "type": "KeyObject"
                        },
                        {
                          "textRaw": "`publicKey` {KeyObject}",
                          "name": "publicKey",
                          "type": "KeyObject"
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`secret` {Buffer}",
                          "name": "secret",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Computes the Diffie-Hellman shared secret based on a <code>privateKey</code> and a <code>publicKey</code>.\nBoth keys must have the same <code>asymmetricKeyType</code> and must support either the DH or\nECDH operation.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.encapsulate(key[, callback])`",
              "name": "encapsulate",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} Public Key",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "Public Key"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`result` {Object}",
                          "name": "result",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`sharedKey` {Buffer}",
                              "name": "sharedKey",
                              "type": "Buffer"
                            },
                            {
                              "textRaw": "`ciphertext` {Buffer}",
                              "name": "ciphertext",
                              "type": "Buffer"
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Object",
                    "desc": "if the `callback` function is not provided.",
                    "options": [
                      {
                        "textRaw": "`sharedKey` {Buffer}",
                        "name": "sharedKey",
                        "type": "Buffer"
                      },
                      {
                        "textRaw": "`ciphertext` {Buffer}",
                        "name": "ciphertext",
                        "type": "Buffer"
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Key encapsulation using a KEM algorithm with a public key.</p>\n<p>Supported key types and their KEM algorithms are:</p>\n<ul>\n<li><code>'rsa'</code><sup><a href=\"#user-content-fn-openssl30\" id=\"user-content-fnref-openssl30\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup> RSA Secret Value Encapsulation</li>\n<li><code>'ec'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)</li>\n<li><code>'x25519'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X25519, HKDF-SHA256)</li>\n<li><code>'x448'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X448, HKDF-SHA512)</li>\n<li><code>'ml-kem-512'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-768'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-2\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-1024'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-3\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n</ul>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.generateKey(type, options, callback)`",
              "name": "generateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`length` {number} The bit length of the key to generate. This must be a value greater than 0.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`.",
                          "name": "length",
                          "type": "number",
                          "desc": "The bit length of the key to generate. This must be a value greater than 0.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`key` {KeyObject}",
                          "name": "key",
                          "type": "KeyObject"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously generates a new random secret key of the given <code>length</code>. The\n<code>type</code> will determine which validations will be performed on the <code>length</code>.</p>\n<pre><code class=\"language-mjs\">const {\n  generateKey,\n} = await import('node:crypto');\n\ngenerateKey('hmac', { length: 512 }, (err, key) => {\n  if (err) throw err;\n  console.log(key.export().toString('hex'));  // 46e..........620\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKey,\n} = require('node:crypto');\n\ngenerateKey('hmac', { length: 512 }, (err, key) => {\n  if (err) throw err;\n  console.log(key.export().toString('hex'));  // 46e..........620\n});\n</code></pre>\n<p>The size of a generated HMAC key should not exceed the block size of the\nunderlying hash function. See <a href=\"#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`crypto.generateKeyPair(type, options, callback)`",
              "name": "generateKeyPair",
              "type": "method",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA key pairs."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59461",
                    "description": "Add support for ML-KEM key pairs."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA key pairs."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39927",
                    "description": "Add ability to define `RSASSA-PSS-params` sequence parameters for RSA-PSS keys pairs."
                  },
                  {
                    "version": [
                      "v13.9.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31178",
                    "description": "Add support for Diffie-Hellman."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "Add support for RSA-PSS key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26774",
                    "description": "Add ability to generate X25519 and X448 key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26554",
                    "description": "Add ability to generate Ed25519 and Ed448 key pairs."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `generateKeyPair` and `generateKeyPairSync` functions now produce key objects if no encoding was specified."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The asymmetric key type to generate. See the supported asymmetric key types.",
                      "name": "type",
                      "type": "string",
                      "desc": "The asymmetric key type to generate. See the supported asymmetric key types."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`modulusLength` {number} Key size in bits (RSA, DSA).",
                          "name": "modulusLength",
                          "type": "number",
                          "desc": "Key size in bits (RSA, DSA)."
                        },
                        {
                          "textRaw": "`publicExponent` {number} Public exponent (RSA). **Default:** `0x10001`.",
                          "name": "publicExponent",
                          "type": "number",
                          "default": "`0x10001`",
                          "desc": "Public exponent (RSA)."
                        },
                        {
                          "textRaw": "`hashAlgorithm` {string} Name of the message digest (RSA-PSS).",
                          "name": "hashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest (RSA-PSS)."
                        },
                        {
                          "textRaw": "`mgf1HashAlgorithm` {string} Name of the message digest used by MGF1 (RSA-PSS).",
                          "name": "mgf1HashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest used by MGF1 (RSA-PSS)."
                        },
                        {
                          "textRaw": "`saltLength` {number} Minimal salt length in bytes (RSA-PSS).",
                          "name": "saltLength",
                          "type": "number",
                          "desc": "Minimal salt length in bytes (RSA-PSS)."
                        },
                        {
                          "textRaw": "`divisorLength` {number} Size of `q` in bits (DSA).",
                          "name": "divisorLength",
                          "type": "number",
                          "desc": "Size of `q` in bits (DSA)."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use (EC).",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use (EC)."
                        },
                        {
                          "textRaw": "`prime` {Buffer} The prime parameter (DH).",
                          "name": "prime",
                          "type": "Buffer",
                          "desc": "The prime parameter (DH)."
                        },
                        {
                          "textRaw": "`primeLength` {number} Prime length in bits (DH).",
                          "name": "primeLength",
                          "type": "number",
                          "desc": "Prime length in bits (DH)."
                        },
                        {
                          "textRaw": "`generator` {number} Custom generator (DH). **Default:** `2`.",
                          "name": "generator",
                          "type": "number",
                          "default": "`2`",
                          "desc": "Custom generator (DH)."
                        },
                        {
                          "textRaw": "`groupName` {string} Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`.",
                          "name": "groupName",
                          "type": "string",
                          "desc": "Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`."
                        },
                        {
                          "textRaw": "`paramEncoding` {string} Must be `'named'` or `'explicit'` (EC). **Default:** `'named'`.",
                          "name": "paramEncoding",
                          "type": "string",
                          "default": "`'named'`",
                          "desc": "Must be `'named'` or `'explicit'` (EC)."
                        },
                        {
                          "textRaw": "`publicKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "publicKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        },
                        {
                          "textRaw": "`privateKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "privateKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`publicKey` {string|Buffer|KeyObject}",
                          "name": "publicKey",
                          "type": "string|Buffer|KeyObject"
                        },
                        {
                          "textRaw": "`privateKey` {string|Buffer|KeyObject}",
                          "name": "privateKey",
                          "type": "string|Buffer|KeyObject"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Generates a new asymmetric key pair of the given <code>type</code>. See the\nsupported <a href=\"#asymmetric-key-types\">asymmetric key types</a>.</p>\n<p>If a <code>publicKeyEncoding</code> or <code>privateKeyEncoding</code> was specified, this function\nbehaves as if <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a> had been called on its result. Otherwise,\nthe respective part of the key is returned as a <a href=\"#class-keyobject\"><code>KeyObject</code></a>.</p>\n<p>It is recommended to encode public keys as <code>'spki'</code> and private keys as\n<code>'pkcs8'</code> with encryption for long-term storage:</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPair,\n} = await import('node:crypto');\n\ngenerateKeyPair('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n}, (err, publicKey, privateKey) => {\n  // Handle errors and use the generated key pair.\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPair,\n} = require('node:crypto');\n\ngenerateKeyPair('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n}, (err, publicKey, privateKey) => {\n  // Handle errors and use the generated key pair.\n});\n</code></pre>\n<p>On completion, <code>callback</code> will be called with <code>err</code> set to <code>undefined</code> and\n<code>publicKey</code> / <code>privateKey</code> representing the generated key pair.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na <code>Promise</code> for an <code>Object</code> with <code>publicKey</code> and <code>privateKey</code> properties.</p>"
            },
            {
              "textRaw": "`crypto.generateKeyPairSync(type, options)`",
              "name": "generateKeyPairSync",
              "type": "method",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA key pairs."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59461",
                    "description": "Add support for ML-KEM key pairs."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA key pairs."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39927",
                    "description": "Add ability to define `RSASSA-PSS-params` sequence parameters for RSA-PSS keys pairs."
                  },
                  {
                    "version": [
                      "v13.9.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31178",
                    "description": "Add support for Diffie-Hellman."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "Add support for RSA-PSS key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26774",
                    "description": "Add ability to generate X25519 and X448 key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26554",
                    "description": "Add ability to generate Ed25519 and Ed448 key pairs."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `generateKeyPair` and `generateKeyPairSync` functions now produce key objects if no encoding was specified."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The asymmetric key type to generate. See the supported asymmetric key types.",
                      "name": "type",
                      "type": "string",
                      "desc": "The asymmetric key type to generate. See the supported asymmetric key types."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`modulusLength` {number} Key size in bits (RSA, DSA).",
                          "name": "modulusLength",
                          "type": "number",
                          "desc": "Key size in bits (RSA, DSA)."
                        },
                        {
                          "textRaw": "`publicExponent` {number} Public exponent (RSA). **Default:** `0x10001`.",
                          "name": "publicExponent",
                          "type": "number",
                          "default": "`0x10001`",
                          "desc": "Public exponent (RSA)."
                        },
                        {
                          "textRaw": "`hashAlgorithm` {string} Name of the message digest (RSA-PSS).",
                          "name": "hashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest (RSA-PSS)."
                        },
                        {
                          "textRaw": "`mgf1HashAlgorithm` {string} Name of the message digest used by MGF1 (RSA-PSS).",
                          "name": "mgf1HashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest used by MGF1 (RSA-PSS)."
                        },
                        {
                          "textRaw": "`saltLength` {number} Minimal salt length in bytes (RSA-PSS).",
                          "name": "saltLength",
                          "type": "number",
                          "desc": "Minimal salt length in bytes (RSA-PSS)."
                        },
                        {
                          "textRaw": "`divisorLength` {number} Size of `q` in bits (DSA).",
                          "name": "divisorLength",
                          "type": "number",
                          "desc": "Size of `q` in bits (DSA)."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use (EC).",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use (EC)."
                        },
                        {
                          "textRaw": "`prime` {Buffer} The prime parameter (DH).",
                          "name": "prime",
                          "type": "Buffer",
                          "desc": "The prime parameter (DH)."
                        },
                        {
                          "textRaw": "`primeLength` {number} Prime length in bits (DH).",
                          "name": "primeLength",
                          "type": "number",
                          "desc": "Prime length in bits (DH)."
                        },
                        {
                          "textRaw": "`generator` {number} Custom generator (DH). **Default:** `2`.",
                          "name": "generator",
                          "type": "number",
                          "default": "`2`",
                          "desc": "Custom generator (DH)."
                        },
                        {
                          "textRaw": "`groupName` {string} Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`.",
                          "name": "groupName",
                          "type": "string",
                          "desc": "Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`."
                        },
                        {
                          "textRaw": "`paramEncoding` {string} Must be `'named'` or `'explicit'` (EC). **Default:** `'named'`.",
                          "name": "paramEncoding",
                          "type": "string",
                          "default": "`'named'`",
                          "desc": "Must be `'named'` or `'explicit'` (EC)."
                        },
                        {
                          "textRaw": "`publicKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "publicKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        },
                        {
                          "textRaw": "`privateKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "privateKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`publicKey` {string|Buffer|KeyObject}",
                        "name": "publicKey",
                        "type": "string|Buffer|KeyObject"
                      },
                      {
                        "textRaw": "`privateKey` {string|Buffer|KeyObject}",
                        "name": "privateKey",
                        "type": "string|Buffer|KeyObject"
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Generates a new asymmetric key pair of the given <code>type</code>. See the\nsupported <a href=\"#asymmetric-key-types\">asymmetric key types</a>.</p>\n<p>If a <code>publicKeyEncoding</code> or <code>privateKeyEncoding</code> was specified, this function\nbehaves as if <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a> had been called on its result. Otherwise,\nthe respective part of the key is returned as a <a href=\"#class-keyobject\"><code>KeyObject</code></a>.</p>\n<p>When encoding public keys, it is recommended to use <code>'spki'</code>. When encoding\nprivate keys, it is recommended to use <code>'pkcs8'</code> with a strong passphrase,\nand to keep the passphrase confidential.</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPairSync,\n} = await import('node:crypto');\n\nconst {\n  publicKey,\n  privateKey,\n} = generateKeyPairSync('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPairSync,\n} = require('node:crypto');\n\nconst {\n  publicKey,\n  privateKey,\n} = generateKeyPairSync('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n});\n</code></pre>\n<p>The return value <code>{ publicKey, privateKey }</code> represents the generated key pair.\nWhen PEM encoding was selected, the respective key will be a string, otherwise\nit will be a buffer containing the data encoded as DER.</p>"
            },
            {
              "textRaw": "`crypto.generateKeySync(type, options)`",
              "name": "generateKeySync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`length` {number} The bit length of the key to generate.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`.",
                          "name": "length",
                          "type": "number",
                          "desc": "The bit length of the key to generate.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Synchronously generates a new random secret key of the given <code>length</code>. The\n<code>type</code> will determine which validations will be performed on the <code>length</code>.</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeySync,\n} = await import('node:crypto');\n\nconst key = generateKeySync('hmac', { length: 512 });\nconsole.log(key.export().toString('hex'));  // e89..........41e\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeySync,\n} = require('node:crypto');\n\nconst key = generateKeySync('hmac', { length: 512 });\nconsole.log(key.export().toString('hex'));  // e89..........41e\n</code></pre>\n<p>The size of a generated HMAC key should not exceed the block size of the\nunderlying hash function. See <a href=\"#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`crypto.generatePrime(size[, options], callback)`",
              "name": "generatePrime",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {number} The size (in bits) of the prime to generate.",
                      "name": "size",
                      "type": "number",
                      "desc": "The size (in bits) of the prime to generate."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`add` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "add",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`rem` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "rem",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`safe` {boolean} **Default:** `false`.",
                          "name": "safe",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`bigint` {boolean} When `true`, the generated prime is returned as a `bigint`.",
                          "name": "bigint",
                          "type": "boolean",
                          "desc": "When `true`, the generated prime is returned as a `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`prime` {ArrayBuffer|bigint}",
                          "name": "prime",
                          "type": "ArrayBuffer|bigint"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Generates a pseudorandom prime of <code>size</code> bits.</p>\n<p>If <code>options.safe</code> is <code>true</code>, the prime will be a safe prime -- that is,\n<code>(prime - 1) / 2</code> will also be a prime.</p>\n<p>The <code>options.add</code> and <code>options.rem</code> parameters can be used to enforce additional\nrequirements, e.g., for Diffie-Hellman:</p>\n<ul>\n<li>If <code>options.add</code> and <code>options.rem</code> are both set, the prime will satisfy the\ncondition that <code>prime % add = rem</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is not <code>true</code>, the prime will\nsatisfy the condition that <code>prime % add = 1</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is set to <code>true</code>, the prime\nwill instead satisfy the condition that <code>prime % add = 3</code>. This is necessary\nbecause <code>prime % add = 1</code> for <code>options.add > 2</code> would contradict the condition\nenforced by <code>options.safe</code>.</li>\n<li><code>options.rem</code> is ignored if <code>options.add</code> is not given.</li>\n</ul>\n<p>Both <code>options.add</code> and <code>options.rem</code> must be encoded as big-endian sequences\nif given as an <code>ArrayBuffer</code>, <code>SharedArrayBuffer</code>, <code>TypedArray</code>, <code>Buffer</code>, or\n<code>DataView</code>.</p>\n<p>By default, the prime is encoded as a big-endian sequence of octets\nin an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>. If the <code>bigint</code> option is <code>true</code>, then a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a>\nis provided.</p>\n<p>The <code>size</code> of the prime will have a direct impact on how long it takes to\ngenerate the prime. The larger the size, the longer it will take. Because\nwe use OpenSSL's <code>BN_generate_prime_ex</code> function, which provides only\nminimal control over our ability to interrupt the generation process,\nit is not recommended to generate overly large primes, as doing so may make\nthe process unresponsive.</p>"
            },
            {
              "textRaw": "`crypto.generatePrimeSync(size[, options])`",
              "name": "generatePrimeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {number} The size (in bits) of the prime to generate.",
                      "name": "size",
                      "type": "number",
                      "desc": "The size (in bits) of the prime to generate."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`add` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "add",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`rem` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "rem",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`safe` {boolean} **Default:** `false`.",
                          "name": "safe",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`bigint` {boolean} When `true`, the generated prime is returned as a `bigint`.",
                          "name": "bigint",
                          "type": "boolean",
                          "desc": "When `true`, the generated prime is returned as a `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ArrayBuffer|bigint}",
                    "name": "return",
                    "type": "ArrayBuffer|bigint"
                  }
                }
              ],
              "desc": "<p>Generates a pseudorandom prime of <code>size</code> bits.</p>\n<p>If <code>options.safe</code> is <code>true</code>, the prime will be a safe prime -- that is,\n<code>(prime - 1) / 2</code> will also be a prime.</p>\n<p>The <code>options.add</code> and <code>options.rem</code> parameters can be used to enforce additional\nrequirements, e.g., for Diffie-Hellman:</p>\n<ul>\n<li>If <code>options.add</code> and <code>options.rem</code> are both set, the prime will satisfy the\ncondition that <code>prime % add = rem</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is not <code>true</code>, the prime will\nsatisfy the condition that <code>prime % add = 1</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is set to <code>true</code>, the prime\nwill instead satisfy the condition that <code>prime % add = 3</code>. This is necessary\nbecause <code>prime % add = 1</code> for <code>options.add > 2</code> would contradict the condition\nenforced by <code>options.safe</code>.</li>\n<li><code>options.rem</code> is ignored if <code>options.add</code> is not given.</li>\n</ul>\n<p>Both <code>options.add</code> and <code>options.rem</code> must be encoded as big-endian sequences\nif given as an <code>ArrayBuffer</code>, <code>SharedArrayBuffer</code>, <code>TypedArray</code>, <code>Buffer</code>, or\n<code>DataView</code>.</p>\n<p>By default, the prime is encoded as a big-endian sequence of octets\nin an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>. If the <code>bigint</code> option is <code>true</code>, then a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a>\nis provided.</p>\n<p>The <code>size</code> of the prime will have a direct impact on how long it takes to\ngenerate the prime. The larger the size, the longer it will take. Because\nwe use OpenSSL's <code>BN_generate_prime_ex</code> function, which provides only\nminimal control over our ability to interrupt the generation process,\nit is not recommended to generate overly large primes, as doing so may make\nthe process unresponsive.</p>"
            },
            {
              "textRaw": "`crypto.getCipherInfo(nameOrNid[, options])`",
              "name": "getCipherInfo",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`nameOrNid` {string|number} The name or nid of the cipher to query.",
                      "name": "nameOrNid",
                      "type": "string|number",
                      "desc": "The name or nid of the cipher to query."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`keyLength` {number} A test key length.",
                          "name": "keyLength",
                          "type": "number",
                          "desc": "A test key length."
                        },
                        {
                          "textRaw": "`ivLength` {number} A test IV length.",
                          "name": "ivLength",
                          "type": "number",
                          "desc": "A test IV length."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`name` {string} The name of the cipher",
                        "name": "name",
                        "type": "string",
                        "desc": "The name of the cipher"
                      },
                      {
                        "textRaw": "`nid` {number} The nid of the cipher",
                        "name": "nid",
                        "type": "number",
                        "desc": "The nid of the cipher"
                      },
                      {
                        "textRaw": "`blockSize` {number} The block size of the cipher in bytes. This property is omitted when `mode` is `'stream'`.",
                        "name": "blockSize",
                        "type": "number",
                        "desc": "The block size of the cipher in bytes. This property is omitted when `mode` is `'stream'`."
                      },
                      {
                        "textRaw": "`ivLength` {number} The expected or default initialization vector length in bytes. This property is omitted if the cipher does not use an initialization vector.",
                        "name": "ivLength",
                        "type": "number",
                        "desc": "The expected or default initialization vector length in bytes. This property is omitted if the cipher does not use an initialization vector."
                      },
                      {
                        "textRaw": "`keyLength` {number} The expected or default key length in bytes.",
                        "name": "keyLength",
                        "type": "number",
                        "desc": "The expected or default key length in bytes."
                      },
                      {
                        "textRaw": "`mode` {string} The cipher mode. One of `'cbc'`, `'ccm'`, `'cfb'`, `'ctr'`, `'ecb'`, `'gcm'`, `'ocb'`, `'ofb'`, `'stream'`, `'wrap'`, `'xts'`.",
                        "name": "mode",
                        "type": "string",
                        "desc": "The cipher mode. One of `'cbc'`, `'ccm'`, `'cfb'`, `'ctr'`, `'ecb'`, `'gcm'`, `'ocb'`, `'ofb'`, `'stream'`, `'wrap'`, `'xts'`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns information about a given cipher.</p>\n<p>Some ciphers accept variable length keys and initialization vectors. By default,\nthe <code>crypto.getCipherInfo()</code> method will return the default values for these\nciphers. To test if a given key length or iv length is acceptable for given\ncipher, use the <code>keyLength</code> and <code>ivLength</code> options. If the given values are\nunacceptable, <code>undefined</code> will be returned.</p>"
            },
            {
              "textRaw": "`crypto.getCiphers()`",
              "name": "getCiphers",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]} An array with the names of the supported cipher algorithms.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "An array with the names of the supported cipher algorithms."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const {\n  getCiphers,\n} = await import('node:crypto');\n\nconsole.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getCiphers,\n} = require('node:crypto');\n\nconsole.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getCurves()`",
              "name": "getCurves",
              "type": "method",
              "meta": {
                "added": [
                  "v2.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]} An array with the names of the supported elliptic curves.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "An array with the names of the supported elliptic curves."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const {\n  getCurves,\n} = await import('node:crypto');\n\nconsole.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getCurves,\n} = require('node:crypto');\n\nconsole.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getDiffieHellman(groupName)`",
              "name": "getDiffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`groupName` {string}",
                      "name": "groupName",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellmanGroup}",
                    "name": "return",
                    "type": "DiffieHellmanGroup"
                  }
                }
              ],
              "desc": "<p>Creates a predefined <code>DiffieHellmanGroup</code> key exchange object. The\nsupported groups are listed in the documentation for <a href=\"#class-diffiehellmangroup\"><code>DiffieHellmanGroup</code></a>.</p>\n<p>The returned object mimics the interface of objects created by\n<a href=\"#cryptocreatediffiehellmanprime-primeencoding-generator-generatorencoding\"><code>crypto.createDiffieHellman()</code></a>, but will not allow changing\nthe keys (with <a href=\"#diffiehellmansetpublickeypublickey-encoding\"><code>diffieHellman.setPublicKey()</code></a>, for example). The\nadvantage of using this method is that the parties do not have to\ngenerate nor exchange a group modulus beforehand, saving both processor\nand communication time.</p>\n<p>Example (obtaining a shared secret):</p>\n<pre><code class=\"language-mjs\">const {\n  getDiffieHellman,\n} = await import('node:crypto');\nconst alice = getDiffieHellman('modp14');\nconst bob = getDiffieHellman('modp14');\n\nalice.generateKeys();\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n/* aliceSecret and bobSecret should be the same */\nconsole.log(aliceSecret === bobSecret);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getDiffieHellman,\n} = require('node:crypto');\n\nconst alice = getDiffieHellman('modp14');\nconst bob = getDiffieHellman('modp14');\n\nalice.generateKeys();\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n/* aliceSecret and bobSecret should be the same */\nconsole.log(aliceSecret === bobSecret);\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getFips()`",
              "name": "getFips",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}.",
                    "name": "return",
                    "type": "number",
                    "desc": "`1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}."
                  }
                }
              ]
            },
            {
              "textRaw": "`crypto.getHashes()`",
              "name": "getHashes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]} An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called \"digest\" algorithms.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called \"digest\" algorithms."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const {\n  getHashes,\n} = await import('node:crypto');\n\nconsole.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getHashes,\n} = require('node:crypto');\n\nconsole.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getRandomValues(typedArray)`",
              "name": "getRandomValues",
              "type": "method",
              "meta": {
                "added": [
                  "v17.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`typedArray` {Buffer|TypedArray|DataView|ArrayBuffer}",
                      "name": "typedArray",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|TypedArray|DataView|ArrayBuffer} Returns `typedArray`.",
                    "name": "return",
                    "type": "Buffer|TypedArray|DataView|ArrayBuffer",
                    "desc": "Returns `typedArray`."
                  }
                }
              ],
              "desc": "<p>A convenient alias for <a href=\"webcrypto.html#cryptogetrandomvaluestypedarray\"><code>crypto.webcrypto.getRandomValues()</code></a>. This\nimplementation is not compliant with the Web Crypto spec, to write\nweb-compatible code use <a href=\"webcrypto.html#cryptogetrandomvaluestypedarray\"><code>crypto.webcrypto.getRandomValues()</code></a> instead.</p>"
            },
            {
              "textRaw": "`crypto.hash(algorithm, data[, options])`",
              "name": "hash",
              "type": "method",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60994",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": "v24.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58121",
                    "description": "The `outputLength` option was added for XOF hash functions."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|undefined}",
                      "name": "algorithm",
                      "type": "string|undefined"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView} When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead.",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView",
                      "desc": "When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead."
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`outputEncoding` {string} Encoding used to encode the returned digest. **Default:** `'hex'`.",
                          "name": "outputEncoding",
                          "type": "string",
                          "default": "`'hex'`",
                          "desc": "Encoding used to encode the returned digest."
                        },
                        {
                          "textRaw": "`outputLength` {number} For XOF hash functions such as 'shake256', the outputLength option can be used to specify the desired output length in bytes.",
                          "name": "outputLength",
                          "type": "number",
                          "desc": "For XOF hash functions such as 'shake256', the outputLength option can be used to specify the desired output length in bytes."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>A utility for creating one-shot hash digests of data. It can be faster than\nthe object-based <code>crypto.createHash()</code> when hashing a smaller amount of data\n(&#x3C;= 5MB) that's readily available. If the data can be big or if it is streamed,\nit's still recommended to use <code>crypto.createHash()</code> instead.</p>\n<p>The <code>algorithm</code> is dependent on the available algorithms supported by the\nversion of OpenSSL on the platform. Examples are <code>'sha256'</code>, <code>'sha512'</code>, etc.\nOn recent releases of OpenSSL, <code>openssl list -digest-algorithms</code> will\ndisplay the available digest algorithms.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>outputEncoding</code>.</p>\n<p>Example:</p>\n<pre><code class=\"language-cjs\">const crypto = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\n// Hashing a string and return the result as a hex-encoded string.\nconst string = 'Node.js';\n// 10b3493287f831e81a438811a1ffba01f8cec4b7\nconsole.log(crypto.hash('sha1', string));\n\n// Encode a base64-encoded string into a Buffer, hash it and return\n// the result as a buffer.\nconst base64 = 'Tm9kZS5qcw==';\n// &#x3C;Buffer 10 b3 49 32 87 f8 31 e8 1a 43 88 11 a1 ff ba 01 f8 ce c4 b7>\nconsole.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));\n</code></pre>\n<pre><code class=\"language-mjs\">import crypto from 'node:crypto';\nimport { Buffer } from 'node:buffer';\n\n// Hashing a string and return the result as a hex-encoded string.\nconst string = 'Node.js';\n// 10b3493287f831e81a438811a1ffba01f8cec4b7\nconsole.log(crypto.hash('sha1', string));\n\n// Encode a base64-encoded string into a Buffer, hash it and return\n// the result as a buffer.\nconst base64 = 'Tm9kZS5qcw==';\n// &#x3C;Buffer 10 b3 49 32 87 f8 31 e8 1a 43 88 11 a1 ff ba 01 f8 ce c4 b7>\nconsole.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));\n</code></pre>"
            },
            {
              "textRaw": "`crypto.hkdf(digest, ikm, salt, info, keylen, callback)`",
              "name": "hkdf",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44201",
                    "description": "The input keying material can now be zero-length."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`digest` {string} The digest algorithm to use.",
                      "name": "digest",
                      "type": "string",
                      "desc": "The digest algorithm to use."
                    },
                    {
                      "textRaw": "`ikm` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The input keying material. Must be provided but can be zero-length.",
                      "name": "ikm",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "The input keying material. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView} The salt value. Must be provided but can be zero-length.",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "The salt value. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`info` {string|ArrayBuffer|Buffer|TypedArray|DataView} Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.",
                      "name": "info",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes."
                    },
                    {
                      "textRaw": "`keylen` {number} The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes).",
                      "name": "keylen",
                      "type": "number",
                      "desc": "The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes)."
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {ArrayBuffer}",
                          "name": "derivedKey",
                          "type": "ArrayBuffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>HKDF is a simple key derivation function defined in RFC 5869. The given <code>ikm</code>,\n<code>salt</code> and <code>info</code> are used with the <code>digest</code> to derive a key of <code>keylen</code> bytes.</p>\n<p>The supplied <code>callback</code> function is called with two arguments: <code>err</code> and\n<code>derivedKey</code>. If an errors occurs while deriving the key, <code>err</code> will be set;\notherwise <code>err</code> will be <code>null</code>. The successfully generated <code>derivedKey</code> will\nbe passed to the callback as an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>. An error will be thrown if any\nof the input arguments specify invalid values or types.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  hkdf,\n} = await import('node:crypto');\n\nhkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  hkdf,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nhkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.hkdfSync(digest, ikm, salt, info, keylen)`",
              "name": "hkdfSync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44201",
                    "description": "The input keying material can now be zero-length."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`digest` {string} The digest algorithm to use.",
                      "name": "digest",
                      "type": "string",
                      "desc": "The digest algorithm to use."
                    },
                    {
                      "textRaw": "`ikm` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The input keying material. Must be provided but can be zero-length.",
                      "name": "ikm",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "The input keying material. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView} The salt value. Must be provided but can be zero-length.",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "The salt value. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`info` {string|ArrayBuffer|Buffer|TypedArray|DataView} Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.",
                      "name": "info",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes."
                    },
                    {
                      "textRaw": "`keylen` {number} The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes).",
                      "name": "keylen",
                      "type": "number",
                      "desc": "The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes)."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ArrayBuffer}",
                    "name": "return",
                    "type": "ArrayBuffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous HKDF key derivation function as defined in RFC 5869. The\ngiven <code>ikm</code>, <code>salt</code> and <code>info</code> are used with the <code>digest</code> to derive a key of\n<code>keylen</code> bytes.</p>\n<p>The successfully generated <code>derivedKey</code> will be returned as an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>.</p>\n<p>An error will be thrown if any of the input arguments specify invalid values or\ntypes, or if the derived key cannot be generated.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  hkdfSync,\n} = await import('node:crypto');\n\nconst derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);\nconsole.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  hkdfSync,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);\nconsole.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n</code></pre>"
            },
            {
              "textRaw": "`crypto.pbkdf2(password, salt, iterations, keylen, digest, callback)`",
              "name": "pbkdf2",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The password and salt arguments can also be ArrayBuffer instances."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30578",
                    "description": "The `iterations` parameter is now restricted to positive values. Earlier releases treated other values as one."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11305",
                    "description": "The `digest` parameter is always required now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4047",
                    "description": "Calling this function without passing the `digest` parameter is deprecated now and will emit a warning."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default encoding for `password` if it is a string changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`iterations` {number}",
                      "name": "iterations",
                      "type": "number"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`digest` {string}",
                      "name": "digest",
                      "type": "string"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {Buffer}",
                          "name": "derivedKey",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)\nimplementation. A selected HMAC digest algorithm specified by <code>digest</code> is\napplied to derive a key of the requested byte length (<code>keylen</code>) from the\n<code>password</code>, <code>salt</code> and <code>iterations</code>.</p>\n<p>The supplied <code>callback</code> function is called with two arguments: <code>err</code> and\n<code>derivedKey</code>. If an error occurs while deriving the key, <code>err</code> will be set;\notherwise <code>err</code> will be <code>null</code>. By default, the successfully generated\n<code>derivedKey</code> will be passed to the callback as a <a href=\"buffer.html\"><code>Buffer</code></a>. An error will be\nthrown if any of the input arguments specify invalid values or types.</p>\n<p>The <code>iterations</code> argument must be a number set as high as possible. The\nhigher the number of iterations, the more secure the derived key will be,\nbut will take a longer amount of time to complete.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<pre><code class=\"language-mjs\">const {\n  pbkdf2,\n} = await import('node:crypto');\n\npbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  pbkdf2,\n} = require('node:crypto');\n\npbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n</code></pre>\n<p>An array of supported digest functions can be retrieved using\n<a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a>.</p>\n<p>This API uses libuv's threadpool, which can have surprising and\nnegative performance implications for some applications; see the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>"
            },
            {
              "textRaw": "`crypto.pbkdf2Sync(password, salt, iterations, keylen, digest)`",
              "name": "pbkdf2Sync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30578",
                    "description": "The `iterations` parameter is now restricted to positive values. Earlier releases treated other values as one."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4047",
                    "description": "Calling this function without passing the `digest` parameter is deprecated now and will emit a warning."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default encoding for `password` if it is a string changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`iterations` {number}",
                      "name": "iterations",
                      "type": "number"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`digest` {string}",
                      "name": "digest",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)\nimplementation. A selected HMAC digest algorithm specified by <code>digest</code> is\napplied to derive a key of the requested byte length (<code>keylen</code>) from the\n<code>password</code>, <code>salt</code> and <code>iterations</code>.</p>\n<p>If an error occurs an <code>Error</code> will be thrown, otherwise the derived key will be\nreturned as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>The <code>iterations</code> argument must be a number set as high as possible. The\nhigher the number of iterations, the more secure the derived key will be,\nbut will take a longer amount of time to complete.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<pre><code class=\"language-mjs\">const {\n  pbkdf2Sync,\n} = await import('node:crypto');\n\nconst key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');\nconsole.log(key.toString('hex'));  // '3745e48...08d59ae'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  pbkdf2Sync,\n} = require('node:crypto');\n\nconst key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');\nconsole.log(key.toString('hex'));  // '3745e48...08d59ae'\n</code></pre>\n<p>An array of supported digest functions can be retrieved using\n<a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a>.</p>"
            },
            {
              "textRaw": "`crypto.privateDecrypt(privateKey, buffer)`",
              "name": "privateDecrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.6.2",
                      "v20.11.1",
                      "v18.19.1"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/515",
                    "description": "The `RSA_PKCS1_PADDING` padding was disabled unless the OpenSSL build supports implicit rejection."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The oaepLabel can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v12.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29489",
                    "description": "The `oaepLabel` option was added."
                  },
                  {
                    "version": "v12.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28335",
                    "description": "The `oaepHash` option was added."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "privateKey",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`oaepHash` {string} The hash function to use for OAEP padding and MGF1. **Default:** `'sha1'`",
                          "name": "oaepHash",
                          "type": "string",
                          "default": "`'sha1'`",
                          "desc": "The hash function to use for OAEP padding and MGF1."
                        },
                        {
                          "textRaw": "`oaepLabel` {string|ArrayBuffer|Buffer|TypedArray|DataView} The label to use for OAEP padding. If not specified, no label is used.",
                          "name": "oaepLabel",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "The label to use for OAEP padding. If not specified, no label is used."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the decrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the decrypted content."
                  }
                }
              ],
              "desc": "<p>Decrypts <code>buffer</code> with <code>privateKey</code>. <code>buffer</code> was previously encrypted using\nthe corresponding public key, for example using <a href=\"#cryptopublicencryptkey-buffer\"><code>crypto.publicEncrypt()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_OAEP_PADDING</code>.</p>\n<p>Using <code>crypto.constants.RSA_PKCS1_PADDING</code> in <a href=\"#cryptoprivatedecryptprivatekey-buffer\"><code>crypto.privateDecrypt()</code></a>\nrequires OpenSSL to support implicit rejection (<code>rsa_pkcs1_implicit_rejection</code>).\nIf the version of OpenSSL used by Node.js does not support this feature,\nattempting to use <code>RSA_PKCS1_PADDING</code> will fail.</p>"
            },
            {
              "textRaw": "`crypto.privateEncrypt(privateKey, buffer)`",
              "name": "privateEncrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The passphrase can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "privateKey",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey} A PEM encoded private key.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                          "desc": "A PEM encoded private key."
                        },
                        {
                          "textRaw": "`passphrase` {string|ArrayBuffer|Buffer|TypedArray|DataView} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "An optional passphrase for the private key."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer`, `key`, or `passphrase` are strings.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer`, `key`, or `passphrase` are strings."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the encrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the encrypted content."
                  }
                }
              ],
              "desc": "<p>Encrypts <code>buffer</code> with <code>privateKey</code>. The returned data can be decrypted using\nthe corresponding public key, for example using <a href=\"#cryptopublicdecryptkey-buffer\"><code>crypto.publicDecrypt()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_PADDING</code>.</p>"
            },
            {
              "textRaw": "`crypto.publicDecrypt(key, buffer)`",
              "name": "publicDecrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The passphrase can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`passphrase` {string|ArrayBuffer|Buffer|TypedArray|DataView} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "An optional passphrase for the private key."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer`, `key`, or `passphrase` are strings.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer`, `key`, or `passphrase` are strings."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the decrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the decrypted content."
                  }
                }
              ],
              "desc": "<p>Decrypts <code>buffer</code> with <code>key</code>.<code>buffer</code> was previously encrypted using\nthe corresponding private key, for example using <a href=\"#cryptoprivateencryptprivatekey-buffer\"><code>crypto.privateEncrypt()</code></a>.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>key</code> had been passed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_PADDING</code>.</p>\n<p>Because RSA public keys can be derived from private keys, a private key may\nbe passed instead of a public key.</p>"
            },
            {
              "textRaw": "`crypto.publicEncrypt(key, buffer)`",
              "name": "publicEncrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The oaepLabel and passphrase can be ArrayBuffers. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v12.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29489",
                    "description": "The `oaepLabel` option was added."
                  },
                  {
                    "version": "v12.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28335",
                    "description": "The `oaepHash` option was added."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey} A PEM encoded public or private key, {KeyObject}, or {CryptoKey}.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                          "desc": "A PEM encoded public or private key, {KeyObject}, or {CryptoKey}."
                        },
                        {
                          "textRaw": "`oaepHash` {string} The hash function to use for OAEP padding and MGF1. **Default:** `'sha1'`",
                          "name": "oaepHash",
                          "type": "string",
                          "default": "`'sha1'`",
                          "desc": "The hash function to use for OAEP padding and MGF1."
                        },
                        {
                          "textRaw": "`oaepLabel` {string|ArrayBuffer|Buffer|TypedArray|DataView} The label to use for OAEP padding. If not specified, no label is used.",
                          "name": "oaepLabel",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "The label to use for OAEP padding. If not specified, no label is used."
                        },
                        {
                          "textRaw": "`passphrase` {string|ArrayBuffer|Buffer|TypedArray|DataView} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "An optional passphrase for the private key."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer`, `key`, `oaepLabel`, or `passphrase` are strings.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer`, `key`, `oaepLabel`, or `passphrase` are strings."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the encrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the encrypted content."
                  }
                }
              ],
              "desc": "<p>Encrypts the content of <code>buffer</code> with <code>key</code> and returns a new\n<a href=\"buffer.html\"><code>Buffer</code></a> with encrypted content. The returned data can be decrypted using\nthe corresponding private key, for example using <a href=\"#cryptoprivatedecryptprivatekey-buffer\"><code>crypto.privateDecrypt()</code></a>.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>key</code> had been passed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_OAEP_PADDING</code>.</p>\n<p>Because RSA public keys can be derived from private keys, a private key may\nbe passed instead of a public key.</p>"
            },
            {
              "textRaw": "`crypto.randomBytes(size[, callback])`",
              "name": "randomBytes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16454",
                    "description": "Passing `null` as the `callback` argument now throws `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {number} The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.",
                      "name": "size",
                      "type": "number",
                      "desc": "The number of bytes to generate. The `size` must not be larger than `2**31 - 1`."
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`buf` {Buffer}",
                          "name": "buf",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Generates cryptographically strong pseudorandom data. The <code>size</code> argument\nis a number indicating the number of bytes to generate.</p>\n<p>If a <code>callback</code> function is provided, the bytes are generated asynchronously\nand the <code>callback</code> function is invoked with two arguments: <code>err</code> and <code>buf</code>.\nIf an error occurs, <code>err</code> will be an <code>Error</code> object; otherwise it is <code>null</code>. The\n<code>buf</code> argument is a <a href=\"buffer.html\"><code>Buffer</code></a> containing the generated bytes.</p>\n<pre><code class=\"language-mjs\">// Asynchronous\nconst {\n  randomBytes,\n} = await import('node:crypto');\n\nrandomBytes(256, (err, buf) => {\n  if (err) throw err;\n  console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Asynchronous\nconst {\n  randomBytes,\n} = require('node:crypto');\n\nrandomBytes(256, (err, buf) => {\n  if (err) throw err;\n  console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);\n});\n</code></pre>\n<p>If the <code>callback</code> function is not provided, the random bytes are generated\nsynchronously and returned as a <a href=\"buffer.html\"><code>Buffer</code></a>. An error will be thrown if\nthere is a problem generating the bytes.</p>\n<pre><code class=\"language-mjs\">// Synchronous\nconst {\n  randomBytes,\n} = await import('node:crypto');\n\nconst buf = randomBytes(256);\nconsole.log(\n  `${buf.length} bytes of random data: ${buf.toString('hex')}`);\n</code></pre>\n<pre><code class=\"language-cjs\">// Synchronous\nconst {\n  randomBytes,\n} = require('node:crypto');\n\nconst buf = randomBytes(256);\nconsole.log(\n  `${buf.length} bytes of random data: ${buf.toString('hex')}`);\n</code></pre>\n<p>The <code>crypto.randomBytes()</code> method will not complete until there is\nsufficient entropy available.\nThis should normally never take longer than a few milliseconds. The only time\nwhen generating the random bytes may conceivably block for a longer period of\ntime is right after boot, when the whole system is still low on entropy.</p>\n<p>This API uses libuv's threadpool, which can have surprising and\nnegative performance implications for some applications; see the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>\n<p>The asynchronous version of <code>crypto.randomBytes()</code> is carried out in a single\nthreadpool request. To minimize threadpool task length variation, partition\nlarge <code>randomBytes</code> requests when doing so as part of fulfilling a client\nrequest.</p>"
            },
            {
              "textRaw": "`crypto.randomFill(buffer[, offset][, size], callback)`",
              "name": "randomFill",
              "type": "method",
              "meta": {
                "added": [
                  "v7.10.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15231",
                    "description": "The `buffer` argument may be any `TypedArray` or `DataView`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {ArrayBuffer|Buffer|TypedArray|DataView} Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.",
                      "name": "buffer",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`."
                    },
                    {
                      "textRaw": "`offset` {number} **Default:** `0`",
                      "name": "offset",
                      "type": "number",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`size` {number} **Default:** `buffer.length - offset`. The `size` must not be larger than `2**31 - 1`.",
                      "name": "size",
                      "type": "number",
                      "default": "`buffer.length - offset`. The `size` must not be larger than `2**31 - 1`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} `function(err, buf) {}`.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "`function(err, buf) {}`."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is similar to <a href=\"#cryptorandombytessize-callback\"><code>crypto.randomBytes()</code></a> but requires the first\nargument to be a <a href=\"buffer.html\"><code>Buffer</code></a> that will be filled. It also\nrequires that a callback is passed in.</p>\n<p>If the <code>callback</code> function is not provided, an error will be thrown.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFill } = await import('node:crypto');\n\nconst buf = Buffer.alloc(10);\nrandomFill(buf, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\nrandomFill(buf, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\n// The above is equivalent to the following:\nrandomFill(buf, 5, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFill } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(10);\nrandomFill(buf, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\nrandomFill(buf, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\n// The above is equivalent to the following:\nrandomFill(buf, 5, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n</code></pre>\n<p>Any <code>ArrayBuffer</code>, <code>TypedArray</code>, or <code>DataView</code> instance may be passed as\n<code>buffer</code>.</p>\n<p>While this includes instances of <code>Float32Array</code> and <code>Float64Array</code>, this\nfunction should not be used to generate random floating-point numbers. The\nresult may contain <code>+Infinity</code>, <code>-Infinity</code>, and <code>NaN</code>, and even if the array\ncontains finite numbers only, they are not drawn from a uniform random\ndistribution and have no meaningful lower or upper bounds.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFill } = await import('node:crypto');\n\nconst a = new Uint32Array(10);\nrandomFill(a, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst b = new DataView(new ArrayBuffer(10));\nrandomFill(b, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst c = new ArrayBuffer(10);\nrandomFill(c, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf).toString('hex'));\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFill } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst a = new Uint32Array(10);\nrandomFill(a, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst b = new DataView(new ArrayBuffer(10));\nrandomFill(b, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst c = new ArrayBuffer(10);\nrandomFill(c, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf).toString('hex'));\n});\n</code></pre>\n<p>This API uses libuv's threadpool, which can have surprising and\nnegative performance implications for some applications; see the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>\n<p>The asynchronous version of <code>crypto.randomFill()</code> is carried out in a single\nthreadpool request. To minimize threadpool task length variation, partition\nlarge <code>randomFill</code> requests when doing so as part of fulfilling a client\nrequest.</p>"
            },
            {
              "textRaw": "`crypto.randomFillSync(buffer[, offset][, size])`",
              "name": "randomFillSync",
              "type": "method",
              "meta": {
                "added": [
                  "v7.10.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15231",
                    "description": "The `buffer` argument may be any `TypedArray` or `DataView`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {ArrayBuffer|Buffer|TypedArray|DataView} Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.",
                      "name": "buffer",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`."
                    },
                    {
                      "textRaw": "`offset` {number} **Default:** `0`",
                      "name": "offset",
                      "type": "number",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`size` {number} **Default:** `buffer.length - offset`. The `size` must not be larger than `2**31 - 1`.",
                      "name": "size",
                      "type": "number",
                      "default": "`buffer.length - offset`. The `size` must not be larger than `2**31 - 1`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ArrayBuffer|Buffer|TypedArray|DataView} The object passed as `buffer` argument.",
                    "name": "return",
                    "type": "ArrayBuffer|Buffer|TypedArray|DataView",
                    "desc": "The object passed as `buffer` argument."
                  }
                }
              ],
              "desc": "<p>Synchronous version of <a href=\"#cryptorandomfillbuffer-offset-size-callback\"><code>crypto.randomFill()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFillSync } = await import('node:crypto');\n\nconst buf = Buffer.alloc(10);\nconsole.log(randomFillSync(buf).toString('hex'));\n\nrandomFillSync(buf, 5);\nconsole.log(buf.toString('hex'));\n\n// The above is equivalent to the following:\nrandomFillSync(buf, 5, 5);\nconsole.log(buf.toString('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFillSync } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(10);\nconsole.log(randomFillSync(buf).toString('hex'));\n\nrandomFillSync(buf, 5);\nconsole.log(buf.toString('hex'));\n\n// The above is equivalent to the following:\nrandomFillSync(buf, 5, 5);\nconsole.log(buf.toString('hex'));\n</code></pre>\n<p>Any <code>ArrayBuffer</code>, <code>TypedArray</code> or <code>DataView</code> instance may be passed as\n<code>buffer</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFillSync } = await import('node:crypto');\n\nconst a = new Uint32Array(10);\nconsole.log(Buffer.from(randomFillSync(a).buffer,\n                        a.byteOffset, a.byteLength).toString('hex'));\n\nconst b = new DataView(new ArrayBuffer(10));\nconsole.log(Buffer.from(randomFillSync(b).buffer,\n                        b.byteOffset, b.byteLength).toString('hex'));\n\nconst c = new ArrayBuffer(10);\nconsole.log(Buffer.from(randomFillSync(c)).toString('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFillSync } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst a = new Uint32Array(10);\nconsole.log(Buffer.from(randomFillSync(a).buffer,\n                        a.byteOffset, a.byteLength).toString('hex'));\n\nconst b = new DataView(new ArrayBuffer(10));\nconsole.log(Buffer.from(randomFillSync(b).buffer,\n                        b.byteOffset, b.byteLength).toString('hex'));\n\nconst c = new ArrayBuffer(10);\nconsole.log(Buffer.from(randomFillSync(c)).toString('hex'));\n</code></pre>"
            },
            {
              "textRaw": "`crypto.randomInt([min, ]max[, callback])`",
              "name": "randomInt",
              "type": "method",
              "meta": {
                "added": [
                  "v14.10.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`min` {integer} Start of random range (inclusive). **Default:** `0`.",
                      "name": "min",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Start of random range (inclusive).",
                      "optional": true
                    },
                    {
                      "textRaw": "`max` {integer} End of random range (exclusive).",
                      "name": "max",
                      "type": "integer",
                      "desc": "End of random range (exclusive)."
                    },
                    {
                      "textRaw": "`callback` {Function} `function(err, n) {}`.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "`function(err, n) {}`.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Return a random integer <code>n</code> such that <code>min &#x3C;= n &#x3C; max</code>.  This\nimplementation avoids <a href=\"https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias\">modulo bias</a>.</p>\n<p>The range (<code>max - min</code>) must be less than 2<sup>48</sup>. <code>min</code> and <code>max</code> must\nbe <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger\">safe integers</a>.</p>\n<p>If the <code>callback</code> function is not provided, the random integer is\ngenerated synchronously.</p>\n<pre><code class=\"language-mjs\">// Asynchronous\nconst {\n  randomInt,\n} = await import('node:crypto');\n\nrandomInt(3, (err, n) => {\n  if (err) throw err;\n  console.log(`Random number chosen from (0, 1, 2): ${n}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Asynchronous\nconst {\n  randomInt,\n} = require('node:crypto');\n\nrandomInt(3, (err, n) => {\n  if (err) throw err;\n  console.log(`Random number chosen from (0, 1, 2): ${n}`);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">// Synchronous\nconst {\n  randomInt,\n} = await import('node:crypto');\n\nconst n = randomInt(3);\nconsole.log(`Random number chosen from (0, 1, 2): ${n}`);\n</code></pre>\n<pre><code class=\"language-cjs\">// Synchronous\nconst {\n  randomInt,\n} = require('node:crypto');\n\nconst n = randomInt(3);\nconsole.log(`Random number chosen from (0, 1, 2): ${n}`);\n</code></pre>\n<pre><code class=\"language-mjs\">// With `min` argument\nconst {\n  randomInt,\n} = await import('node:crypto');\n\nconst n = randomInt(1, 7);\nconsole.log(`The dice rolled: ${n}`);\n</code></pre>\n<pre><code class=\"language-cjs\">// With `min` argument\nconst {\n  randomInt,\n} = require('node:crypto');\n\nconst n = randomInt(1, 7);\nconsole.log(`The dice rolled: ${n}`);\n</code></pre>"
            },
            {
              "textRaw": "`crypto.randomUUID([options])`",
              "name": "randomUUID",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`disableEntropyCache` {boolean} By default, to improve performance, Node.js generates and caches enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, set `disableEntropyCache` to `true`. **Default:** `false`.",
                          "name": "disableEntropyCache",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "By default, to improve performance, Node.js generates and caches enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, set `disableEntropyCache` to `true`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Generates a random <a href=\"https://www.rfc-editor.org/rfc/rfc4122.txt\">RFC 4122</a> version 4 UUID. The UUID is generated using a\ncryptographic pseudorandom number generator.</p>"
            },
            {
              "textRaw": "`crypto.scrypt(password, salt, keylen[, options], callback)`",
              "name": "scrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The password and salt arguments can also be ArrayBuffer instances."
                  },
                  {
                    "version": [
                      "v12.8.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/28799",
                    "description": "The `maxmem` value can now be any safe integer."
                  },
                  {
                    "version": "v10.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21525",
                    "description": "The `cost`, `blockSize` and `parallelization` option names have been added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cost` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.",
                          "name": "cost",
                          "type": "number",
                          "default": "`16384`",
                          "desc": "CPU/memory cost parameter. Must be a power of two greater than one."
                        },
                        {
                          "textRaw": "`blockSize` {number} Block size parameter. **Default:** `8`.",
                          "name": "blockSize",
                          "type": "number",
                          "default": "`8`",
                          "desc": "Block size parameter."
                        },
                        {
                          "textRaw": "`parallelization` {number} Parallelization parameter. **Default:** `1`.",
                          "name": "parallelization",
                          "type": "number",
                          "default": "`1`",
                          "desc": "Parallelization parameter."
                        },
                        {
                          "textRaw": "`N` {number} Alias for `cost`. Only one of both may be specified.",
                          "name": "N",
                          "type": "number",
                          "desc": "Alias for `cost`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`r` {number} Alias for `blockSize`. Only one of both may be specified.",
                          "name": "r",
                          "type": "number",
                          "desc": "Alias for `blockSize`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`p` {number} Alias for `parallelization`. Only one of both may be specified.",
                          "name": "p",
                          "type": "number",
                          "desc": "Alias for `parallelization`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`maxmem` {number} Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`.",
                          "name": "maxmem",
                          "type": "number",
                          "default": "`32 * 1024 * 1024`",
                          "desc": "Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {Buffer}",
                          "name": "derivedKey",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Provides an asynchronous <a href=\"https://en.wikipedia.org/wiki/Scrypt\">scrypt</a> implementation. Scrypt is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>The <code>callback</code> function is called with two arguments: <code>err</code> and <code>derivedKey</code>.\n<code>err</code> is an exception object when key derivation fails, otherwise <code>err</code> is\n<code>null</code>. <code>derivedKey</code> is passed to the callback as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const {\n  scrypt,\n} = await import('node:crypto');\n\n// Using the factory defaults.\nscrypt('password', 'salt', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n// Using a custom N parameter. Must be a power of two.\nscrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...aa39b34'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scrypt,\n} = require('node:crypto');\n\n// Using the factory defaults.\nscrypt('password', 'salt', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n// Using a custom N parameter. Must be a power of two.\nscrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...aa39b34'\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.scryptSync(password, salt, keylen[, options])`",
              "name": "scryptSync",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v12.8.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/28799",
                    "description": "The `maxmem` value can now be any safe integer."
                  },
                  {
                    "version": "v10.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21525",
                    "description": "The `cost`, `blockSize` and `parallelization` option names have been added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cost` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.",
                          "name": "cost",
                          "type": "number",
                          "default": "`16384`",
                          "desc": "CPU/memory cost parameter. Must be a power of two greater than one."
                        },
                        {
                          "textRaw": "`blockSize` {number} Block size parameter. **Default:** `8`.",
                          "name": "blockSize",
                          "type": "number",
                          "default": "`8`",
                          "desc": "Block size parameter."
                        },
                        {
                          "textRaw": "`parallelization` {number} Parallelization parameter. **Default:** `1`.",
                          "name": "parallelization",
                          "type": "number",
                          "default": "`1`",
                          "desc": "Parallelization parameter."
                        },
                        {
                          "textRaw": "`N` {number} Alias for `cost`. Only one of both may be specified.",
                          "name": "N",
                          "type": "number",
                          "desc": "Alias for `cost`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`r` {number} Alias for `blockSize`. Only one of both may be specified.",
                          "name": "r",
                          "type": "number",
                          "desc": "Alias for `blockSize`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`p` {number} Alias for `parallelization`. Only one of both may be specified.",
                          "name": "p",
                          "type": "number",
                          "desc": "Alias for `parallelization`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`maxmem` {number} Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`.",
                          "name": "maxmem",
                          "type": "number",
                          "default": "`32 * 1024 * 1024`",
                          "desc": "Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous <a href=\"https://en.wikipedia.org/wiki/Scrypt\">scrypt</a> implementation. Scrypt is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>An exception is thrown when key derivation fails, otherwise the derived key is\nreturned as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const {\n  scryptSync,\n} = await import('node:crypto');\n// Using the factory defaults.\n\nconst key1 = scryptSync('password', 'salt', 64);\nconsole.log(key1.toString('hex'));  // '3745e48...08d59ae'\n// Using a custom N parameter. Must be a power of two.\nconst key2 = scryptSync('password', 'salt', 64, { N: 1024 });\nconsole.log(key2.toString('hex'));  // '3745e48...aa39b34'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scryptSync,\n} = require('node:crypto');\n// Using the factory defaults.\n\nconst key1 = scryptSync('password', 'salt', 64);\nconsole.log(key1.toString('hex'));  // '3745e48...08d59ae'\n// Using a custom N parameter. Must be a power of two.\nconst key2 = scryptSync('password', 'salt', 64, { N: 1024 });\nconsole.log(key2.toString('hex'));  // '3745e48...aa39b34'\n</code></pre>"
            },
            {
              "textRaw": "`crypto.secureHeapUsed()`",
              "name": "secureHeapUsed",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`total` {number} The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag.",
                        "name": "total",
                        "type": "number",
                        "desc": "The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag."
                      },
                      {
                        "textRaw": "`min` {number} The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag.",
                        "name": "min",
                        "type": "number",
                        "desc": "The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag."
                      },
                      {
                        "textRaw": "`used` {number} The total number of bytes currently allocated from the secure heap.",
                        "name": "used",
                        "type": "number",
                        "desc": "The total number of bytes currently allocated from the secure heap."
                      },
                      {
                        "textRaw": "`utilization` {number} The calculated ratio of `used` to `total` allocated bytes.",
                        "name": "utilization",
                        "type": "number",
                        "desc": "The calculated ratio of `used` to `total` allocated bytes."
                      }
                    ]
                  }
                }
              ]
            },
            {
              "textRaw": "`crypto.setEngine(engine[, flags])`",
              "name": "setEngine",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.11"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53329",
                    "description": "Custom engine support in OpenSSL 3 is deprecated."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`engine` {string}",
                      "name": "engine",
                      "type": "string"
                    },
                    {
                      "textRaw": "`flags` {crypto.constants} **Default:** `crypto.constants.ENGINE_METHOD_ALL`",
                      "name": "flags",
                      "type": "crypto.constants",
                      "default": "`crypto.constants.ENGINE_METHOD_ALL`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Load and set the <code>engine</code> for some or all OpenSSL functions (selected by flags).\nSupport for custom engines in OpenSSL is deprecated from OpenSSL 3.</p>\n<p><code>engine</code> could be either an id or a path to the engine's shared library.</p>\n<p>The optional <code>flags</code> argument uses <code>ENGINE_METHOD_ALL</code> by default. The <code>flags</code>\nis a bit field taking one of or a mix of the following flags (defined in\n<code>crypto.constants</code>):</p>\n<ul>\n<li><code>crypto.constants.ENGINE_METHOD_RSA</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_DSA</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_DH</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_RAND</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_EC</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_CIPHERS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_DIGESTS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_PKEY_METHS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_ALL</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_NONE</code></li>\n</ul>"
            },
            {
              "textRaw": "`crypto.setFips(bool)`",
              "name": "setFips",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`bool` {boolean} `true` to enable FIPS mode.",
                      "name": "bool",
                      "type": "boolean",
                      "desc": "`true` to enable FIPS mode."
                    }
                  ]
                }
              ],
              "desc": "<p>Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build.\nThrows an error if FIPS mode is not available.</p>"
            },
            {
              "textRaw": "`crypto.sign(algorithm, data, key[, callback])`",
              "name": "sign",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62474",
                    "description": "Add support for Ed25519 context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59570",
                    "description": "Add support for ML-DSA, Ed448, and SLH-DSA context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA signing."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA signing."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37500",
                    "description": "Optional callback argument added."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|null|undefined}",
                      "name": "algorithm",
                      "type": "string|null|undefined"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`signature` {Buffer}",
                          "name": "signature",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Calculates and returns the signature for <code>data</code> using the given private key and\nalgorithm. If <code>algorithm</code> is <code>null</code> or <code>undefined</code>, then the algorithm is\ndependent upon the key type.</p>\n<p><code>algorithm</code> is required to be <code>null</code> or <code>undefined</code> for Ed25519, Ed448, and\nML-DSA.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an object, the following\nadditional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the generated signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to sign the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN</code> (default) sets it to the\nmaximum permissible value.</p>\n</li>\n<li>\n<p><code>context</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> For Ed25519<sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>\n(using Ed25519ctx from <a href=\"https://www.rfc-editor.org/rfc/rfc8032.txt\">RFC 8032</a>), Ed448, ML-DSA, and SLH-DSA,\nthis option specifies the optional context to differentiate signatures\ngenerated for different purposes with the same key.</p>\n</li>\n</ul>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.timingSafeEqual(a, b)`",
              "name": "timingSafeEqual",
              "type": "method",
              "meta": {
                "added": [
                  "v6.6.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The a and b arguments can also be ArrayBuffer."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`a` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "a",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`b` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "b",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>This function compares the underlying bytes that represent the given\n<code>ArrayBuffer</code>, <code>TypedArray</code>, or <code>DataView</code> instances using a constant-time\nalgorithm.</p>\n<p>This function does not leak timing information that\nwould allow an attacker to guess one of the values. This is suitable for\ncomparing HMAC digests or secret values like authentication cookies or\n<a href=\"https://www.w3.org/TR/capability-urls/\">capability urls</a>.</p>\n<p><code>a</code> and <code>b</code> must both be <code>Buffer</code>s, <code>TypedArray</code>s, or <code>DataView</code>s, and they\nmust have the same byte length. An error is thrown if <code>a</code> and <code>b</code> have\ndifferent byte lengths.</p>\n<p>If at least one of <code>a</code> and <code>b</code> is a <code>TypedArray</code> with more than one byte per\nentry, such as <code>Uint16Array</code>, the result will be computed using the platform\nbyte order.</p>\n<p><strong class=\"critical\">When both of the inputs are <code>Float32Array</code>s or\n<code>Float64Array</code>s, this function might return unexpected results due to IEEE 754\nencoding of floating-point numbers. In particular, neither <code>x === y</code> nor\n<code>Object.is(x, y)</code> implies that the byte representations of two floating-point\nnumbers <code>x</code> and <code>y</code> are equal.</strong></p>\n<p>Use of <code>crypto.timingSafeEqual</code> does not guarantee that the <em>surrounding</em> code\nis timing-safe. Care should be taken to ensure that the surrounding code does\nnot introduce timing vulnerabilities.</p>"
            },
            {
              "textRaw": "`crypto.verify(algorithm, data, key, signature[, callback])`",
              "name": "verify",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62474",
                    "description": "Add support for Ed25519 context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59570",
                    "description": "Add support for ML-DSA, Ed448, and SLH-DSA context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA signature verification."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA signature verification."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37500",
                    "description": "Optional callback argument added."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The data, key, and signature arguments can also be ArrayBuffer."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|null|undefined}",
                      "name": "algorithm",
                      "type": "string|null|undefined"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`signature` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "signature",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`result` {boolean}",
                          "name": "result",
                          "type": "boolean"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` or `false` depending on the validity of the signature for the data and public key if the `callback` function is not provided.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` or `false` depending on the validity of the signature for the data and public key if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Verifies the given signature for <code>data</code> using the given key and algorithm. If\n<code>algorithm</code> is <code>null</code> or <code>undefined</code>, then the algorithm is dependent upon the\nkey type.</p>\n<p><code>algorithm</code> is required to be <code>null</code> or <code>undefined</code> for Ed25519, Ed448, and\nML-DSA.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an object, the following\nadditional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to sign the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN</code> (default) sets it to the\nmaximum permissible value.</p>\n</li>\n<li>\n<p><code>context</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> For Ed25519<sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>\n(using Ed25519ctx from <a href=\"https://www.rfc-editor.org/rfc/rfc8032.txt\">RFC 8032</a>), Ed448, ML-DSA, and SLH-DSA,\nthis option specifies the optional context to differentiate signatures\ngenerated for different purposes with the same key.</p>\n</li>\n</ul>\n<p>The <code>signature</code> argument is the previously calculated signature for the <code>data</code>.</p>\n<p>Because public keys can be derived from private keys, a private key or a public\nkey may be passed for <code>key</code>.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "constants",
              "type": "Object",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "desc": "<p>An object containing commonly used constants for crypto and security related\noperations. The specific constants currently defined are described in\n<a href=\"#crypto-constants\">Crypto constants</a>.</p>"
            },
            {
              "textRaw": "`crypto.fips`",
              "name": "fips",
              "type": "property",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": [],
                "deprecated": [
                  "v10.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "desc": "<p>Property for checking and controlling whether a FIPS compliant crypto provider\nis currently in use. Setting to true requires a FIPS build of Node.js.</p>\n<p>This property is deprecated. Please use <code>crypto.setFips()</code> and\n<code>crypto.getFips()</code> instead.</p>"
            },
            {
              "textRaw": "Type: {SubtleCrypto}",
              "name": "subtle",
              "type": "SubtleCrypto",
              "meta": {
                "added": [
                  "v17.4.0"
                ],
                "changes": []
              },
              "desc": "<p>A convenient alias for <a href=\"webcrypto.html#class-subtlecrypto\"><code>crypto.webcrypto.subtle</code></a>.</p>"
            },
            {
              "textRaw": "`crypto.webcrypto`",
              "name": "webcrypto",
              "type": "property",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Type: <a href=\"webcrypto.html#class-crypto\"><code>&#x3C;Crypto></code></a> An implementation of the Web Crypto API standard.</p>\n<p>See the <a href=\"webcrypto.html\">Web Crypto API documentation</a> for details.</p>"
            }
          ],
          "displayName": "`node:crypto` module methods and properties"
        },
        {
          "textRaw": "Notes",
          "name": "notes",
          "type": "module",
          "modules": [
            {
              "textRaw": "Using strings as inputs to cryptographic APIs",
              "name": "using_strings_as_inputs_to_cryptographic_apis",
              "type": "module",
              "desc": "<p>For historical reasons, many cryptographic APIs provided by Node.js accept\nstrings as inputs where the underlying cryptographic algorithm works on byte\nsequences. These instances include plaintexts, ciphertexts, symmetric keys,\ninitialization vectors, passphrases, salts, authentication tags,\nand additional authenticated data.</p>\n<p>When passing strings to cryptographic APIs, consider the following factors.</p>\n<ul>\n<li>\n<p>Not all byte sequences are valid UTF-8 strings. Therefore, when a byte\nsequence of length <code>n</code> is derived from a string, its entropy is generally\nlower than the entropy of a random or pseudorandom <code>n</code> byte sequence.\nFor example, no UTF-8 string will result in the byte sequence <code>c0 af</code>. Secret\nkeys should almost exclusively be random or pseudorandom byte sequences.</p>\n</li>\n<li>\n<p>Similarly, when converting random or pseudorandom byte sequences to UTF-8\nstrings, subsequences that do not represent valid code points may be replaced\nby the Unicode replacement character (<code>U+FFFD</code>). The byte representation of\nthe resulting Unicode string may, therefore, not be equal to the byte sequence\nthat the string was created from.</p>\n<pre><code class=\"language-js\">const original = [0xc0, 0xaf];\nconst bytesAsString = Buffer.from(original).toString('utf8');\nconst stringAsBytes = Buffer.from(bytesAsString, 'utf8');\nconsole.log(stringAsBytes);\n// Prints '&#x3C;Buffer ef bf bd ef bf bd>'.\n</code></pre>\n<p>The outputs of ciphers, hash functions, signature algorithms, and key\nderivation functions are pseudorandom byte sequences and should not be\nused as Unicode strings.</p>\n</li>\n<li>\n<p>When strings are obtained from user input, some Unicode characters can be\nrepresented in multiple equivalent ways that result in different byte\nsequences. For example, when passing a user passphrase to a key derivation\nfunction, such as PBKDF2 or scrypt, the result of the key derivation function\ndepends on whether the string uses composed or decomposed characters. Node.js\ndoes not normalize character representations. Developers should consider using\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize\"><code>String.prototype.normalize()</code></a> on user inputs before passing them to\ncryptographic APIs.</p>\n</li>\n</ul>",
              "displayName": "Using strings as inputs to cryptographic APIs"
            },
            {
              "textRaw": "Legacy streams API (prior to Node.js 0.10)",
              "name": "legacy_streams_api_(prior_to_node.js_0.10)",
              "type": "module",
              "desc": "<p>The Crypto module was added to Node.js before there was the concept of a\nunified Stream API, and before there were <a href=\"buffer.html\"><code>Buffer</code></a> objects for handling\nbinary data. As such, many <code>crypto</code> classes have methods not\ntypically found on other Node.js classes that implement the <a href=\"stream.html\">streams</a>\nAPI (e.g. <code>update()</code>, <code>final()</code>, or <code>digest()</code>). Also, many methods accepted\nand returned <code>'latin1'</code> encoded strings by default rather than <code>Buffer</code>s. This\ndefault was changed in Node.js 0.9.3 to use <a href=\"buffer.html\"><code>Buffer</code></a> objects by default\ninstead.</p>",
              "displayName": "Legacy streams API (prior to Node.js 0.10)"
            },
            {
              "textRaw": "Support for weak or compromised algorithms",
              "name": "support_for_weak_or_compromised_algorithms",
              "type": "module",
              "desc": "<p>The <code>node:crypto</code> module still supports some algorithms which are already\ncompromised and are not recommended for use. The API also allows\nthe use of ciphers and hashes with a small key size that are too weak for safe\nuse.</p>\n<p>Users should take full responsibility for selecting the crypto\nalgorithm and key size according to their security requirements.</p>\n<p>Based on the recommendations of <a href=\"https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf\">NIST SP 800-131A</a>:</p>\n<ul>\n<li>MD5 and SHA-1 are no longer acceptable where collision resistance is\nrequired such as digital signatures.</li>\n<li>The key used with RSA, DSA, and DH algorithms is recommended to have\nat least 2048 bits and that of the curve of ECDSA and ECDH at least\n224 bits, to be safe to use for several years.</li>\n<li>The DH groups of <code>modp1</code>, <code>modp2</code> and <code>modp5</code> have a key size\nsmaller than 2048 bits and are not recommended.</li>\n</ul>\n<p>See the reference for other recommendations and details.</p>\n<p>Some algorithms that have known weaknesses and are of little relevance in\npractice are only available through the <a href=\"cli.html#--openssl-legacy-provider\">legacy provider</a>, which is not\nenabled by default.</p>",
              "displayName": "Support for weak or compromised algorithms"
            },
            {
              "textRaw": "CCM mode",
              "name": "ccm_mode",
              "type": "module",
              "desc": "<p>CCM is one of the supported <a href=\"https://en.wikipedia.org/wiki/Authenticated_encryption\">AEAD algorithms</a>. Applications which use this\nmode must adhere to certain restrictions when using the cipher API:</p>\n<ul>\n<li>The authentication tag length must be specified during cipher creation by\nsetting the <code>authTagLength</code> option and must be one of 4, 6, 8, 10, 12, 14 or\n16 bytes.</li>\n<li>The length of the initialization vector (nonce) <code>N</code> must be between 7 and 13\nbytes (<code>7 ≤ N ≤ 13</code>).</li>\n<li>The length of the plaintext is limited to <code>2 ** (8 * (15 - N))</code> bytes.</li>\n<li>When decrypting, the authentication tag must be set via <code>setAuthTag()</code> before\ncalling <code>update()</code>.\nOtherwise, decryption will fail and <code>final()</code> will throw an error in\ncompliance with section 2.6 of <a href=\"https://www.rfc-editor.org/rfc/rfc3610.txt\">RFC 3610</a>.</li>\n<li>Using stream methods such as <code>write(data)</code>, <code>end(data)</code> or <code>pipe()</code> in CCM\nmode might fail as CCM cannot handle more than one chunk of data per instance.</li>\n<li>When passing additional authenticated data (AAD), the length of the actual\nmessage in bytes must be passed to <code>setAAD()</code> via the <code>plaintextLength</code>\noption.\nMany crypto libraries include the authentication tag in the ciphertext,\nwhich means that they produce ciphertexts of the length\n<code>plaintextLength + authTagLength</code>. Node.js does not include the authentication\ntag, so the ciphertext length is always <code>plaintextLength</code>.\nThis is not necessary if no AAD is used.</li>\n<li>As CCM processes the whole message at once, <code>update()</code> must be called exactly\nonce.</li>\n<li>Even though calling <code>update()</code> is sufficient to encrypt/decrypt the message,\napplications <em>must</em> call <code>final()</code> to compute or verify the\nauthentication tag.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  createCipheriv,\n  createDecipheriv,\n  randomBytes,\n} = await import('node:crypto');\n\nconst key = 'keykeykeykeykeykeykeykey';\nconst nonce = randomBytes(12);\n\nconst aad = Buffer.from('0123456789', 'hex');\n\nconst cipher = createCipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\nconst plaintext = 'Hello world';\ncipher.setAAD(aad, {\n  plaintextLength: Buffer.byteLength(plaintext),\n});\nconst ciphertext = cipher.update(plaintext, 'utf8');\ncipher.final();\nconst tag = cipher.getAuthTag();\n\n// Now transmit { ciphertext, nonce, tag }.\n\nconst decipher = createDecipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\ndecipher.setAuthTag(tag);\ndecipher.setAAD(aad, {\n  plaintextLength: ciphertext.length,\n});\nconst receivedPlaintext = decipher.update(ciphertext, null, 'utf8');\n\ntry {\n  decipher.final();\n} catch (err) {\n  throw new Error('Authentication failed!', { cause: err });\n}\n\nconsole.log(receivedPlaintext);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\nconst {\n  createCipheriv,\n  createDecipheriv,\n  randomBytes,\n} = require('node:crypto');\n\nconst key = 'keykeykeykeykeykeykeykey';\nconst nonce = randomBytes(12);\n\nconst aad = Buffer.from('0123456789', 'hex');\n\nconst cipher = createCipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\nconst plaintext = 'Hello world';\ncipher.setAAD(aad, {\n  plaintextLength: Buffer.byteLength(plaintext),\n});\nconst ciphertext = cipher.update(plaintext, 'utf8');\ncipher.final();\nconst tag = cipher.getAuthTag();\n\n// Now transmit { ciphertext, nonce, tag }.\n\nconst decipher = createDecipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\ndecipher.setAuthTag(tag);\ndecipher.setAAD(aad, {\n  plaintextLength: ciphertext.length,\n});\nconst receivedPlaintext = decipher.update(ciphertext, null, 'utf8');\n\ntry {\n  decipher.final();\n} catch (err) {\n  throw new Error('Authentication failed!', { cause: err });\n}\n\nconsole.log(receivedPlaintext);\n</code></pre>",
              "displayName": "CCM mode"
            },
            {
              "textRaw": "FIPS mode",
              "name": "fips_mode",
              "type": "module",
              "desc": "<p>When using OpenSSL 3, Node.js supports FIPS 140-2 when used with an appropriate\nOpenSSL 3 provider, such as the <a href=\"https://www.openssl.org/docs/man3.0/man7/crypto.html#FIPS-provider\">FIPS provider from OpenSSL 3</a> which can be\ninstalled by following the instructions in <a href=\"https://github.com/openssl/openssl/blob/openssl-3.0/README-FIPS.md\">OpenSSL's FIPS README file</a>.</p>\n<p>For FIPS support in Node.js you will need:</p>\n<ul>\n<li>A correctly installed OpenSSL 3 FIPS provider.</li>\n<li>An OpenSSL 3 <a href=\"https://www.openssl.org/docs/man3.0/man5/fips_config.html\">FIPS module configuration file</a>.</li>\n<li>An OpenSSL 3 configuration file that references the FIPS module\nconfiguration file.</li>\n</ul>\n<p>Node.js will need to be configured with an OpenSSL configuration file that\npoints to the FIPS provider. An example configuration file looks like this:</p>\n<pre><code class=\"language-text\">nodejs_conf = nodejs_init\n\n.include /&#x3C;absolute path>/fipsmodule.cnf\n\n[nodejs_init]\nproviders = provider_sect\n\n[provider_sect]\ndefault = default_sect\n# The fips section name should match the section name inside the\n# included fipsmodule.cnf.\nfips = fips_sect\n\n[default_sect]\nactivate = 1\n</code></pre>\n<p>where <code>fipsmodule.cnf</code> is the FIPS module configuration file generated from the\nFIPS provider installation step:</p>\n<pre><code class=\"language-bash\">openssl fipsinstall\n</code></pre>\n<p>Set the <code>OPENSSL_CONF</code> environment variable to point to\nyour configuration file and <code>OPENSSL_MODULES</code> to the location of the FIPS\nprovider dynamic library. e.g.</p>\n<pre><code class=\"language-bash\">export OPENSSL_CONF=/&#x3C;path to configuration file>/nodejs.cnf\nexport OPENSSL_MODULES=/&#x3C;path to openssl lib>/ossl-modules\n</code></pre>\n<p>FIPS mode can then be enabled in Node.js either by:</p>\n<ul>\n<li>Starting Node.js with <code>--enable-fips</code> or <code>--force-fips</code> command line flags.</li>\n<li>Programmatically calling <code>crypto.setFips(true)</code>.</li>\n</ul>\n<p>Optionally FIPS mode can be enabled in Node.js via the OpenSSL configuration\nfile. e.g.</p>\n<pre><code class=\"language-text\">nodejs_conf = nodejs_init\n\n.include /&#x3C;absolute path>/fipsmodule.cnf\n\n[nodejs_init]\nproviders = provider_sect\nalg_section = algorithm_sect\n\n[provider_sect]\ndefault = default_sect\n# The fips section name should match the section name inside the\n# included fipsmodule.cnf.\nfips = fips_sect\n\n[default_sect]\nactivate = 1\n\n[algorithm_sect]\ndefault_properties = fips=yes\n</code></pre>",
              "displayName": "FIPS mode"
            }
          ],
          "displayName": "Notes"
        },
        {
          "textRaw": "Crypto constants",
          "name": "crypto_constants",
          "type": "module",
          "desc": "<p>The following constants exported by <code>crypto.constants</code> apply to various uses of\nthe <code>node:crypto</code>, <code>node:tls</code>, and <code>node:https</code> modules and are generally\nspecific to OpenSSL.</p>",
          "modules": [
            {
              "textRaw": "OpenSSL options",
              "name": "openssl_options",
              "type": "module",
              "desc": "<p>See the <a href=\"https://wiki.openssl.org/index.php/List_of_SSL_OP_Flags#Table_of_Options\">list of SSL OP Flags</a> for details.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_ALL</code></td>\n    <td>Applies multiple bug workarounds within OpenSSL. See\n    <a href=\"https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html</a>\n    for detail.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_ALLOW_NO_DHE_KEX</code></td>\n    <td>Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode\n    for TLS v1.3</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION</code></td>\n    <td>Allows legacy insecure renegotiation between OpenSSL and unpatched\n    clients or servers. See\n    <a href=\"https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html</a>.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_CIPHER_SERVER_PREFERENCE</code></td>\n    <td>Attempts to use the server's preferences instead of the client's when\n    selecting a cipher. Behavior depends on protocol version. See\n    <a href=\"https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html</a>.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_CISCO_ANYCONNECT</code></td>\n    <td>Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_COOKIE_EXCHANGE</code></td>\n    <td>Instructs OpenSSL to turn on cookie exchange.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_CRYPTOPRO_TLSEXT_BUG</code></td>\n    <td>Instructs OpenSSL to add server-hello extension from an early version\n    of the cryptopro draft.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS</code></td>\n    <td>Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability\n    workaround added in OpenSSL 0.9.6d.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_LEGACY_SERVER_CONNECT</code></td>\n    <td>Allows initial connection to servers that do not support RI.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_COMPRESSION</code></td>\n    <td>Instructs OpenSSL to disable support for SSL/TLS compression.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_ENCRYPT_THEN_MAC</code></td>\n    <td>Instructs OpenSSL to disable encrypt-then-MAC.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_QUERY_MTU</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_RENEGOTIATION</code></td>\n    <td>Instructs OpenSSL to disable renegotiation.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION</code></td>\n    <td>Instructs OpenSSL to always start a new session when performing\n    renegotiation.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_SSLv2</code></td>\n    <td>Instructs OpenSSL to turn off SSL v2</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_SSLv3</code></td>\n    <td>Instructs OpenSSL to turn off SSL v3</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TICKET</code></td>\n    <td>Instructs OpenSSL to disable use of RFC4507bis tickets.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1_1</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1.1</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1_2</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1.2</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1_3</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1.3</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_PRIORITIZE_CHACHA</code></td>\n    <td>Instructs OpenSSL server to prioritize ChaCha20-Poly1305\n    when the client does.\n    This option has no effect if\n    <code>SSL_OP_CIPHER_SERVER_PREFERENCE</code>\n    is not enabled.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_TLS_ROLLBACK_BUG</code></td>\n    <td>Instructs OpenSSL to disable version rollback attack detection.</td>\n  </tr>\n</table>",
              "displayName": "OpenSSL options"
            },
            {
              "textRaw": "OpenSSL engine constants",
              "name": "openssl_engine_constants",
              "type": "module",
              "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_RSA</code></td>\n    <td>Limit engine usage to RSA</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_DSA</code></td>\n    <td>Limit engine usage to DSA</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_DH</code></td>\n    <td>Limit engine usage to DH</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_RAND</code></td>\n    <td>Limit engine usage to RAND</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_EC</code></td>\n    <td>Limit engine usage to EC</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_CIPHERS</code></td>\n    <td>Limit engine usage to CIPHERS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_DIGESTS</code></td>\n    <td>Limit engine usage to DIGESTS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_PKEY_METHS</code></td>\n    <td>Limit engine usage to PKEY_METHS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_PKEY_ASN1_METHS</code></td>\n    <td>Limit engine usage to PKEY_ASN1_METHS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_ALL</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_NONE</code></td>\n    <td></td>\n  </tr>\n</table>",
              "displayName": "OpenSSL engine constants"
            },
            {
              "textRaw": "Other OpenSSL constants",
              "name": "other_openssl_constants",
              "type": "module",
              "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>DH_CHECK_P_NOT_SAFE_PRIME</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>DH_CHECK_P_NOT_PRIME</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>DH_UNABLE_TO_CHECK_GENERATOR</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>DH_NOT_SUITABLE_GENERATOR</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PKCS1_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_SSLV23_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_NO_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PKCS1_OAEP_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_X931_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PKCS1_PSS_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PSS_SALTLEN_DIGEST</code></td>\n    <td>Sets the salt length for <code>RSA_PKCS1_PSS_PADDING</code> to the\n        digest size when signing or verifying.</td>\n  </tr>\n  <tr>\n    <td><code>RSA_PSS_SALTLEN_MAX_SIGN</code></td>\n    <td>Sets the salt length for <code>RSA_PKCS1_PSS_PADDING</code> to the\n        maximum permissible value when signing data.</td>\n  </tr>\n  <tr>\n    <td><code>RSA_PSS_SALTLEN_AUTO</code></td>\n    <td>Causes the salt length for <code>RSA_PKCS1_PSS_PADDING</code> to be\n        determined automatically when verifying a signature.</td>\n  </tr>\n  <tr>\n    <td><code>POINT_CONVERSION_COMPRESSED</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>POINT_CONVERSION_UNCOMPRESSED</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>POINT_CONVERSION_HYBRID</code></td>\n    <td></td>\n  </tr>\n</table>",
              "displayName": "Other OpenSSL constants"
            },
            {
              "textRaw": "Node.js crypto constants",
              "name": "node.js_crypto_constants",
              "type": "module",
              "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>defaultCoreCipherList</code></td>\n    <td>Specifies the built-in default cipher list used by Node.js.</td>\n  </tr>\n  <tr>\n    <td><code>defaultCipherList</code></td>\n    <td>Specifies the active default cipher list used by the current Node.js\n    process.</td>\n  </tr>\n</table>",
              "displayName": "Node.js crypto constants"
            }
          ],
          "displayName": "Crypto constants"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Certificate`",
          "name": "Certificate",
          "type": "class",
          "meta": {
            "added": [
              "v0.11.8"
            ],
            "changes": []
          },
          "desc": "<p>SPKAC is a Certificate Signing Request mechanism originally implemented by\nNetscape and was specified formally as part of HTML5's <code>keygen</code> element.</p>\n<p><code>&#x3C;keygen></code> is deprecated since <a href=\"https://www.w3.org/TR/html52/changes.html#features-removed\">HTML 5.2</a> and new projects\nshould not use this element anymore.</p>\n<p>The <code>node:crypto</code> module provides the <code>Certificate</code> class for working with SPKAC\ndata. The most common usage is handling output generated by the HTML5\n<code>&#x3C;keygen></code> element. Node.js uses <a href=\"https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html\">OpenSSL's SPKAC implementation</a> internally.</p>",
          "classMethods": [
            {
              "textRaw": "Static method: `Certificate.exportChallenge(spkac[, encoding])`",
              "name": "exportChallenge",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The spkac argument can be an ArrayBuffer. Limited the size of the spkac argument to a maximum of 2**31 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "spkac",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `spkac` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} The challenge component of the `spkac` data structure, which includes a public key and a challenge.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "The challenge component of the `spkac` data structure, which includes a public key and a challenge."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst spkac = getSpkacSomehow();\nconst challenge = Certificate.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst spkac = getSpkacSomehow();\nconst challenge = Certificate.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Certificate.exportPublicKey(spkac[, encoding])`",
              "name": "exportPublicKey",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The spkac argument can be an ArrayBuffer. Limited the size of the spkac argument to a maximum of 2**31 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "spkac",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `spkac` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} The public key component of the `spkac` data structure, which includes a public key and a challenge.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "The public key component of the `spkac` data structure, which includes a public key and a challenge."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst spkac = getSpkacSomehow();\nconst publicKey = Certificate.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst spkac = getSpkacSomehow();\nconst publicKey = Certificate.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Certificate.verifySpkac(spkac[, encoding])`",
              "name": "verifySpkac",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The spkac argument can be an ArrayBuffer. Added encoding. Limited the size of the spkac argument to a maximum of 2**31 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "spkac",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `spkac` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if the given `spkac` data structure is valid, `false` otherwise.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if the given `spkac` data structure is valid, `false` otherwise."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { Certificate } = await import('node:crypto');\n\nconst spkac = getSpkacSomehow();\nconsole.log(Certificate.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\nconst { Certificate } = require('node:crypto');\n\nconst spkac = getSpkacSomehow();\nconsole.log(Certificate.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>"
            }
          ],
          "modules": [
            {
              "textRaw": "Legacy API",
              "name": "legacy_api",
              "type": "module",
              "stability": 0,
              "stabilityText": "Deprecated",
              "desc": "<p>As a legacy interface, it is possible to create new instances of\nthe <code>crypto.Certificate</code> class as illustrated in the examples below.</p>",
              "signatures": [
                {
                  "textRaw": "`new crypto.Certificate()`",
                  "name": "crypto.Certificate",
                  "type": "ctor",
                  "params": [],
                  "desc": "<p>Instances of the <code>Certificate</code> class can be created using the <code>new</code> keyword\nor by calling <code>crypto.Certificate()</code> as a function:</p>\n<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\n\nconst cert1 = new Certificate();\nconst cert2 = Certificate();\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\n\nconst cert1 = new Certificate();\nconst cert2 = Certificate();\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`certificate.exportChallenge(spkac[, encoding])`",
                  "name": "exportChallenge",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                          "name": "spkac",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The encoding of the `spkac` string.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Buffer} The challenge component of the `spkac` data structure, which includes a public key and a challenge.",
                        "name": "return",
                        "type": "Buffer",
                        "desc": "The challenge component of the `spkac` data structure, which includes a public key and a challenge."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst challenge = cert.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst challenge = cert.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>"
                },
                {
                  "textRaw": "`certificate.exportPublicKey(spkac[, encoding])`",
                  "name": "exportPublicKey",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                          "name": "spkac",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The encoding of the `spkac` string.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Buffer} The public key component of the `spkac` data structure, which includes a public key and a challenge.",
                        "name": "return",
                        "type": "Buffer",
                        "desc": "The public key component of the `spkac` data structure, which includes a public key and a challenge."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst publicKey = cert.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst publicKey = cert.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>"
                },
                {
                  "textRaw": "`certificate.verifySpkac(spkac[, encoding])`",
                  "name": "verifySpkac",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                          "name": "spkac",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The encoding of the `spkac` string.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if the given `spkac` data structure is valid, `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if the given `spkac` data structure is valid, `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { Certificate } = await import('node:crypto');\n\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconsole.log(cert.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\nconst { Certificate } = require('node:crypto');\n\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconsole.log(cert.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>"
                }
              ],
              "displayName": "Legacy API"
            }
          ]
        },
        {
          "textRaw": "Class: `Cipheriv`",
          "name": "Cipheriv",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>Instances of the <code>Cipheriv</code> class are used to encrypt data. The class can be\nused in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where plain unencrypted\ndata is written to produce encrypted data on the readable side, or</li>\n<li>Using the <a href=\"#cipherupdatedata-inputencoding-outputencoding\"><code>cipher.update()</code></a> and <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> methods to produce\nthe encrypted data.</li>\n</ul>\n<p>The <a href=\"#cryptocreatecipherivalgorithm-key-iv-options\"><code>crypto.createCipheriv()</code></a> method is\nused to create <code>Cipheriv</code> instances. <code>Cipheriv</code> objects are not to be created\ndirectly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Cipheriv</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    // Once we have the key and iv, we can create and use the cipher...\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = '';\n    cipher.setEncoding('hex');\n\n    cipher.on('data', (chunk) => encrypted += chunk);\n    cipher.on('end', () => console.log(encrypted));\n\n    cipher.write('some clear text data');\n    cipher.end();\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = require('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    // Once we have the key and iv, we can create and use the cipher...\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = '';\n    cipher.setEncoding('hex');\n\n    cipher.on('data', (chunk) => encrypted += chunk);\n    cipher.on('end', () => console.log(encrypted));\n\n    cipher.write('some clear text data');\n    cipher.end();\n  });\n});\n</code></pre>\n<p>Example: Using <code>Cipheriv</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n  createWriteStream,\n} from 'node:fs';\n\nimport {\n  pipeline,\n} from 'node:stream';\n\nconst {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    const input = createReadStream('test.js');\n    const output = createWriteStream('test.enc');\n\n    pipeline(input, cipher, output, (err) => {\n      if (err) throw err;\n    });\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n  createWriteStream,\n} = require('node:fs');\n\nconst {\n  pipeline,\n} = require('node:stream');\n\nconst {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = require('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    const input = createReadStream('test.js');\n    const output = createWriteStream('test.enc');\n\n    pipeline(input, cipher, output, (err) => {\n      if (err) throw err;\n    });\n  });\n});\n</code></pre>\n<p>Example: Using the <a href=\"#cipherupdatedata-inputencoding-outputencoding\"><code>cipher.update()</code></a> and <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = cipher.update('some clear text data', 'utf8', 'hex');\n    encrypted += cipher.final('hex');\n    console.log(encrypted);\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = require('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = cipher.update('some clear text data', 'utf8', 'hex');\n    encrypted += cipher.final('hex');\n    console.log(encrypted);\n  });\n});\n</code></pre>",
          "methods": [
            {
              "textRaw": "`cipher.final([outputEncoding])`",
              "name": "final",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned."
                  }
                }
              ],
              "desc": "<p>Once the <code>cipher.final()</code> method has been called, the <code>Cipheriv</code> object can no\nlonger be used to encrypt data. Attempts to call <code>cipher.final()</code> more than\nonce will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`cipher.getAuthTag()`",
              "name": "getAuthTag",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer} When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`, and `chacha20-poly1305` are currently supported), the `cipher.getAuthTag()` method returns a `Buffer` containing the _authentication tag_ that has been computed from the given data.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`, and `chacha20-poly1305` are currently supported), the `cipher.getAuthTag()` method returns a `Buffer` containing the _authentication tag_ that has been computed from the given data."
                  }
                }
              ],
              "desc": "<p>The <code>cipher.getAuthTag()</code> method should only be called after encryption has\nbeen completed using the <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> method.</p>\n<p>If the <code>authTagLength</code> option was set during the <code>cipher</code> instance's creation,\nthis function will return exactly <code>authTagLength</code> bytes.</p>"
            },
            {
              "textRaw": "`cipher.setAAD(buffer[, options])`",
              "name": "setAAD",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "options": [
                        {
                          "textRaw": "`plaintextLength` {number}",
                          "name": "plaintextLength",
                          "type": "number"
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer` is a string."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Cipheriv} The same `Cipheriv` instance for method chaining.",
                    "name": "return",
                    "type": "Cipheriv",
                    "desc": "The same `Cipheriv` instance for method chaining."
                  }
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code>, <code>OCB</code>, and\n<code>chacha20-poly1305</code> are\ncurrently supported), the <code>cipher.setAAD()</code> method sets the value used for the\n<em>additional authenticated data</em> (AAD) input parameter.</p>\n<p>The <code>plaintextLength</code> option is optional for <code>GCM</code> and <code>OCB</code>. When using <code>CCM</code>,\nthe <code>plaintextLength</code> option must be specified and its value must match the\nlength of the plaintext in bytes. See <a href=\"#ccm-mode\">CCM mode</a>.</p>\n<p>The <code>cipher.setAAD()</code> method must be called before <a href=\"#cipherupdatedata-inputencoding-outputencoding\"><code>cipher.update()</code></a>.</p>"
            },
            {
              "textRaw": "`cipher.setAutoPadding([autoPadding])`",
              "name": "setAutoPadding",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`autoPadding` {boolean} **Default:** `true`",
                      "name": "autoPadding",
                      "type": "boolean",
                      "default": "`true`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Cipheriv} The same `Cipheriv` instance for method chaining.",
                    "name": "return",
                    "type": "Cipheriv",
                    "desc": "The same `Cipheriv` instance for method chaining."
                  }
                }
              ],
              "desc": "<p>When using block encryption algorithms, the <code>Cipheriv</code> class will automatically\nadd padding to the input data to the appropriate block size. To disable the\ndefault padding call <code>cipher.setAutoPadding(false)</code>.</p>\n<p>When <code>autoPadding</code> is <code>false</code>, the length of the entire input data must be a\nmultiple of the cipher's block size or <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> will throw an error.\nDisabling automatic padding is useful for non-standard padding, for instance\nusing <code>0x0</code> instead of PKCS padding.</p>\n<p>The <code>cipher.setAutoPadding()</code> method must be called before\n<a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a>.</p>"
            },
            {
              "textRaw": "`cipher.update(data[, inputEncoding][, outputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the data.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the data.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Updates the cipher with <code>data</code>. If the <code>inputEncoding</code> argument is given,\nthe <code>data</code>\nargument is a string using the specified encoding. If the <code>inputEncoding</code>\nargument is not given, <code>data</code> must be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code>, then\n<code>inputEncoding</code> is ignored.</p>\n<p>The <code>outputEncoding</code> specifies the output format of the enciphered\ndata. If the <code>outputEncoding</code>\nis specified, a string using the specified encoding is returned. If no\n<code>outputEncoding</code> is provided, a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>The <code>cipher.update()</code> method can be called multiple times with new data until\n<a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> is called. Calling <code>cipher.update()</code> after\n<a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> will result in an error being thrown.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Decipheriv`",
          "name": "Decipheriv",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>Instances of the <code>Decipheriv</code> class are used to decrypt data. The class can be\nused in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where plain encrypted\ndata is written to produce unencrypted data on the readable side, or</li>\n<li>Using the <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a> and <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> methods to\nproduce the unencrypted data.</li>\n</ul>\n<p>The <a href=\"#cryptocreatedecipherivalgorithm-key-iv-options\"><code>crypto.createDecipheriv()</code></a> method is\nused to create <code>Decipheriv</code> instances. <code>Decipheriv</code> objects are not to be created\ndirectly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Decipheriv</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  scryptSync,\n  createDecipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Key length is dependent on the algorithm. In this case for aes192, it is\n// 24 bytes (192 bits).\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nlet decrypted = '';\ndecipher.on('readable', () => {\n  let chunk;\n  while (null !== (chunk = decipher.read())) {\n    decrypted += chunk.toString('utf8');\n  }\n});\ndecipher.on('end', () => {\n  console.log(decrypted);\n  // Prints: some clear text data\n});\n\n// Encrypted with same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\ndecipher.write(encrypted, 'hex');\ndecipher.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scryptSync,\n  createDecipheriv,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Key length is dependent on the algorithm. In this case for aes192, it is\n// 24 bytes (192 bits).\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nlet decrypted = '';\ndecipher.on('readable', () => {\n  let chunk;\n  while (null !== (chunk = decipher.read())) {\n    decrypted += chunk.toString('utf8');\n  }\n});\ndecipher.on('end', () => {\n  console.log(decrypted);\n  // Prints: some clear text data\n});\n\n// Encrypted with same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\ndecipher.write(encrypted, 'hex');\ndecipher.end();\n</code></pre>\n<p>Example: Using <code>Decipheriv</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n  createWriteStream,\n} from 'node:fs';\nimport { Buffer } from 'node:buffer';\nconst {\n  scryptSync,\n  createDecipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nconst input = createReadStream('test.enc');\nconst output = createWriteStream('test.js');\n\ninput.pipe(decipher).pipe(output);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n  createWriteStream,\n} = require('node:fs');\nconst {\n  scryptSync,\n  createDecipheriv,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nconst input = createReadStream('test.enc');\nconst output = createWriteStream('test.js');\n\ninput.pipe(decipher).pipe(output);\n</code></pre>\n<p>Example: Using the <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a> and <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  scryptSync,\n  createDecipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\n// Encrypted using same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\nlet decrypted = decipher.update(encrypted, 'hex', 'utf8');\ndecrypted += decipher.final('utf8');\nconsole.log(decrypted);\n// Prints: some clear text data\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scryptSync,\n  createDecipheriv,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\n// Encrypted using same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\nlet decrypted = decipher.update(encrypted, 'hex', 'utf8');\ndecrypted += decipher.final('utf8');\nconsole.log(decrypted);\n// Prints: some clear text data\n</code></pre>",
          "methods": [
            {
              "textRaw": "`decipher.final([outputEncoding])`",
              "name": "final",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned."
                  }
                }
              ],
              "desc": "<p>Once the <code>decipher.final()</code> method has been called, the <code>Decipheriv</code> object can\nno longer be used to decrypt data. Attempts to call <code>decipher.final()</code> more\nthan once will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`decipher.setAAD(buffer[, options])`",
              "name": "setAAD",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The buffer argument can be a string or ArrayBuffer and is limited to no more than 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9398",
                    "description": "This method now returns a reference to `decipher`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "options": [
                        {
                          "textRaw": "`plaintextLength` {number}",
                          "name": "plaintextLength",
                          "type": "number"
                        },
                        {
                          "textRaw": "`encoding` {string} String encoding to use when `buffer` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "String encoding to use when `buffer` is a string."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv} The same Decipher for method chaining.",
                    "name": "return",
                    "type": "Decipheriv",
                    "desc": "The same Decipher for method chaining."
                  }
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code>, <code>OCB</code>, and\n<code>chacha20-poly1305</code> are\ncurrently supported), the <code>decipher.setAAD()</code> method sets the value used for the\n<em>additional authenticated data</em> (AAD) input parameter.</p>\n<p>The <code>options</code> argument is optional for <code>GCM</code>. When using <code>CCM</code>, the\n<code>plaintextLength</code> option must be specified and its value must match the length\nof the ciphertext in bytes. See <a href=\"#ccm-mode\">CCM mode</a>.</p>\n<p>The <code>decipher.setAAD()</code> method must be called before <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a>.</p>\n<p>When passing a string as the <code>buffer</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>"
            },
            {
              "textRaw": "`decipher.setAuthTag(buffer[, encoding])`",
              "name": "setAuthTag",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61084",
                    "description": "Using GCM tag lengths other than 128 bits without specifying the `authTagLength` option when creating `decipher` is not allowed anymore."
                  },
                  {
                    "version": [
                      "v22.0.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52345",
                    "description": "Using GCM tag lengths other than 128 bits without specifying the `authTagLength` option when creating `decipher` is deprecated."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The buffer argument can be a string or ArrayBuffer and is limited to no more than 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17825",
                    "description": "This method now throws if the GCM tag length is invalid."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9398",
                    "description": "This method now returns a reference to `decipher`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|Buffer|ArrayBuffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|Buffer|ArrayBuffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} String encoding to use when `buffer` is a string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "String encoding to use when `buffer` is a string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv} The same Decipher for method chaining.",
                    "name": "return",
                    "type": "Decipheriv",
                    "desc": "The same Decipher for method chaining."
                  }
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code>, <code>OCB</code>, and\n<code>chacha20-poly1305</code> are\ncurrently supported), the <code>decipher.setAuthTag()</code> method is used to pass in the\nreceived <em>authentication tag</em>. If no tag is provided, or if the cipher text\nhas been tampered with, <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> will throw, indicating that the\ncipher text should be discarded due to failed authentication. If the tag length\nis invalid according to <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf\">NIST SP 800-38D</a> or does not match the value of the\n<code>authTagLength</code> option, <code>decipher.setAuthTag()</code> will throw an error.</p>\n<p>The <code>decipher.setAuthTag()</code> method must be called before <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a>\nfor <code>CCM</code> mode or before <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> for <code>GCM</code> and <code>OCB</code> modes and\n<code>chacha20-poly1305</code>.\n<code>decipher.setAuthTag()</code> can only be called once.</p>\n<p>When passing a string as the authentication tag, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>"
            },
            {
              "textRaw": "`decipher.setAutoPadding([autoPadding])`",
              "name": "setAutoPadding",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`autoPadding` {boolean} **Default:** `true`",
                      "name": "autoPadding",
                      "type": "boolean",
                      "default": "`true`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv} The same Decipher for method chaining.",
                    "name": "return",
                    "type": "Decipheriv",
                    "desc": "The same Decipher for method chaining."
                  }
                }
              ],
              "desc": "<p>When data has been encrypted without standard block padding, calling\n<code>decipher.setAutoPadding(false)</code> will disable automatic padding to prevent\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> from checking for and removing padding.</p>\n<p>Turning auto padding off will only work if the input data's length is a\nmultiple of the ciphers block size.</p>\n<p>The <code>decipher.setAutoPadding()</code> method must be called before\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a>.</p>"
            },
            {
              "textRaw": "`decipher.update(data[, inputEncoding][, outputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Updates the decipher with <code>data</code>. If the <code>inputEncoding</code> argument is given,\nthe <code>data</code>\nargument is a string using the specified encoding. If the <code>inputEncoding</code>\nargument is not given, <code>data</code> must be a <a href=\"buffer.html\"><code>Buffer</code></a>. If <code>data</code> is a\n<a href=\"buffer.html\"><code>Buffer</code></a> then <code>inputEncoding</code> is ignored.</p>\n<p>The <code>outputEncoding</code> specifies the output format of the enciphered\ndata. If the <code>outputEncoding</code>\nis specified, a string using the specified encoding is returned. If no\n<code>outputEncoding</code> is provided, a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>The <code>decipher.update()</code> method can be called multiple times with new data until\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> is called. Calling <code>decipher.update()</code> after\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> will result in an error being thrown.</p>\n<p>Even if the underlying cipher implements authentication, the authenticity and\nintegrity of the plaintext returned from this function may be uncertain at this\ntime. For authenticated encryption algorithms, authenticity is generally only\nestablished when the application calls <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `DiffieHellman`",
          "name": "DiffieHellman",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>DiffieHellman</code> class is a utility for creating Diffie-Hellman key\nexchanges.</p>\n<p>Instances of the <code>DiffieHellman</code> class can be created using the\n<a href=\"#cryptocreatediffiehellmanprime-primeencoding-generator-generatorencoding\"><code>crypto.createDiffieHellman()</code></a> function.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nconst {\n  createDiffieHellman,\n} = await import('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createDiffieHellman(2048);\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\n// OK\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nconst {\n  createDiffieHellman,\n} = require('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createDiffieHellman(2048);\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\n// OK\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n</code></pre>",
          "methods": [
            {
              "textRaw": "`diffieHellman.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])`",
              "name": "computeSecret",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherPublicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "otherPublicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of an `otherPublicKey` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of an `otherPublicKey` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Computes the shared secret using <code>otherPublicKey</code> as the other\nparty's public key and returns the computed shared secret. The supplied\nkey is interpreted using the specified <code>inputEncoding</code>, and secret is\nencoded using specified <code>outputEncoding</code>.\nIf the <code>inputEncoding</code> is not\nprovided, <code>otherPublicKey</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>If <code>outputEncoding</code> is given a string is returned; otherwise, a\n<a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.generateKeys([encoding])`",
              "name": "generateKeys",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Generates private and public Diffie-Hellman key values unless they have been\ngenerated or computed already, and returns\nthe public key in the specified <code>encoding</code>. This key should be\ntransferred to the other party.\nIf <code>encoding</code> is provided a string is returned; otherwise a\n<a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>This function is a thin wrapper around <a href=\"https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html\"><code>DH_generate_key()</code></a>. In particular,\nonce a private key has been generated or set, calling this function only updates\nthe public key but does not generate a new private key.</p>"
            },
            {
              "textRaw": "`diffieHellman.getGenerator([encoding])`",
              "name": "getGenerator",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman generator in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a string is\nreturned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.getPrime([encoding])`",
              "name": "getPrime",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman prime in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a string is\nreturned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.getPrivateKey([encoding])`",
              "name": "getPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman private key in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a\nstring is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.getPublicKey([encoding])`",
              "name": "getPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman public key in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a\nstring is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.setPrivateKey(privateKey[, encoding])`",
              "name": "setPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "privateKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `privateKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `privateKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the Diffie-Hellman private key. If the <code>encoding</code> argument is provided,\n<code>privateKey</code> is expected\nto be a string. If no <code>encoding</code> is provided, <code>privateKey</code> is expected\nto be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>This function does not automatically compute the associated public key. Either\n<a href=\"#diffiehellmansetpublickeypublickey-encoding\"><code>diffieHellman.setPublicKey()</code></a> or <a href=\"#diffiehellmangeneratekeysencoding\"><code>diffieHellman.generateKeys()</code></a> can be\nused to manually provide the public key or to automatically derive it.</p>"
            },
            {
              "textRaw": "`diffieHellman.setPublicKey(publicKey[, encoding])`",
              "name": "setPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "publicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `publicKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `publicKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the Diffie-Hellman public key. If the <code>encoding</code> argument is provided,\n<code>publicKey</code> is expected\nto be a string. If no <code>encoding</code> is provided, <code>publicKey</code> is expected\nto be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`diffieHellman.verifyError`",
              "name": "verifyError",
              "type": "property",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": []
              },
              "desc": "<p>A bit field containing any warnings and/or errors resulting from a check\nperformed during initialization of the <code>DiffieHellman</code> object.</p>\n<p>The following values are valid for this property (as defined in <code>node:constants</code> module):</p>\n<ul>\n<li><code>DH_CHECK_P_NOT_SAFE_PRIME</code></li>\n<li><code>DH_CHECK_P_NOT_PRIME</code></li>\n<li><code>DH_UNABLE_TO_CHECK_GENERATOR</code></li>\n<li><code>DH_NOT_SUITABLE_GENERATOR</code></li>\n</ul>"
            }
          ]
        },
        {
          "textRaw": "Class: `DiffieHellmanGroup`",
          "name": "DiffieHellmanGroup",
          "type": "class",
          "meta": {
            "added": [
              "v0.7.5"
            ],
            "changes": []
          },
          "desc": "<p>The <code>DiffieHellmanGroup</code> class takes a well-known modp group as its argument.\nIt works the same as <code>DiffieHellman</code>, except that it does not allow changing\nits keys after creation. In other words, it does not implement <code>setPublicKey()</code>\nor <code>setPrivateKey()</code> methods.</p>\n<pre><code class=\"language-mjs\">const { createDiffieHellmanGroup } = await import('node:crypto');\nconst dh = createDiffieHellmanGroup('modp16');\n</code></pre>\n<pre><code class=\"language-cjs\">const { createDiffieHellmanGroup } = require('node:crypto');\nconst dh = createDiffieHellmanGroup('modp16');\n</code></pre>\n<p>The following groups are supported:</p>\n<ul>\n<li><code>'modp14'</code> (2048 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 3)</li>\n<li><code>'modp15'</code> (3072 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 4)</li>\n<li><code>'modp16'</code> (4096 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 5)</li>\n<li><code>'modp17'</code> (6144 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 6)</li>\n<li><code>'modp18'</code> (8192 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 7)</li>\n</ul>\n<p>The following groups are still supported but deprecated (see <a href=\"#support-for-weak-or-compromised-algorithms\">Caveats</a>):</p>\n<ul>\n<li><code>'modp1'</code> (768 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc2409.txt\">RFC 2409</a> Section 6.1) <span class=\"deprecated-inline\"></span></li>\n<li><code>'modp2'</code> (1024 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc2409.txt\">RFC 2409</a> Section 6.2) <span class=\"deprecated-inline\"></span></li>\n<li><code>'modp5'</code> (1536 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 2) <span class=\"deprecated-inline\"></span></li>\n</ul>\n<p>These deprecated groups might be removed in future versions of Node.js.</p>"
        },
        {
          "textRaw": "Class: `ECDH`",
          "name": "ECDH",
          "type": "class",
          "meta": {
            "added": [
              "v0.11.14"
            ],
            "changes": []
          },
          "desc": "<p>The <code>ECDH</code> class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH)\nkey exchanges.</p>\n<p>Instances of the <code>ECDH</code> class can be created using the\n<a href=\"#cryptocreateecdhcurvename\"><code>crypto.createECDH()</code></a> function.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nconst {\n  createECDH,\n} = await import('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createECDH('secp521r1');\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createECDH('secp521r1');\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nconst {\n  createECDH,\n} = require('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createECDH('secp521r1');\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createECDH('secp521r1');\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n// OK\n</code></pre>",
          "classMethods": [
            {
              "textRaw": "Static method: `ECDH.convertKey(key, curve[, inputEncoding[, outputEncoding[, format]]])`",
              "name": "convertKey",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`curve` {string}",
                      "name": "curve",
                      "type": "string"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `key` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `key` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Converts the EC Diffie-Hellman public key specified by <code>key</code> and <code>curve</code> to the\nformat specified by <code>format</code>. The <code>format</code> argument specifies point encoding\nand can be <code>'compressed'</code>, <code>'uncompressed'</code> or <code>'hybrid'</code>. The supplied key is\ninterpreted using the specified <code>inputEncoding</code>, and the returned key is encoded\nusing the specified <code>outputEncoding</code>.</p>\n<p>Use <a href=\"#cryptogetcurves\"><code>crypto.getCurves()</code></a> to obtain a list of available curve names.\nOn recent OpenSSL releases, <code>openssl ecparam -list_curves</code> will also display\nthe name and description of each available elliptic curve.</p>\n<p>If <code>format</code> is not specified the point will be returned in <code>'uncompressed'</code>\nformat.</p>\n<p>If the <code>inputEncoding</code> is not provided, <code>key</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>Example (uncompressing a key):</p>\n<pre><code class=\"language-mjs\">const {\n  createECDH,\n  ECDH,\n} = await import('node:crypto');\n\nconst ecdh = createECDH('secp256k1');\necdh.generateKeys();\n\nconst compressedKey = ecdh.getPublicKey('hex', 'compressed');\n\nconst uncompressedKey = ECDH.convertKey(compressedKey,\n                                        'secp256k1',\n                                        'hex',\n                                        'hex',\n                                        'uncompressed');\n\n// The converted key and the uncompressed public key should be the same\nconsole.log(uncompressedKey === ecdh.getPublicKey('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createECDH,\n  ECDH,\n} = require('node:crypto');\n\nconst ecdh = createECDH('secp256k1');\necdh.generateKeys();\n\nconst compressedKey = ecdh.getPublicKey('hex', 'compressed');\n\nconst uncompressedKey = ECDH.convertKey(compressedKey,\n                                        'secp256k1',\n                                        'hex',\n                                        'hex',\n                                        'uncompressed');\n\n// The converted key and the uncompressed public key should be the same\nconsole.log(uncompressedKey === ecdh.getPublicKey('hex'));\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])`",
              "name": "computeSecret",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16849",
                    "description": "Changed error format to better support invalid public key error."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherPublicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "otherPublicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `otherPublicKey` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `otherPublicKey` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Computes the shared secret using <code>otherPublicKey</code> as the other\nparty's public key and returns the computed shared secret. The supplied\nkey is interpreted using specified <code>inputEncoding</code>, and the returned secret\nis encoded using the specified <code>outputEncoding</code>.\nIf the <code>inputEncoding</code> is not\nprovided, <code>otherPublicKey</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>.</p>\n<p>If <code>outputEncoding</code> is given a string will be returned; otherwise a\n<a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p><code>ecdh.computeSecret</code> will throw an\n<code>ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY</code> error when <code>otherPublicKey</code>\nlies outside of the elliptic curve. Since <code>otherPublicKey</code> is\nusually supplied from a remote user over an insecure network,\nbe sure to handle this exception accordingly.</p>"
            },
            {
              "textRaw": "`ecdh.generateKeys([encoding[, format]])`",
              "name": "generateKeys",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Generates private and public EC Diffie-Hellman key values, and returns\nthe public key in the specified <code>format</code> and <code>encoding</code>. This key should be\ntransferred to the other party.</p>\n<p>The <code>format</code> argument specifies point encoding and can be <code>'compressed'</code> or\n<code>'uncompressed'</code>. If <code>format</code> is not specified, the point will be returned in\n<code>'uncompressed'</code> format.</p>\n<p>If <code>encoding</code> is provided a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a>\nis returned.</p>"
            },
            {
              "textRaw": "`ecdh.getPrivateKey([encoding])`",
              "name": "getPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The EC Diffie-Hellman in the specified `encoding`.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The EC Diffie-Hellman in the specified `encoding`."
                  }
                }
              ],
              "desc": "<p>If <code>encoding</code> is specified, a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is\nreturned.</p>"
            },
            {
              "textRaw": "`ecdh.getPublicKey([encoding][, format])`",
              "name": "getPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The EC Diffie-Hellman public key in the specified `encoding` and `format`.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The EC Diffie-Hellman public key in the specified `encoding` and `format`."
                  }
                }
              ],
              "desc": "<p>The <code>format</code> argument specifies point encoding and can be <code>'compressed'</code> or\n<code>'uncompressed'</code>. If <code>format</code> is not specified the point will be returned in\n<code>'uncompressed'</code> format.</p>\n<p>If <code>encoding</code> is specified, a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is\nreturned.</p>"
            },
            {
              "textRaw": "`ecdh.setPrivateKey(privateKey[, encoding])`",
              "name": "setPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "privateKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `privateKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `privateKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the EC Diffie-Hellman private key.\nIf <code>encoding</code> is provided, <code>privateKey</code> is expected\nto be a string; otherwise <code>privateKey</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>If <code>privateKey</code> is not valid for the curve specified when the <code>ECDH</code> object was\ncreated, an error is thrown. Upon setting the private key, the associated\npublic point (key) is also generated and set in the <code>ECDH</code> object.</p>"
            },
            {
              "textRaw": "`ecdh.setPublicKey(publicKey[, encoding])`",
              "name": "setPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [],
                "deprecated": [
                  "v5.2.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "publicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `publicKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `publicKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the EC Diffie-Hellman public key.\nIf <code>encoding</code> is provided <code>publicKey</code> is expected to\nbe a string; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code> is expected.</p>\n<p>There is not normally a reason to call this method because <code>ECDH</code>\nonly requires a private key and the other party's public key to compute the\nshared secret. Typically either <a href=\"#ecdhgeneratekeysencoding-format\"><code>ecdh.generateKeys()</code></a> or\n<a href=\"#ecdhsetprivatekeyprivatekey-encoding\"><code>ecdh.setPrivateKey()</code></a> will be called. The <a href=\"#ecdhsetprivatekeyprivatekey-encoding\"><code>ecdh.setPrivateKey()</code></a> method\nattempts to generate the public point/key associated with the private key being\nset.</p>\n<p>Example (obtaining a shared secret):</p>\n<pre><code class=\"language-mjs\">const {\n  createECDH,\n  createHash,\n} = await import('node:crypto');\n\nconst alice = createECDH('secp256k1');\nconst bob = createECDH('secp256k1');\n\n// This is a shortcut way of specifying one of Alice's previous private\n// keys. It would be unwise to use such a predictable private key in a real\n// application.\nalice.setPrivateKey(\n  createHash('sha256').update('alice', 'utf8').digest(),\n);\n\n// Bob uses a newly generated cryptographically strong\n// pseudorandom key pair\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n// aliceSecret and bobSecret should be the same shared secret value\nconsole.log(aliceSecret === bobSecret);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createECDH,\n  createHash,\n} = require('node:crypto');\n\nconst alice = createECDH('secp256k1');\nconst bob = createECDH('secp256k1');\n\n// This is a shortcut way of specifying one of Alice's previous private\n// keys. It would be unwise to use such a predictable private key in a real\n// application.\nalice.setPrivateKey(\n  createHash('sha256').update('alice', 'utf8').digest(),\n);\n\n// Bob uses a newly generated cryptographically strong\n// pseudorandom key pair\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n// aliceSecret and bobSecret should be the same shared secret value\nconsole.log(aliceSecret === bobSecret);\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `Hash`",
          "name": "Hash",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>The <code>Hash</code> class is a utility for creating hash digests of data. It can be\nused in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where data is written\nto produce a computed hash digest on the readable side, or</li>\n<li>Using the <a href=\"#hashupdatedata-inputencoding\"><code>hash.update()</code></a> and <a href=\"#hashdigestencoding\"><code>hash.digest()</code></a> methods to produce the\ncomputed hash.</li>\n</ul>\n<p>The <a href=\"#cryptocreatehashalgorithm-options\"><code>crypto.createHash()</code></a> method is used to create <code>Hash</code> instances. <code>Hash</code>\nobjects are not to be created directly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Hash</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  createHash,\n} = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hash.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n  }\n});\n\nhash.write('some data to hash');\nhash.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHash,\n} = require('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hash.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n  }\n});\n\nhash.write('some data to hash');\nhash.end();\n</code></pre>\n<p>Example: Using <code>Hash</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\nimport { stdout } from 'node:process';\nconst { createHash } = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream('test.js');\ninput.pipe(hash).setEncoding('hex').pipe(stdout);\n</code></pre>\n<pre><code class=\"language-cjs\">const { createReadStream } = require('node:fs');\nconst { createHash } = require('node:crypto');\nconst { stdout } = require('node:process');\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream('test.js');\ninput.pipe(hash).setEncoding('hex').pipe(stdout);\n</code></pre>\n<p>Example: Using the <a href=\"#hashupdatedata-inputencoding\"><code>hash.update()</code></a> and <a href=\"#hashdigestencoding\"><code>hash.digest()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  createHash,\n} = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('some data to hash');\nconsole.log(hash.digest('hex'));\n// Prints:\n//   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHash,\n} = require('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('some data to hash');\nconsole.log(hash.digest('hex'));\n// Prints:\n//   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n</code></pre>",
          "methods": [
            {
              "textRaw": "`hash.copy([options])`",
              "name": "copy",
              "type": "method",
              "meta": {
                "added": [
                  "v13.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Hash}",
                    "name": "return",
                    "type": "Hash"
                  }
                }
              ],
              "desc": "<p>Creates a new <code>Hash</code> object that contains a deep copy of the internal state\nof the current <code>Hash</code> object.</p>\n<p>The optional <code>options</code> argument controls stream behavior. For XOF hash\nfunctions such as <code>'shake256'</code>, the <code>outputLength</code> option can be used to\nspecify the desired output length in bytes.</p>\n<p>An error is thrown when an attempt is made to copy the <code>Hash</code> object after\nits <a href=\"#hashdigestencoding\"><code>hash.digest()</code></a> method has been called.</p>\n<pre><code class=\"language-mjs\">// Calculate a rolling hash.\nconst {\n  createHash,\n} = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('one');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('two');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('three');\nconsole.log(hash.copy().digest('hex'));\n\n// Etc.\n</code></pre>\n<pre><code class=\"language-cjs\">// Calculate a rolling hash.\nconst {\n  createHash,\n} = require('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('one');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('two');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('three');\nconsole.log(hash.copy().digest('hex'));\n\n// Etc.\n</code></pre>"
            },
            {
              "textRaw": "`hash.digest([encoding])`",
              "name": "digest",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Calculates the digest of all of the data passed to be hashed (using the\n<a href=\"#hashupdatedata-inputencoding\"><code>hash.update()</code></a> method).\nIf <code>encoding</code> is provided a string will be returned; otherwise\na <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>The <code>Hash</code> object can not be used again after <code>hash.digest()</code> method has been\ncalled. Multiple calls will cause an error to be thrown.</p>"
            },
            {
              "textRaw": "`hash.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the hash content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>encoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Hmac`",
          "name": "Hmac",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>The <code>Hmac</code> class is a utility for creating cryptographic HMAC digests. It can\nbe used in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where data is written\nto produce a computed HMAC digest on the readable side, or</li>\n<li>Using the <a href=\"#hmacupdatedata-inputencoding\"><code>hmac.update()</code></a> and <a href=\"#hmacdigestencoding\"><code>hmac.digest()</code></a> methods to produce the\ncomputed HMAC digest.</li>\n</ul>\n<p>The <a href=\"#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a> method is used to create <code>Hmac</code> instances. <code>Hmac</code>\nobjects are not to be created directly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Hmac</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  createHmac,\n} = await import('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hmac.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n  }\n});\n\nhmac.write('some data to hash');\nhmac.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHmac,\n} = require('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hmac.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n  }\n});\n\nhmac.write('some data to hash');\nhmac.end();\n</code></pre>\n<p>Example: Using <code>Hmac</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\nimport { stdout } from 'node:process';\nconst {\n  createHmac,\n} = await import('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream('test.js');\ninput.pipe(hmac).pipe(stdout);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n} = require('node:fs');\nconst {\n  createHmac,\n} = require('node:crypto');\nconst { stdout } = require('node:process');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream('test.js');\ninput.pipe(hmac).pipe(stdout);\n</code></pre>\n<p>Example: Using the <a href=\"#hmacupdatedata-inputencoding\"><code>hmac.update()</code></a> and <a href=\"#hmacdigestencoding\"><code>hmac.digest()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  createHmac,\n} = await import('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.update('some data to hash');\nconsole.log(hmac.digest('hex'));\n// Prints:\n//   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHmac,\n} = require('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.update('some data to hash');\nconsole.log(hmac.digest('hex'));\n// Prints:\n//   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n</code></pre>",
          "methods": [
            {
              "textRaw": "`hmac.digest([encoding])`",
              "name": "digest",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Calculates the HMAC digest of all of the data passed using <a href=\"#hmacupdatedata-inputencoding\"><code>hmac.update()</code></a>.\nIf <code>encoding</code> is\nprovided a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned;</p>\n<p>The <code>Hmac</code> object can not be used again after <code>hmac.digest()</code> has been\ncalled. Multiple calls to <code>hmac.digest()</code> will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`hmac.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the <code>Hmac</code> content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>encoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `KeyObject`",
          "name": "KeyObject",
          "type": "class",
          "meta": {
            "added": [
              "v11.6.0"
            ],
            "changes": [
              {
                "version": "v24.6.0",
                "pr-url": "https://github.com/nodejs/node/pull/59259",
                "description": "Add support for ML-DSA keys."
              },
              {
                "version": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/33360",
                "description": "Instances of this class can now be passed to worker threads using `postMessage`."
              },
              {
                "version": "v11.13.0",
                "pr-url": "https://github.com/nodejs/node/pull/26438",
                "description": "This class is now exported."
              }
            ]
          },
          "desc": "<p>Node.js uses a <code>KeyObject</code> class to represent a symmetric or asymmetric key,\nand each kind of key exposes different functions. The\n<a href=\"#cryptocreatesecretkeykey-encoding\"><code>crypto.createSecretKey()</code></a>, <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a> and\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a> methods are used to create <code>KeyObject</code>\ninstances. <code>KeyObject</code> objects are not to be created directly using the <code>new</code>\nkeyword.</p>\n<p>Most applications should consider using the new <code>KeyObject</code> API instead of\npassing keys as strings or <code>Buffer</code>s due to improved security features.</p>\n<p><code>KeyObject</code> instances can be passed to other threads via <a href=\"worker_threads.html#portpostmessagevalue-transferlist\"><code>postMessage()</code></a>.\nThe receiver obtains a cloned <code>KeyObject</code>, and the <code>KeyObject</code> does not need to\nbe listed in the <code>transferList</code> argument.</p>",
          "classMethods": [
            {
              "textRaw": "Static method: `KeyObject.from(key)`",
              "name": "from",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a non-extractable CryptoKey as `key` is deprecated."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Returns the underlying <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> of a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>. The returned <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a>\ndoes not retain any of the restrictions imposed by the Web Crypto API on the\noriginal <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>, such as the allowed key usages, the algorithm or hash\nalgorithm bindings, and the extractability flag. In particular, the underlying\nkey material of the returned <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> can always be exported.</p>\n<pre><code class=\"language-mjs\">const { KeyObject } = await import('node:crypto');\nconst { subtle } = globalThis.crypto;\n\nconst key = await subtle.generateKey({\n  name: 'HMAC',\n  hash: 'SHA-256',\n  length: 256,\n}, true, ['sign', 'verify']);\n\nconst keyObject = KeyObject.from(key);\nconsole.log(keyObject.symmetricKeySize);\n// Prints: 32 (symmetric key size in bytes)\n</code></pre>\n<pre><code class=\"language-cjs\">const { KeyObject } = require('node:crypto');\nconst { subtle } = globalThis.crypto;\n\n(async function() {\n  const key = await subtle.generateKey({\n    name: 'HMAC',\n    hash: 'SHA-256',\n    length: 256,\n  }, true, ['sign', 'verify']);\n\n  const keyObject = KeyObject.from(key);\n  console.log(keyObject.symmetricKeySize);\n  // Prints: 32 (symmetric key size in bytes)\n})();\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "asymmetricKeyDetails",
              "type": "Object",
              "meta": {
                "added": [
                  "v15.7.0"
                ],
                "changes": [
                  {
                    "version": "v16.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39851",
                    "description": "Expose `RSASSA-PSS-params` sequence parameters for RSA-PSS keys."
                  }
                ]
              },
              "desc": "<p>This property exists only on asymmetric keys. Depending on the type of the key,\nthis object contains information about the key. None of the information obtained\nthrough this property can be used to uniquely identify a key or to compromise\nthe security of the key.</p>\n<p>For RSA-PSS keys, if the key material contains a <code>RSASSA-PSS-params</code> sequence,\nthe <code>hashAlgorithm</code>, <code>mgf1HashAlgorithm</code>, and <code>saltLength</code> properties will be\nset.</p>\n<p>Other key details might be exposed via this API using additional attributes.</p>",
              "options": [
                {
                  "textRaw": "`modulusLength` {number} Key size in bits (RSA, DSA).",
                  "name": "modulusLength",
                  "type": "number",
                  "desc": "Key size in bits (RSA, DSA)."
                },
                {
                  "textRaw": "`publicExponent` {bigint} Public exponent (RSA).",
                  "name": "publicExponent",
                  "type": "bigint",
                  "desc": "Public exponent (RSA)."
                },
                {
                  "textRaw": "`hashAlgorithm` {string} Name of the message digest (RSA-PSS).",
                  "name": "hashAlgorithm",
                  "type": "string",
                  "desc": "Name of the message digest (RSA-PSS)."
                },
                {
                  "textRaw": "`mgf1HashAlgorithm` {string} Name of the message digest used by MGF1 (RSA-PSS).",
                  "name": "mgf1HashAlgorithm",
                  "type": "string",
                  "desc": "Name of the message digest used by MGF1 (RSA-PSS)."
                },
                {
                  "textRaw": "`saltLength` {number} Minimal salt length in bytes (RSA-PSS).",
                  "name": "saltLength",
                  "type": "number",
                  "desc": "Minimal salt length in bytes (RSA-PSS)."
                },
                {
                  "textRaw": "`divisorLength` {number} Size of `q` in bits (DSA).",
                  "name": "divisorLength",
                  "type": "number",
                  "desc": "Size of `q` in bits (DSA)."
                },
                {
                  "textRaw": "`namedCurve` {string} Name of the curve (EC).",
                  "name": "namedCurve",
                  "type": "string",
                  "desc": "Name of the curve (EC)."
                }
              ]
            },
            {
              "textRaw": "Type: {string}",
              "name": "asymmetricKeyType",
              "type": "string",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA keys."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59461",
                    "description": "Add support for ML-KEM keys."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA keys."
                  },
                  {
                    "version": [
                      "v13.9.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31178",
                    "description": "Added support for `'dh'`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "Added support for `'rsa-pss'`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26786",
                    "description": "This property now returns `undefined` for KeyObject instances of unrecognized type instead of aborting."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26774",
                    "description": "Added support for `'x25519'` and `'x448'`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26319",
                    "description": "Added support for `'ed25519'` and `'ed448'`."
                  }
                ]
              },
              "desc": "<p>For asymmetric keys, this property represents the type of the key. See the\nsupported <a href=\"#asymmetric-key-types\">asymmetric key types</a>.</p>\n<p>This property is <code>undefined</code> for unrecognized <code>KeyObject</code> types and symmetric\nkeys.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "symmetricKeySize",
              "type": "number",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "desc": "<p>For secret keys, this property represents the size of the key in bytes. This\nproperty is <code>undefined</code> for asymmetric keys.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "type",
              "type": "string",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Depending on the type of this <code>KeyObject</code>, this property is either\n<code>'secret'</code> for secret (symmetric) keys, <code>'public'</code> for public (asymmetric) keys\nor <code>'private'</code> for private (asymmetric) keys.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`keyObject.equals(otherKeyObject)`",
              "name": "equals",
              "type": "method",
              "meta": {
                "added": [
                  "v17.7.0",
                  "v16.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherKeyObject` {KeyObject} A `KeyObject` with which to compare `keyObject`.",
                      "name": "otherKeyObject",
                      "type": "KeyObject",
                      "desc": "A `KeyObject` with which to compare `keyObject`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> or <code>false</code> depending on whether the keys have exactly the same\ntype, value, and parameters. This method is not\n<a href=\"https://en.wikipedia.org/wiki/Timing_attack\">constant time</a>.</p>"
            },
            {
              "textRaw": "`keyObject.export([options])`",
              "name": "export",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62240",
                    "description": "Added support for `'raw-public'`, `'raw-private'`, and `'raw-seed'` formats."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62178",
                    "description": "ML-KEM and ML-DSA private key `'pkcs8'` export now uses seed-only format by default when a seed is available."
                  },
                  {
                    "version": "v15.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37081",
                    "description": "Added support for `'jwk'` format."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer|Object}",
                    "name": "return",
                    "type": "string|Buffer|Object"
                  }
                }
              ],
              "desc": "<p>For symmetric keys, the following encoding options can be used:</p>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Must be <code>'buffer'</code> (default) or <code>'jwk'</code>.</li>\n</ul>\n<p>For public keys, the following encoding options can be used:</p>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Must be <code>'pem'</code>, <code>'der'</code>, <code>'jwk'</code>, or <code>'raw-public'</code>.\nSee <a href=\"#asymmetric-key-types\">asymmetric key types</a> for format support.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> When <code>format</code> is <code>'pem'</code> or <code>'der'</code>, must be <code>'pkcs1'</code>\n(RSA only) or <code>'spki'</code>. For EC keys with <code>'raw-public'</code> format, may be\n<code>'uncompressed'</code> (default) or <code>'compressed'</code>. Ignored when <code>format</code> is\n<code>'jwk'</code>.</li>\n</ul>\n<p>For private keys, the following encoding options can be used:</p>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Must be <code>'pem'</code>, <code>'der'</code>, <code>'jwk'</code>, <code>'raw-private'</code>,\nor <code>'raw-seed'</code>. See <a href=\"#asymmetric-key-types\">asymmetric key types</a> for format support.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> When <code>format</code> is <code>'pem'</code> or <code>'der'</code>, must be <code>'pkcs1'</code>\n(RSA only), <code>'pkcs8'</code>, or <code>'sec1'</code> (EC only). Ignored when <code>format</code> is\n<code>'jwk'</code>, <code>'raw-private'</code>, or <code>'raw-seed'</code>.</li>\n<li><code>cipher</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If specified, the private key will be encrypted with\nthe given <code>cipher</code> and <code>passphrase</code> using PKCS#5 v2.0 password based\nencryption. Ignored when <code>format</code> is <code>'jwk'</code>, <code>'raw-private'</code>, or\n<code>'raw-seed'</code>.</li>\n<li><code>passphrase</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> The passphrase to use for encryption.\nRequired when <code>cipher</code> is specified.</li>\n</ul>\n<p>The result type depends on the selected encoding format, when PEM the\nresult is a string, when DER it will be a buffer containing the data\nencoded as DER, when <a href=\"https://tools.ietf.org/html/rfc7517\">JWK</a> it will be an object. Raw formats return a\n<a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> containing the raw key material.</p>\n<p>Private keys can be encrypted by specifying a <code>cipher</code> and <code>passphrase</code>.\nThe PKCS#8 <code>type</code> supports encryption with both PEM and DER <code>format</code> for any\nkey algorithm. PKCS#1 and SEC1 can only be encrypted when the PEM <code>format</code> is\nused. For maximum compatibility, use PKCS#8 for encrypted private keys. Since\nPKCS#8 defines its own encryption mechanism, PEM-level encryption is not\nsupported when encrypting a PKCS#8 key. See <a href=\"https://www.rfc-editor.org/rfc/rfc5208.txt\">RFC 5208</a> for PKCS#8 encryption\nand <a href=\"https://www.rfc-editor.org/rfc/rfc1421.txt\">RFC 1421</a> for PKCS#1 and SEC1 encryption.</p>"
            },
            {
              "textRaw": "`keyObject.toCryptoKey(algorithm, extractable, keyUsages)`",
              "name": "toCryptoKey",
              "type": "method",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams}",
                      "name": "algorithm",
                      "type": "string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams"
                    },
                    {
                      "name": "extractable"
                    },
                    {
                      "name": "keyUsages"
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>extractable</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>keyUsages</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> See <a href=\"webcrypto.html#cryptokeyusages\">Key usages</a>.</li>\n<li>Returns: <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a></li>\n</ul>\n<p>Converts a <code>KeyObject</code> instance to a <code>CryptoKey</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Sign`",
          "name": "Sign",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamwritable\"><code>&#x3C;stream.Writable></code></a></li>\n</ul>\n<p>The <code>Sign</code> class is a utility for generating signatures. It can be used in one\nof two ways:</p>\n<ul>\n<li>As a writable <a href=\"stream.html\">stream</a>, where data to be signed is written and the\n<a href=\"#signsignprivatekey-outputencoding\"><code>sign.sign()</code></a> method is used to generate and return the signature, or</li>\n<li>Using the <a href=\"#signupdatedata-inputencoding\"><code>sign.update()</code></a> and <a href=\"#signsignprivatekey-outputencoding\"><code>sign.sign()</code></a> methods to produce the\nsignature.</li>\n</ul>\n<p>The <a href=\"#cryptocreatesignalgorithm-options\"><code>crypto.createSign()</code></a> method is used to create <code>Sign</code> instances. The\nargument is the string name of the hash function to use. <code>Sign</code> objects are not\nto be created directly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Sign</code> and <a href=\"#class-verify\"><code>Verify</code></a> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = await import('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('ec', {\n  namedCurve: 'sect239k1',\n});\n\nconst sign = createSign('SHA256');\nsign.write('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey, 'hex');\n\nconst verify = createVerify('SHA256');\nverify.write('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature, 'hex'));\n// Prints: true\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = require('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('ec', {\n  namedCurve: 'sect239k1',\n});\n\nconst sign = createSign('SHA256');\nsign.write('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey, 'hex');\n\nconst verify = createVerify('SHA256');\nverify.write('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature, 'hex'));\n// Prints: true\n</code></pre>\n<p>Example: Using the <a href=\"#signupdatedata-inputencoding\"><code>sign.update()</code></a> and <a href=\"#verifyupdatedata-inputencoding\"><code>verify.update()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = await import('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('rsa', {\n  modulusLength: 2048,\n});\n\nconst sign = createSign('SHA256');\nsign.update('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey);\n\nconst verify = createVerify('SHA256');\nverify.update('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature));\n// Prints: true\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = require('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('rsa', {\n  modulusLength: 2048,\n});\n\nconst sign = createSign('SHA256');\nsign.update('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey);\n\nconst verify = createVerify('SHA256');\nverify.update('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature));\n// Prints: true\n</code></pre>",
          "methods": [
            {
              "textRaw": "`sign.sign(privateKey[, outputEncoding])`",
              "name": "sign",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The privateKey can also be an ArrayBuffer and CryptoKey."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "This function now supports RSA-PSS keys."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11705",
                    "description": "Support for RSASSA-PSS and additional options was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "privateKey",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`dsaEncoding` {string}",
                          "name": "dsaEncoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`padding` {integer}",
                          "name": "padding",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`saltLength` {integer}",
                          "name": "saltLength",
                          "type": "integer"
                        }
                      ]
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Calculates the signature on all the data passed through using either\n<a href=\"#signupdatedata-inputencoding\"><code>sign.update()</code></a> or <a href=\"stream.html#writablewritechunk-encoding-callback\"><code>sign.write()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an\nobject, the following additional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the generated signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to sign the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>, unless\nan MGF1 hash function has been specified as part of the key in compliance with\nsection 3.3 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN</code> (default) sets it to the\nmaximum permissible value.</p>\n</li>\n</ul>\n<p>If <code>outputEncoding</code> is provided a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a>\nis returned.</p>\n<p>The <code>Sign</code> object can not be again used after <code>sign.sign()</code> method has been\ncalled. Multiple calls to <code>sign.sign()</code> will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`sign.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the <code>Sign</code> content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>encoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Verify`",
          "name": "Verify",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamwritable\"><code>&#x3C;stream.Writable></code></a></li>\n</ul>\n<p>The <code>Verify</code> class is a utility for verifying signatures. It can be used in one\nof two ways:</p>\n<ul>\n<li>As a writable <a href=\"stream.html\">stream</a> where written data is used to validate against the\nsupplied signature, or</li>\n<li>Using the <a href=\"#verifyupdatedata-inputencoding\"><code>verify.update()</code></a> and <a href=\"#verifyverifyobject-signature-signatureencoding\"><code>verify.verify()</code></a> methods to verify\nthe signature.</li>\n</ul>\n<p>The <a href=\"#cryptocreateverifyalgorithm-options\"><code>crypto.createVerify()</code></a> method is used to create <code>Verify</code> instances.\n<code>Verify</code> objects are not to be created directly using the <code>new</code> keyword.</p>\n<p>See <a href=\"#class-sign\"><code>Sign</code></a> for examples.</p>",
          "methods": [
            {
              "textRaw": "`verify.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the <code>Verify</code> content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>inputEncoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            },
            {
              "textRaw": "`verify.verify(object, signature[, signatureEncoding])`",
              "name": "verify",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The object can also be an ArrayBuffer and CryptoKey."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "This function now supports RSA-PSS keys."
                  },
                  {
                    "version": "v11.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25217",
                    "description": "The key can now be a private key."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11705",
                    "description": "Support for RSASSA-PSS and additional options was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`object` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "object",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`dsaEncoding` {string}",
                          "name": "dsaEncoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`padding` {integer}",
                          "name": "padding",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`saltLength` {integer}",
                          "name": "saltLength",
                          "type": "integer"
                        }
                      ]
                    },
                    {
                      "textRaw": "`signature` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "signature",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`signatureEncoding` {string} The encoding of the `signature` string.",
                      "name": "signatureEncoding",
                      "type": "string",
                      "desc": "The encoding of the `signature` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` or `false` depending on the validity of the signature for the data and public key.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` or `false` depending on the validity of the signature for the data and public key."
                  }
                }
              ],
              "desc": "<p>Verifies the provided data using the given <code>object</code> and <code>signature</code>.</p>\n<p>If <code>object</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>object</code> had been passed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an\nobject, the following additional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to verify the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>, unless\nan MGF1 hash function has been specified as part of the key in compliance with\nsection 3.3 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_AUTO</code> (default) causes it to be\ndetermined automatically.</p>\n</li>\n</ul>\n<p>The <code>signature</code> argument is the previously calculated signature for the data, in\nthe <code>signatureEncoding</code>.\nIf a <code>signatureEncoding</code> is specified, the <code>signature</code> is expected to be a\nstring; otherwise <code>signature</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>The <code>verify</code> object can not be used again after <code>verify.verify()</code> has been\ncalled. Multiple calls to <code>verify.verify()</code> will result in an error being\nthrown.</p>\n<p>Because public keys can be derived from private keys, a private key may\nbe passed instead of a public key.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `X509Certificate`",
          "name": "X509Certificate",
          "type": "class",
          "meta": {
            "added": [
              "v15.6.0"
            ],
            "changes": []
          },
          "desc": "<p>Encapsulates an X509 certificate and provides read-only access to\nits information.</p>\n<pre><code class=\"language-mjs\">const { X509Certificate } = await import('node:crypto');\n\nconst x509 = new X509Certificate('{... pem encoded cert ...}');\n\nconsole.log(x509.subject);\n</code></pre>\n<pre><code class=\"language-cjs\">const { X509Certificate } = require('node:crypto');\n\nconst x509 = new X509Certificate('{... pem encoded cert ...}');\n\nconsole.log(x509.subject);\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new X509Certificate(buffer)`",
              "name": "X509Certificate",
              "type": "ctor",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`buffer` {string|TypedArray|Buffer|DataView} A PEM or DER encoded X509 Certificate.",
                  "name": "buffer",
                  "type": "string|TypedArray|Buffer|DataView",
                  "desc": "A PEM or DER encoded X509 Certificate."
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean} Will be `true` if this is a Certificate Authority (CA) certificate.",
              "name": "ca",
              "type": "boolean",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "Will be `true` if this is a Certificate Authority (CA) certificate."
            },
            {
              "textRaw": "Type: {string}",
              "name": "fingerprint",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The SHA-1 fingerprint of this certificate.</p>\n<p>Because SHA-1 is cryptographically broken and because the security of SHA-1 is\nsignificantly worse than that of algorithms that are commonly used to sign\ncertificates, consider using <a href=\"#x509fingerprint256\"><code>x509.fingerprint256</code></a> instead.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "fingerprint256",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The SHA-256 fingerprint of this certificate.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "fingerprint512",
              "type": "string",
              "meta": {
                "added": [
                  "v17.2.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The SHA-512 fingerprint of this certificate.</p>\n<p>Because computing the SHA-256 fingerprint is usually faster and because it is\nonly half the size of the SHA-512 fingerprint, <a href=\"#x509fingerprint256\"><code>x509.fingerprint256</code></a> may be\na better choice. While SHA-512 presumably provides a higher level of security in\ngeneral, the security of SHA-256 matches that of most algorithms that are\ncommonly used to sign certificates.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "infoAccess",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.1",
                      "v16.13.2"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/300",
                    "description": "Parts of this string may be encoded as JSON string literals in response to CVE-2021-44532."
                  }
                ]
              },
              "desc": "<p>A textual representation of the certificate's authority information access\nextension.</p>\n<p>This is a line feed separated list of access descriptions. Each line begins with\nthe access method and the kind of the access location, followed by a colon and\nthe value associated with the access location.</p>\n<p>After the prefix denoting the access method and the kind of the access location,\nthe remainder of each line might be enclosed in quotes to indicate that the\nvalue is a JSON string literal. For backward compatibility, Node.js only uses\nJSON string literals within this property when necessary to avoid ambiguity.\nThird-party code should be prepared to handle both possible entry formats.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "issuer",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The issuer identification included in this certificate.</p>"
            },
            {
              "textRaw": "Type: {X509Certificate}",
              "name": "issuerCertificate",
              "type": "X509Certificate",
              "meta": {
                "added": [
                  "v15.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The issuer certificate or <code>undefined</code> if the issuer certificate is not\navailable.</p>"
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "keyUsage",
              "type": "string[]",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>An array detailing the key extended usages for this certificate.</p>"
            },
            {
              "textRaw": "Type: {KeyObject}",
              "name": "publicKey",
              "type": "KeyObject",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The public key <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> for this certificate.</p>"
            },
            {
              "textRaw": "Type: {Buffer}",
              "name": "raw",
              "type": "Buffer",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>A <code>Buffer</code> containing the DER encoding of this certificate.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "serialNumber",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The serial number of this certificate.</p>\n<p>Serial numbers are assigned by certificate authorities and do not uniquely\nidentify certificates. Consider using <a href=\"#x509fingerprint256\"><code>x509.fingerprint256</code></a> as a unique\nidentifier instead.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "subject",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The complete subject of this certificate.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "subjectAltName",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.1",
                      "v16.13.2"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/300",
                    "description": "Parts of this string may be encoded as JSON string literals in response to CVE-2021-44532."
                  }
                ]
              },
              "desc": "<p>The subject alternative name specified for this certificate.</p>\n<p>This is a comma-separated list of subject alternative names. Each entry begins\nwith a string identifying the kind of the subject alternative name followed by\na colon and the value associated with the entry.</p>\n<p>Earlier versions of Node.js incorrectly assumed that it is safe to split this\nproperty at the two-character sequence <code>', '</code> (see <a href=\"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532\">CVE-2021-44532</a>). However,\nboth malicious and legitimate certificates can contain subject alternative names\nthat include this sequence when represented as a string.</p>\n<p>After the prefix denoting the type of the entry, the remainder of each entry\nmight be enclosed in quotes to indicate that the value is a JSON string literal.\nFor backward compatibility, Node.js only uses JSON string literals within this\nproperty when necessary to avoid ambiguity. Third-party code should be prepared\nto handle both possible entry formats.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "validFrom",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time from which this certificate is valid.</p>"
            },
            {
              "textRaw": "Type: {Date}",
              "name": "validFromDate",
              "type": "Date",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time from which this certificate is valid, encapsulated in a <code>Date</code> object.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "validTo",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time until which this certificate is valid.</p>"
            },
            {
              "textRaw": "Type: {Date}",
              "name": "validToDate",
              "type": "Date",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time until which this certificate is valid, encapsulated in a <code>Date</code> object.</p>"
            },
            {
              "textRaw": "Type: {string|undefined}",
              "name": "signatureAlgorithm",
              "type": "string|undefined",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The algorithm used to sign the certificate or <code>undefined</code> if the signature algorithm is unknown by OpenSSL.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "signatureAlgorithmOid",
              "type": "string",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The OID of the algorithm used to sign the certificate.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`x509.checkEmail(email[, options])`",
              "name": "checkEmail",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41600",
                    "description": "The subject option now defaults to `'default'`."
                  },
                  {
                    "version": [
                      "v17.5.0",
                      "v16.14.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41599",
                    "description": "The `wildcards`, `partialWildcards`, `multiLabelWildcards`, and `singleLabelSubdomains` options have been removed since they had no effect."
                  },
                  {
                    "version": [
                      "v17.5.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41569",
                    "description": "The subject option can now be set to `'default'`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`email` {string}",
                      "name": "email",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`subject` {string} `'default'`, `'always'`, or `'never'`. **Default:** `'default'`.",
                          "name": "subject",
                          "type": "string",
                          "default": "`'default'`",
                          "desc": "`'default'`, `'always'`, or `'never'`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined} Returns `email` if the certificate matches, `undefined` if it does not.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "Returns `email` if the certificate matches, `undefined` if it does not."
                  }
                }
              ],
              "desc": "<p>Checks whether the certificate matches the given email address.</p>\n<p>If the <code>'subject'</code> option is undefined or set to <code>'default'</code>, the certificate\nsubject is only considered if the subject alternative name extension either does\nnot exist or does not contain any email addresses.</p>\n<p>If the <code>'subject'</code> option is set to <code>'always'</code> and if the subject alternative\nname extension either does not exist or does not contain a matching email\naddress, the certificate subject is considered.</p>\n<p>If the <code>'subject'</code> option is set to <code>'never'</code>, the certificate subject is never\nconsidered, even if the certificate contains no subject alternative names.</p>"
            },
            {
              "textRaw": "`x509.checkHost(name[, options])`",
              "name": "checkHost",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41600",
                    "description": "The subject option now defaults to `'default'`."
                  },
                  {
                    "version": [
                      "v17.5.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41569",
                    "description": "The subject option can now be set to `'default'`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`subject` {string} `'default'`, `'always'`, or `'never'`. **Default:** `'default'`.",
                          "name": "subject",
                          "type": "string",
                          "default": "`'default'`",
                          "desc": "`'default'`, `'always'`, or `'never'`."
                        },
                        {
                          "textRaw": "`wildcards` {boolean} **Default:** `true`.",
                          "name": "wildcards",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`partialWildcards` {boolean} **Default:** `true`.",
                          "name": "partialWildcards",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`multiLabelWildcards` {boolean} **Default:** `false`.",
                          "name": "multiLabelWildcards",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`singleLabelSubdomains` {boolean} **Default:** `false`.",
                          "name": "singleLabelSubdomains",
                          "type": "boolean",
                          "default": "`false`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined} Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`."
                  }
                }
              ],
              "desc": "<p>Checks whether the certificate matches the given host name.</p>\n<p>If the certificate matches the given host name, the matching subject name is\nreturned. The returned name might be an exact match (e.g., <code>foo.example.com</code>)\nor it might contain wildcards (e.g., <code>*.example.com</code>). Because host name\ncomparisons are case-insensitive, the returned subject name might also differ\nfrom the given <code>name</code> in capitalization.</p>\n<p>If the <code>'subject'</code> option is undefined or set to <code>'default'</code>, the certificate\nsubject is only considered if the subject alternative name extension either does\nnot exist or does not contain any DNS names. This behavior is consistent with\n<a href=\"https://www.rfc-editor.org/rfc/rfc2818.txt\">RFC 2818</a> (\"HTTP Over TLS\").</p>\n<p>If the <code>'subject'</code> option is set to <code>'always'</code> and if the subject alternative\nname extension either does not exist or does not contain a matching DNS name,\nthe certificate subject is considered.</p>\n<p>If the <code>'subject'</code> option is set to <code>'never'</code>, the certificate subject is never\nconsidered, even if the certificate contains no subject alternative names.</p>"
            },
            {
              "textRaw": "`x509.checkIP(ip)`",
              "name": "checkIP",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.5.0",
                      "v16.14.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41571",
                    "description": "The `options` argument has been removed since it had no effect."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ip` {string}",
                      "name": "ip",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined} Returns `ip` if the certificate matches, `undefined` if it does not.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "Returns `ip` if the certificate matches, `undefined` if it does not."
                  }
                }
              ],
              "desc": "<p>Checks whether the certificate matches the given IP address (IPv4 or IPv6).</p>\n<p>Only <a href=\"https://www.rfc-editor.org/rfc/rfc5280.txt\">RFC 5280</a> <code>iPAddress</code> subject alternative names are considered, and they\nmust match the given <code>ip</code> address exactly. Other subject alternative names as\nwell as the subject field of the certificate are ignored.</p>"
            },
            {
              "textRaw": "`x509.checkIssued(otherCert)`",
              "name": "checkIssued",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherCert` {X509Certificate}",
                      "name": "otherCert",
                      "type": "X509Certificate"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Checks whether this certificate was potentially issued by the given <code>otherCert</code>\nby comparing the certificate metadata.</p>\n<p>This is useful for pruning a list of possible issuer certificates which have been\nselected using a more rudimentary filtering routine, i.e. just based on subject\nand issuer names.</p>\n<p>Finally, to verify that this certificate's signature was produced by a private key\ncorresponding to <code>otherCert</code>'s public key use <a href=\"#x509verifypublickey\"><code>x509.verify(publicKey)</code></a>\nwith <code>otherCert</code>'s public key represented as a <a href=\"#class-keyobject\"><code>KeyObject</code></a>\nlike so</p>\n<pre><code class=\"language-js\">if (!x509.verify(otherCert.publicKey)) {\n  throw new Error('otherCert did not issue x509');\n}\n</code></pre>"
            },
            {
              "textRaw": "`x509.checkPrivateKey(privateKey)`",
              "name": "checkPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {KeyObject} A private key.",
                      "name": "privateKey",
                      "type": "KeyObject",
                      "desc": "A private key."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Checks whether the public key for this certificate is consistent with\nthe given private key.</p>"
            },
            {
              "textRaw": "`x509.toJSON()`",
              "name": "toJSON",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>There is no standard JSON encoding for X509 certificates. The\n<code>toJSON()</code> method returns a string containing the PEM encoded\ncertificate.</p>"
            },
            {
              "textRaw": "`x509.toLegacyObject()`",
              "name": "toLegacyObject",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns information about this certificate using the legacy\n<a href=\"tls.html#certificate-object\">certificate object</a> encoding.</p>"
            },
            {
              "textRaw": "`x509.toString()`",
              "name": "toString",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns the PEM-encoded certificate.</p>"
            },
            {
              "textRaw": "`x509.verify(publicKey)`",
              "name": "verify",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {KeyObject} A public key.",
                      "name": "publicKey",
                      "type": "KeyObject",
                      "desc": "A public key."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Verifies that this certificate was signed by the given public key.\nDoes not perform any other validation checks on the certificate.</p>"
            }
          ]
        }
      ],
      "displayName": "Crypto"
    }
  ]
}