{
  "id": "task_libraries:digital-signature/javascript",
  "path": "/exapedia/javascript-digital-signature-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "JavaScript digital signature libraries",
  "answer": [
    {
      "t": "fact",
      "fact": "F109"
    },
    {
      "t": "text",
      "text": " A verified signature shows that the data came from the key holder and has not changed since signing. These libraries sign the login tokens, API requests, software releases, and certificates that apps and services exchange."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "JavaScript digital signature libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#jose",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F147"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwa",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F167"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jsonwebtoken",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F187"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#forge",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F207"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#tweetnacl",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F225"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#noble-curves",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F245"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#peculiar-xfivezeronine",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F263"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F272"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F267"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "npm"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#jose",
          "label": [
            {
              "t": "fact",
              "fact": "F1"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F131"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "JWS envelopes",
            "Certificate issuance"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#jose",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F147"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jwa",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F167"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jsonwebtoken",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F187"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#forge",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F207"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#tweetnacl",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F225"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#noble-curves",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F245"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F253"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#peculiar-xfivezeronine",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F263"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F273"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F274"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "jose",
          "name": [
            {
              "t": "fact",
              "fact": "F130"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/panva/jose"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/jose"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/panva/jose",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/better-auth/better-auth",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F145"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "export async function signJWT(\n\tctx: GenericEndpointContext,\n\tconfig: {\n\t\toptions?: JwtOptions | undefined;\n\t\tpayload: JWTPayloadWithOptional;\n\t\t/** Pre-resolved key from resolveSigningKey. Skips redundant DB lookup. */\n\t\tresolvedKey?: ResolvedSigningKey;\n\t\t/**\n\t\t * Extra JWS Protected Header parameters to merge with the defaults\n\t\t * (`alg` and `kid`). Used by token profiles that require an explicit\n\t\t * media type, such as OIDC Back-Channel Logout's `typ: \"logout+jwt\"`.\n\t\t *\n\t\t * @see https://www.rfc-editor.org/rfc/rfc8725#section-3.11\n\t\t */\n\t\theader?: {\n\t\t\ttyp?: string;\n\t\t\tcty?: string;\n\t\t};\n\t\t/**\n\t\t * Optional override for the signing key. When set, looks up the key\n\t\t * by its `id` (matches the JWS `kid` header) via the JWKS adapter.\n\t\t * Throws if no key with that id exists.\n\t\t *\n\t\t * When unset, falls back to the most recently created key with the\n\t\t * primary `keyPairConfig.alg` (the historical default).\n\t\t */\n\t\tsigningKeyId?: string | undefined;\n\t\t/**\n\t\t * Optional override for the signing algorithm. Selects the most\n\t\t * recent key with this algorithm. When neither this nor\n\t\t * `signingKeyId` is set, the most recent key matching\n\t\t * `keyPairConfig.alg` is used (historical default).\n\t\t *\n\t\t * If both `signingKeyId` and `signingAlgorithm` are set, `signingKeyId`\n\t\t * wins; the algorithm is validated to match the resolved key and\n\t\t * the call throws on mismatch.\n\t\t */\n\t\tsigningAlgorithm?: JWSAlgorithms | undefined;\n\t},\n) {\n\tconst { options } = config;\n\tconst payload = config.payload as JWTPayload;\n\n\t// Iat\n\tconst nowSeconds = Math.floor(Date.now() / 1000);\n\tconst iat = payload.iat!;\n\n\t// Exp\n\tlet exp = payload.exp;\n\tconst defaultExp = toExpJWT(\n\t\toptions?.jwt?.expirationTime ?? \"15m\",\n\t\tiat ?? nowSeconds,\n\t);\n\texp = exp ?? defaultExp;\n\n\t// Nbf\n\tconst nbf = payload.nbf!;\n\n\t// Empty only for a direct `auth.api` call when no baseURL is configured\n\tconst baseURLOrigin =\n\t\ttypeof ctx.context.options.baseURL === \"string\"\n\t\t\t? ctx.context.options.baseURL\n\t\t\t: \"\";\n\n\t// Iss\n\tconst iss = payload.iss;\n\tconst defaultIss = options?.jwt?.issuer ?? baseURLOrigin;\n\n\t// Aud\n\tconst aud = payload.aud;\n\tconst defaultAud = options?.jwt?.audience ?? baseURLOrigin;\n\n\tif (!(iss ?? defaultIss) || !(aud ?? defaultAud)) {\n\t\tctx.context.logger.warn(\n\t\t\t\"[better-auth] The JWT plugin signed a JWT without an issuer or audience because no base URL was resolved for this call. Set `baseURL`, or `jwt.issuer` and `jwt.audience` in the JWT plugin options.\",\n\t\t);\n\t}\n\n\t// Custom/remote signing function\n\tif (options?.jwt?.sign) {\n\t\tconst jwtPayload = {\n\t\t\t...payload,\n\t\t\tiat,\n\t\t\texp,\n\t\t\tnbf,\n\t\t\tiss: iss ?? defaultIss,\n\t\t\taud: aud ?? defaultAud,\n\t\t};\n\t\t// Forward extra protected-header parameters (e.g. `typ: \"logout+jwt\"`)\n\t\t// so profiles that require an explicit media type stay conformant even\n\t\t// with a remote signer. The signer still owns `alg`/`kid`. Also forward\n\t\t// per-call signing overrides as a third arg so remote KMS integrations\n\t\t// can honor per-resource kid/alg pinning. Both extra args are optional,\n\t\t// so existing single-arg implementations continue to work unchanged.\n\t\treturn options.jwt.sign(jwtPayload, config.header, {\n\t\t\tsigningKeyId: config.signingKeyId,\n\t\t\tsigningAlgorithm: config.signingAlgorithm,\n\t\t});\n\t}\n\n\t// Use pre-resolved key if available, otherwise resolve from DB with\n\t// any per-call overrides plumbed through.\n\tconst { alg, kid, privateKey } =\n\t\tconfig.resolvedKey ??\n\t\t(await resolveSigningKey(ctx, options, {\n\t\t\tsigningKeyId: config.signingKeyId,\n\t\t\tsigningAlgorithm: config.signingAlgorithm,\n\t\t}))!;\n\n\tconst jwt = new SignJWT(payload)\n\t\t.setProtectedHeader({\n\t\t\t// Spread caller header first so the resolved `alg`/`kid` always win.\n\t\t\t...config.header,\n\t\t\talg,\n\t\t\tkid,\n\t\t})\n\t\t.setExpirationTime(exp)\n\t\t.setIssuer(iss ?? defaultIss)\n\t\t.setAudience(aud ?? defaultAud);\n\tif (iat) jwt.setIssuedAt(iat);\n\tif (payload.sub) jwt.setSubject(payload.sub);\n\tif (payload.nbf) jwt.setNotBefore(payload.nbf);\n\tif (payload.jti) jwt.setJti(payload.jti);\n\treturn await jwt.sign(privateKey);\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/better-auth/better-auth/blob/8382ce613f04bf590d3cb6c1363dfd0e41110944/packages/better-auth/src/plugins/jwt/sign.ts#L232-L356",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20jose%20for%20digital%20signatures%20with%20signing%20verification%20and%20key%20imports&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import * as jose from \"jose\";\n\nconst { privateKey } = await jose.generateKeyPair(\"ES256\");\nconst token = await new jose.SignJWT({ sub: \"example\" })\n  .setProtectedHeader({ alg: \"ES256\" })\n  .sign(privateKey);\nconsole.log(token);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/panva/jose/blob/main/docs/jwt/sign/classes/SignJWT.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F135"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "jws",
          "name": [
            {
              "t": "fact",
              "fact": "F147"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/auth0/node-jws"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/jws"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F154"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jws",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F147"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F282"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F283"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F284"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F285"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jsonwebtoken",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "function (payload, secretOrPrivateKey, options, callback) {\n  if (typeof options === 'function') {\n    callback = options;\n    options = {};\n  } else {\n    options = options || {};\n  }\n\n  const isObjectPayload = typeof payload === 'object' &&\n                        !Buffer.isBuffer(payload);\n\n  const header = Object.assign({\n    alg: options.algorithm || 'HS256',\n    typ: isObjectPayload ? 'JWT' : undefined,\n    kid: options.keyid\n  }, options.header);\n\n  function failure(err) {\n    if (callback) {\n      return callback(err);\n    }\n    throw err;\n  }\n\n  if (!secretOrPrivateKey && options.algorithm !== 'none') {\n    return failure(new Error('secretOrPrivateKey must have a value'));\n  }\n\n  if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) {\n    try {\n      secretOrPrivateKey = createPrivateKey(secretOrPrivateKey)\n    } catch (_) {\n      try {\n        secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === 'string' ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey)\n      } catch (_) {\n        return failure(new Error('secretOrPrivateKey is not valid key material'));\n      }\n    }\n  }\n\n  if (header.alg.startsWith('HS') && secretOrPrivateKey.type !== 'secret') {\n    return failure(new Error((`secretOrPrivateKey must be a symmetric key when using ${header.alg}`)))\n  } else if (/^(?:RS|PS|ES)/.test(header.alg)) {\n    if (secretOrPrivateKey.type !== 'private') {\n      return failure(new Error((`secretOrPrivateKey must be an asymmetric key when using ${header.alg}`)))\n    }\n    if (!options.allowInsecureKeySizes &&\n      !header.alg.startsWith('ES') &&\n      secretOrPrivateKey.asymmetricKeyDetails !== undefined && //KeyObject.asymmetricKeyDetails is supported in Node 15+\n      secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) {\n      return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`));\n    }\n  }\n\n  if (typeof payload === 'undefined') {\n    return failure(new Error('payload is required'));\n  } else if (isObjectPayload) {\n    try {\n      validatePayload(payload);\n    }\n    catch (error) {\n      return failure(error);\n    }\n    if (!options.mutatePayload) {\n      payload = Object.assign({},payload);\n    }\n  } else {\n    const invalid_options = options_for_objects.filter(function (opt) {\n      return typeof options[opt] !== 'undefined';\n    });\n\n    if (invalid_options.length > 0) {\n      return failure(new Error('invalid ' + invalid_options.join(',') + ' option for ' + (typeof payload ) + ' payload'));\n    }\n  }\n\n  if (typeof payload.exp !== 'undefined' && typeof options.expiresIn !== 'undefined') {\n    return failure(new Error('Bad \"options.expiresIn\" option the payload already has an \"exp\" property.'));\n  }\n\n  if (typeof payload.nbf !== 'undefined' && typeof options.notBefore !== 'undefined') {\n    return failure(new Error('Bad \"options.notBefore\" option the payload already has an \"nbf\" property.'));\n  }\n\n  try {\n    validateOptions(options);\n  }\n  catch (error) {\n    return failure(error);\n  }\n\n  if (!options.allowInvalidAsymmetricKeyTypes) {\n    try {\n      validateAsymmetricKey(header.alg, secretOrPrivateKey);\n    } catch (error) {\n      return failure(error);\n    }\n  }\n\n  const timestamp = payload.iat || Math.floor(Date.now() / 1000);\n\n  if (options.noTimestamp) {\n    delete payload.iat;\n  } else if (isObjectPayload) {\n    payload.iat = timestamp;\n  }\n\n  if (typeof options.notBefore !== 'undefined') {\n    try {\n      payload.nbf = timespan(options.notBefore, timestamp);\n    }\n    catch (err) {\n      return failure(err);\n    }\n    if (typeof payload.nbf === 'undefined') {\n      return failure(new Error('\"notBefore\" should be a number of seconds or string representing a timespan eg: \"1d\", \"20h\", 60'));\n    }\n  }\n\n  if (typeof options.expiresIn !== 'undefined' && typeof payload === 'object') {\n    try {\n      payload.exp = timespan(options.expiresIn, timestamp);\n    }\n    catch (err) {\n      return failure(err);\n    }\n    if (typeof payload.exp === 'undefined') {\n      return failure(new Error('\"expiresIn\" should be a number of seconds or string representing a timespan eg: \"1d\", \"20h\", 60'));\n    }\n  }\n\n  Object.keys(options_to_payload).forEach(function (key) {\n    const claim = options_to_payload[key];\n    if (typeof options[key] !== 'undefined') {\n      if (typeof payload[claim] !== 'undefined') {\n        return failure(new Error('Bad \"options.' + key + '\" option. The payload already has an \"' + claim + '\" property.'));\n      }\n      payload[claim] = options[key];\n    }\n  });\n\n  const encoding = options.encoding || 'utf8';\n\n  if (typeof callback === 'function') {\n    callback = callback && once(callback);\n\n    jws.createSign({\n      header: header,\n      privateKey: secretOrPrivateKey,\n      payload: payload,\n      encoding: encoding\n    }).once('error', callback)\n      .once('done', function (signature) {\n        // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version\n        if(!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) {\n          return callback(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`))\n        }\n        callback(null, signature);\n      });\n  } else {\n    let signature = jws.sign({header: header, payload: payload, secret: secretOrPrivateKey, encoding: encoding});\n    // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version\n    if(!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) {\n      throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)\n    }\n    return signature\n  }\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jsonwebtoken/blob/b924272f29192e12926b5414546f7c5bfcc9579d/sign.js#L86-L253",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F164"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=jws%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F147"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const fs = require(\"node:fs\");\nconst jws = require(\"jws\");\nconst privateKey = fs.readFileSync(\"private.key\");\nconst signature = jws.sign({\n  header: { alg: \"RS256\" }, payload: \"example\", privateKey,\n});\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jws/blob/master/readme.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "readme.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F152"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "jwa",
          "name": [
            {
              "t": "fact",
              "fact": "F167"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/auth0/node-jwa"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/jwa"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F174"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jwa",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F167"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F286"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F287"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F288"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F289"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jws",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "function jwsSign(opts) {\n  var header = opts.header;\n  var payload = opts.payload;\n  var secretOrKey = opts.secret || opts.privateKey;\n  var encoding = opts.encoding;\n  var algo = jwa(header.alg);\n  var securedInput = jwsSecuredInput(header, payload, encoding);\n  var signature = algo.sign(securedInput, secretOrKey);\n  return util.format('%s.%s', securedInput, signature);\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jws/blob/44e90947915a238c5bca6bf66d5d7d36edb656a6/lib/sign-stream.js#L25-L34",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F184"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=jwa%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F167"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const fs = require(\"node:fs\");\nconst jwa = require(\"jwa\");\nconst privateKey = fs.readFileSync(\"ecdsa-p521-private.pem\");\nconst ecdsa = jwa(\"ES512\");\nconst signature = ecdsa.sign(\"very important stuff\", privateKey);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jwa/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F172"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "jsonwebtoken",
          "name": [
            {
              "t": "fact",
              "fact": "F187"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/auth0/node-jsonwebtoken"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/jsonwebtoken"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F194"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jsonwebtoken",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F187"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F290"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F291"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F292"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F293"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/umami-software/umami",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F205"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "export function parseToken(token: string, secret: any) {\n  try {\n    return jwt.verify(token, secret);\n  } catch {\n    return null;\n  }\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/umami-software/umami/blob/a3733b0424727ebe02b97aecf732e3891d677b76/src/lib/jwt.ts#L8-L14",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F204"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=jsonwebtoken%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F187"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const fs = require('node:fs');\nconst jwt = require('jsonwebtoken');\nconst privateKey = fs.readFileSync('private.key');\nconst token = jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256' });\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/auth0/node-jsonwebtoken/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F192"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "forge",
          "name": [
            {
              "t": "fact",
              "fact": "F207"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/digitalbazaar/forge"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/node-forge"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F38"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/digitalbazaar/forge",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F207"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F46"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/vbuch/node-signpdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F223"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async sign(pdfBuffer, signingTime = undefined) {\n    if (!(pdfBuffer instanceof Buffer)) {\n        throw new SignPdfError(\n            'PDF expected as Buffer.',\n            SignPdfError.TYPE_INPUT,\n        );\n    }\n\n    // Convert Buffer P12 to a forge implementation.\n    const p12Asn1 = forge.asn1.fromDer(this.cert);\n    const p12 = forge.pkcs12.pkcs12FromAsn1(\n        p12Asn1,\n        this.options.asn1StrictParsing,\n        this.options.passphrase,\n    );\n\n    // Extract safe bags by type.\n    // We will need all the certificates and the private key.\n    const certBags = p12.getBags({\n        bagType: forge.pki.oids.certBag,\n    })[forge.pki.oids.certBag];\n    const keyBags = p12.getBags({\n        bagType: forge.pki.oids.pkcs8ShroudedKeyBag,\n    })[forge.pki.oids.pkcs8ShroudedKeyBag];\n\n    const privateKey = keyBags[0].key;\n    // Here comes the actual PKCS#7 signing.\n    const p7 = forge.pkcs7.createSignedData();\n    // Start off by setting the content.\n    p7.content = forge.util.createBuffer(pdfBuffer.toString('binary'));\n\n    // Then add all the certificates (-cacerts & -clcerts)\n    // Keep track of the last found client certificate.\n    // This will be the public key that will be bundled in the signature.\n    let certificate;\n    Object.keys(certBags).forEach((i) => {\n        const {publicKey} = certBags[i].cert;\n\n        p7.addCertificate(certBags[i].cert);\n\n        // Try to find the certificate that matches the private key.\n        if (privateKey.n.compareTo(publicKey.n) === 0\n            && privateKey.e.compareTo(publicKey.e) === 0\n        ) {\n            certificate = certBags[i].cert;\n        }\n    });\n\n    if (typeof certificate === 'undefined') {\n        throw new SignPdfError(\n            'Failed to find a certificate that matches the private key.',\n            SignPdfError.TYPE_INPUT,\n        );\n    }\n\n    // Add a sha256 signer. That's what Adobe.PPKLite adbe.pkcs7.detached expects.\n    // Note that the authenticatedAttributes order is relevant for correct\n    // EU signature validation:\n    // https://ec.europa.eu/digital-building-blocks/DSS/webapp-demo/validation\n    p7.addSigner({\n        key: privateKey,\n        certificate,\n        digestAlgorithm: forge.pki.oids.sha256,\n        authenticatedAttributes: [\n            {\n                type: forge.pki.oids.contentType,\n                value: forge.pki.oids.data,\n            }, {\n                type: forge.pki.oids.signingTime,\n                // value can also be auto-populated at signing time\n                value: signingTime ?? new Date(),\n            }, {\n                type: forge.pki.oids.messageDigest,\n                // value will be auto-populated at signing time\n            },\n        ],\n    });\n\n    // Sign in detached mode.\n    p7.sign({detached: true});\n\n    return Buffer.from(forge.asn1.toDer(p7.toAsn1()).getBytes(), 'binary');\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/vbuch/node-signpdf/blob/95fb0fa05d46dda89bb5731d63eb306def4b8365/packages/signer-p12/src/P12Signer.js#L33-L115",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20node-forge%20for%20digital%20signatures%20with%20signing%20verification%20and%20key%20imports&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F207"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const forge = require(\"node-forge\");\nconst ed25519 = forge.pki.ed25519;\nconst keypair = ed25519.generateKeyPair();\nconst signature = ed25519.sign({\n  message: \"test\", encoding: \"utf8\", privateKey: keypair.privateKey,\n});\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/digitalbazaar/forge/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F212"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "tweetnacl",
          "name": [
            {
              "t": "fact",
              "fact": "F225"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/dchest/tweetnacl-js"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/tweetnacl"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F232"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/dchest/tweetnacl-js",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F225"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F294"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F295"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F296"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F297"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/solana-foundation/solana-web3.js",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F243"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "_verifySignatures(signData: Buffer, requireAllSignatures: boolean): boolean {\n  for (const {signature, publicKey} of this.signatures) {\n    if (signature === null) {\n      if (requireAllSignatures) {\n        return false;\n      }\n    } else {\n      if (\n        !nacl.sign.detached.verify(signData, signature, publicKey.toBuffer())\n      ) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/solana-foundation/solana-web3.js/blob/ef5a6daf1c404b51bdda186274a955276c8b6e90/src/transaction/legacy.ts#L702-L717",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F242"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=tweetnacl%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F225"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const nacl = require(\"tweetnacl\");\nconst keypair = nacl.sign.keyPair();\nconst message = new Uint8Array([1, 2, 3]);\nconst signature = nacl.sign.detached(message, keypair.secretKey);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/dchest/tweetnacl-js/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F230"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "noble-curves",
          "name": [
            {
              "t": "fact",
              "fact": "F245"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/paulmillr/noble-curves"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@noble/curves"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F63"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/paulmillr/noble-curves",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F245"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F71"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F261"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F262"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/dfinity/icp-js-core",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F261"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "public async sign(challenge: Uint8Array): Promise<Signature> {\n  // Some implementations of Ed25519 private keys append a public key to the end of the private key. We only want the private key.\n  const signature = ed25519.sign(challenge, this.#privateKey.slice(0, 32));\n  // add { __signature__: void; } to the signature to make it compatible with the agent\n\n  Object.defineProperty(signature, '__signature__', {\n    enumerable: false,\n    value: undefined,\n  });\n\n  return signature as Signature;\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/dfinity/icp-js-core/blob/eac56b8c6132a07059ae168dd5b6acb759fd15e8/packages/core/src/identity/identity/ed25519.ts#L211-L222",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F260"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20%40noble/curves%20for%20digital%20signatures%20with%20signing%20verification%20and%20key%20imports&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F245"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { ed25519 } from '@noble/curves/ed25519.js';\nconst { secretKey, publicKey } = ed25519.keygen();\nconst msg = new TextEncoder().encode('hello noble');\nconst sig = ed25519.sign(msg, secretKey);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/paulmillr/noble-curves/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F250"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "peculiar-xfivezeronine",
          "name": [
            {
              "t": "fact",
              "fact": "F263"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/PeculiarVentures/x509"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@peculiar/x509"
            },
            {
              "label": "Docs",
              "href": "https://peculiarventures.github.io/x509/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F270"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F272"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F266"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://peculiarventures.github.io/x509/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F263"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F298"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F299"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F300"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F301"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F280"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F281"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/jfromaniello/selfsigned",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F280"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "function buildExtensions(userExtensions, commonName) {\n  if (!userExtensions || userExtensions.length === 0) {\n    // Default extensions\n    return [\n      new BasicConstraintsExtension(false, undefined, true),\n      new KeyUsagesExtension(KeyUsageFlags.digitalSignature | KeyUsageFlags.keyEncipherment, true),\n      new ExtendedKeyUsageExtension([ExtendedKeyUsage.serverAuth, ExtendedKeyUsage.clientAuth], false),\n      new SubjectAlternativeNameExtension([\n        { type: 'dns', value: commonName },\n        ...(commonName === 'localhost' ? [{ type: 'ip', value: '127.0.0.1' }] : [])\n      ], false)\n    ];\n  }\n\n  // Convert user extensions from node-forge format to @peculiar/x509 format\n  const extensions = [];\n\n  for (const ext of userExtensions) {\n    const critical = ext.critical || false;\n\n    switch (ext.name) {\n      case 'basicConstraints':\n        extensions.push(new BasicConstraintsExtension(\n          ext.cA || false,\n          ext.pathLenConstraint,\n          critical\n        ));\n        break;\n\n      case 'keyUsage':\n        let flags = 0;\n        if (ext.digitalSignature) flags |= KeyUsageFlags.digitalSignature;\n        if (ext.nonRepudiation || ext.contentCommitment) flags |= KeyUsageFlags.nonRepudiation;\n        if (ext.keyEncipherment) flags |= KeyUsageFlags.keyEncipherment;\n        if (ext.dataEncipherment) flags |= KeyUsageFlags.dataEncipherment;\n        if (ext.keyAgreement) flags |= KeyUsageFlags.keyAgreement;\n        if (ext.keyCertSign) flags |= KeyUsageFlags.keyCertSign;\n        if (ext.cRLSign) flags |= KeyUsageFlags.cRLSign;\n        if (ext.encipherOnly) flags |= KeyUsageFlags.encipherOnly;\n        if (ext.decipherOnly) flags |= KeyUsageFlags.decipherOnly;\n        extensions.push(new KeyUsagesExtension(flags, critical));\n        break;\n\n      case 'extKeyUsage':\n        const usages = [];\n        if (ext.serverAuth) usages.push(ExtendedKeyUsage.serverAuth);\n        if (ext.clientAuth) usages.push(ExtendedKeyUsage.clientAuth);\n        if (ext.codeSigning) usages.push(ExtendedKeyUsage.codeSigning);\n        if (ext.emailProtection) usages.push(ExtendedKeyUsage.emailProtection);\n        if (ext.timeStamping) usages.push(ExtendedKeyUsage.timeStamping);\n        extensions.push(new ExtendedKeyUsageExtension(usages, critical));\n        break;\n\n      case 'subjectAltName':\n        const altNames = (ext.altNames || []).map(alt => {\n          // node-forge type values:\n          // 1 = email (rfc822Name)\n          // 2 = DNS\n          // 6 = URI\n          // 7 = IP\n          switch (alt.type) {\n            case 1: // email\n              return { type: 'email', value: alt.value };\n            case 2: // DNS\n              return { type: 'dns', value: alt.value };\n            case 6: // URI\n              return { type: 'url', value: alt.value };\n            case 7: // IP\n              return { type: 'ip', value: alt.ip || alt.value };\n            default:\n              // Try to infer type from properties\n              if (alt.ip) return { type: 'ip', value: alt.ip };\n              if (alt.dns) return { type: 'dns', value: alt.dns };\n              if (alt.email) return { type: 'email', value: alt.email };\n              if (alt.uri || alt.url) return { type: 'url', value: alt.uri || alt.url };\n              return { type: 'dns', value: alt.value };\n          }\n        });\n        extensions.push(new SubjectAlternativeNameExtension(altNames, critical));\n        break;\n\n      default:\n        // Skip unknown extensions with a warning\n        console.warn(`Unknown extension \"${ext.name}\" ignored`);\n    }\n  }\n\n  return extensions;\n}",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/jfromaniello/selfsigned/blob/master/index.js#L73-L161",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F279"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40peculiar/x509%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F263"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import \"reflect-metadata\";\nimport * as x509 from \"@peculiar/x509\";\n\nconst algorithm = { name: \"ECDSA\", namedCurve: \"P-256\", hash: \"SHA-256\" };\nconst keys = await crypto.subtle.generateKey(algorithm, false, [\"sign\", \"verify\"]);\nconst cert = await x509.X509CertificateGenerator.createSelfSigned({\n  name: \"CN=Example Root CA, O=Example Org, C=US\", keys, signingAlgorithm: algorithm,\n});\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/PeculiarVentures/x509/blob/master/website/docs/examples/certificates/self-signed.example.ts",
                  "label": [
                    {
                      "t": "text",
                      "text": "self-signed.example.ts"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F268"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "What is jsonwebtoken?",
      "a": [
        {
          "t": "link",
          "href": "#jsonwebtoken",
          "label": [
            {
              "t": "text",
              "text": "jsonwebtoken"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a Node.js implementation of JSON Web Tokens built on node-jws. Its verify function returns the decoded payload only when the signature and any expiration, audience, or issuer checks are valid."
        }
      ]
    },
    {
      "q": "What is node-forge?",
      "a": [
        {
          "t": "link",
          "href": "#forge",
          "label": [
            {
              "t": "text",
              "text": "Forge"
            }
          ]
        },
        {
          "t": "text",
          "text": ", published on npm as node-forge, is a pure JavaScript toolkit for RSA keys, signatures, signed-data messages, and certificates."
        }
      ]
    },
    {
      "q": "What is the difference between JWS and JWT?",
      "a": [
        {
          "t": "text",
          "text": "A JSON Web Signature (JWS) signs any payload, while a JSON Web Token (JWT) is a set of claims that usually travels inside a JWS. "
        },
        {
          "t": "link",
          "href": "#jws",
          "label": [
            {
              "t": "text",
              "text": "node-jws"
            }
          ]
        },
        {
          "t": "text",
          "text": " produces the signatures that "
        },
        {
          "t": "link",
          "href": "#jsonwebtoken",
          "label": [
            {
              "t": "text",
              "text": "jsonwebtoken"
            }
          ]
        },
        {
          "t": "text",
          "text": " builds its tokens on."
        }
      ]
    },
    {
      "q": "Should I use jose or jsonwebtoken?",
      "a": [
        {
          "t": "link",
          "href": "#jose",
          "label": [
            {
              "t": "text",
              "text": "jose"
            }
          ]
        },
        {
          "t": "text",
          "text": " covers JWS, JWT, and encrypted JWE messages across Node.js, browsers, and other web runtimes through WebCrypto. "
        },
        {
          "t": "link",
          "href": "#jsonwebtoken",
          "label": [
            {
              "t": "text",
              "text": "jsonwebtoken"
            }
          ]
        },
        {
          "t": "text",
          "text": " targets Node.js and signs and verifies JWTs only."
        }
      ]
    },
    {
      "q": "What is TweetNaCl?",
      "a": [
        {
          "t": "link",
          "href": "#tweetnacl",
          "label": [
            {
              "t": "text",
              "text": "TweetNaCl.js"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a port of the TweetNaCl cryptography library to JavaScript for browsers and Node.js. Its nacl.sign functions create and verify signatures with a public and secret key pair."
        }
      ]
    },
    {
      "q": "How is a digital signature different from encrypting data?",
      "a": [
        {
          "t": "fact",
          "fact": "F110"
        },
        {
          "t": "text",
          "text": " "
        },
        {
          "t": "fact",
          "fact": "F111"
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, jose",
      "display": "jose",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, jose",
      "display": "856.3M",
      "asOf": "2026-11-15"
    },
    "F3": {
      "label": "License, jose",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, jose",
      "display": "6.2.17",
      "asOf": "2026-11-17"
    },
    "F5": {
      "label": "Undated package release, jose",
      "display": "v6.2.17",
      "asOf": "2026-11-17"
    },
    "F6": {
      "label": "Repository stars, jose",
      "display": "7.9K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "RSA signatures, jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "EdDSA signatures, jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Key-pair generation, jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "PEM key import, jose",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, jose",
      "display": "npm install jose",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, jose",
      "display": "Provides JSON Web Signature and JSON Web Token APIs.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, jose",
      "display": "Supports general JSON signatures",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, jose",
      "display": "Use GeneralSign to produce a signed JSON JWS envelope.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, jose",
      "display": "Imports existing PEM keys",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, jose",
      "display": "Load supported public or private keys with the import helpers.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, jose",
      "display": "Algorithms depend on the runtime",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, jose",
      "display": "Select an algorithm supported by the target runtime.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, jose",
      "display": "Private keys start non-extractable",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, jose",
      "display": "Set extractable when generated private keys must be exported.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, jose",
      "display": "import * as jose from 'jose'\n\nconst alg = 'RS256'\nconst pkcs8 = `YOUR_PRIVATE_KEY_PEM`\nconst privateKey = await jose.importPKCS8(pkcs8, alg)\n\nconst jwt = await new jose.SignJWT({ 'urn:example:claim': true })\n  .setProtectedHeader({ alg })\n  .setIssuedAt()\n  .setIssuer('urn:example:issuer')\n  .setAudience('urn:example:audience')\n  .setExpirationTime('2h')\n  .sign(privateKey)\n\nconsole.log(jwt)\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, jose",
      "display": "export async function signJWT(\n\tctx: GenericEndpointContext,\n\tconfig: {\n\t\toptions?: JwtOptions | undefined;\n\t\tpayload: JWTPayloadWithOptional;\n\t\t/** Pre-resolved key from resolveSigningKey. Skips redundant DB lookup. */\n\t\tresolvedKey?: ResolvedSigningKey;\n\t\t/**\n\t\t * Extra JWS Protected Header parameters to merge with the defaults\n\t\t * (`alg` and `kid`). Used by token profiles that require an explicit\n\t\t * media type, such as OIDC Back-Channel Logout's `typ: \"logout+jwt\"`.\n\t\t *\n\t\t * @see https://www.rfc-editor.org/rfc/rfc8725#section-3.11\n\t\t */\n\t\theader?: {\n\t\t\ttyp?: string;\n\t\t\tcty?: string;\n\t\t};\n\t\t/**\n\t\t * Optional override for the signing key. When set, looks up the key\n\t\t * by its `id` (matches the JWS `kid` header) via the JWKS adapter.\n\t\t * Throws if no key with that id exists.\n\t\t *\n\t\t * When unset, falls back to the most recently created key with the\n\t\t * primary `keyPairConfig.alg` (the historical default).\n\t\t */\n\t\tsigningKeyId?: string | undefined;\n\t\t/**\n\t\t * Optional override for the signing algorithm. Selects the most\n\t\t * recent key with this algorithm. When neither this nor\n\t\t * `signingKeyId` is set, the most recent key matching\n\t\t * `keyPairConfig.alg` is used (historical default).\n\t\t *\n\t\t * If both `signingKeyId` and `signingAlgorithm` are set, `signingKeyId`\n\t\t * wins; the algorithm is validated to match the resolved key and\n\t\t * the call throws on mismatch.\n\t\t */\n\t\tsigningAlgorithm?: JWSAlgorithms | undefined;\n\t},\n) {\n\tconst { options } = config;\n\tconst payload = config.payload as JWTPayload;\n\n\t// Iat\n\tconst nowSeconds = Math.floor(Date.now() / 1000);\n\tconst iat = payload.iat!;\n\n\t// Exp\n\tlet exp = payload.exp;\n\tconst defaultExp = toExpJWT(\n\t\toptions?.jwt?.expirationTime ?? \"15m\",\n\t\tiat ?? nowSeconds,\n\t);\n\texp = exp ?? defaultExp;\n\n\t// Nbf\n\tconst nbf = payload.nbf!;\n\n\t// Empty only for a direct `auth.api` call when no baseURL is configured\n\tconst baseURLOrigin =\n\t\ttypeof ctx.context.options.baseURL === \"string\"\n\t\t\t? ctx.context.options.baseURL\n\t\t\t: \"\";\n\n\t// Iss\n\tconst iss = payload.iss;\n\tconst defaultIss = options?.jwt?.issuer ?? baseURLOrigin;\n\n\t// Aud\n\tconst aud = payload.aud;\n\tconst defaultAud = options?.jwt?.audience ?? baseURLOrigin;\n\n\tif (!(iss ?? defaultIss) || !(aud ?? defaultAud)) {\n\t\tctx.context.logger.warn(\n\t\t\t\"[better-auth] The JWT plugin signed a JWT without an issuer or audience because no base URL was resolved for this call. Set `baseURL`, or `jwt.issuer` and `jwt.audience` in the JWT plugin options.\",\n\t\t);\n\t}\n\n\t// Custom/remote signing function\n\tif (options?.jwt?.sign) {\n\t\tconst jwtPayload = {\n\t\t\t...payload,\n\t\t\tiat,\n\t\t\texp,\n\t\t\tnbf,\n\t\t\tiss: iss ?? defaultIss,\n\t\t\taud: aud ?? defaultAud,\n\t\t};\n\t\t// Forward extra protected-header parameters (e.g. `typ: \"logout+jwt\"`)\n\t\t// so profiles that require an explicit media type stay conformant even\n\t\t// with a remote signer. The signer still owns `alg`/`kid`. Also forward\n\t\t// per-call signing overrides as a third arg so remote KMS integrations\n\t\t// can honor per-resource kid/alg pinning. Both extra args are optional,\n\t\t// so existing single-arg implementations continue to work unchanged.\n\t\treturn options.jwt.sign(jwtPayload, config.header, {\n\t\t\tsigningKeyId: config.signingKeyId,\n\t\t\tsigningAlgorithm: config.signingAlgorithm,\n\t\t});\n\t}\n\n\t// Use pre-resolved key if available, otherwise resolve from DB with\n\t// any per-call overrides plumbed through.\n\tconst { alg, kid, privateKey } =\n\t\tconfig.resolvedKey ??\n\t\t(await resolveSigningKey(ctx, options, {\n\t\t\tsigningKeyId: config.signingKeyId,\n\t\t\tsigningAlgorithm: config.signingAlgorithm,\n\t\t}))!;\n\n\tconst jwt = new SignJWT(payload)\n\t\t.setProtectedHeader({\n\t\t\t// Spread caller header first so the resolved `alg`/`kid` always win.\n\t\t\t...config.header,\n\t\t\talg,\n\t\t\tkid,\n\t\t})\n\t\t.setExpirationTime(exp)\n\t\t.setIssuer(iss ?? defaultIss)\n\t\t.setAudience(aud ?? defaultAud);\n\tif (iat) jwt.setIssuedAt(iat);\n\tif (payload.sub) jwt.setSubject(payload.sub);\n\tif (payload.nbf) jwt.setNotBefore(payload.nbf);\n\tif (payload.jti) jwt.setJti(payload.jti);\n\treturn await jwt.sign(privateKey);\n}\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, jose",
      "display": "sign.ts · signJWT()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, jose",
      "display": "better-auth/better-auth",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, better-auth/better-auth",
      "display": "30.8K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, better-auth/better-auth",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F27": {
      "label": "Library name, node-forge",
      "display": "Forge",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, node-forge",
      "display": "206.0M",
      "asOf": "2026-11-15"
    },
    "F29": {
      "label": "License, node-forge",
      "display": "(BSD-3-Clause OR GPL-2.0)",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, node-forge",
      "display": "1.4.3",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Undated package release, node-forge",
      "display": "v1.4.3",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Repository stars, node-forge",
      "display": "5.4K",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "RSA signatures, node-forge",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "EdDSA signatures, node-forge",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Key-pair generation, node-forge",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "PEM key import, node-forge",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Install, node-forge",
      "display": "npm install node-forge",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "What it does, node-forge",
      "display": "Provides RSA and Ed25519 key generation and signature operations.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, node-forge",
      "display": "Builds certificate-backed signed messages",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, node-forge",
      "display": "Create PKCS signed data with certificates and authenticated attributes.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths lead, node-forge",
      "display": "Imports existing PEM public keys",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths, node-forge",
      "display": "Use publicKeyFromPem to load a PEM-encoded RSA public key.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, node-forge",
      "display": "Signed-data verification is unfinished",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, node-forge",
      "display": "PKCS signed-data verification remains unimplemented; use another verifier for those messages.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations lead, node-forge",
      "display": "Synchronous RSA generation blocks execution",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "limitations, node-forge",
      "display": "Use asynchronous key generation when the event loop must stay responsive.",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Quickstart, node-forge",
      "display": "var forge = require('..');\n\ntry {\n  // create PKCS#7 signed data\n  var p7 = forge.pkcs7.createSignedData();\n  p7.content = forge.util.createBuffer('Some content to be signed.', 'utf8');\n  var signers = ['a', 'b'];\n  for(var i = 0; i < signers.length; ++i) {\n    var signer = createSigner(signers[i]);\n    p7.addCertificate(signer.certificate);\n    p7.addSigner({\n      key: signer.keys.privateKey,\n      certificate: signer.certificate,\n      digestAlgorithm: forge.pki.oids.sha256,\n      authenticatedAttributes: [{\n        type: forge.pki.oids.contentType,\n        value: forge.pki.oids.data\n      }, {\n        type: forge.pki.oids.messageDigest\n        // value will be auto-populated at signing time\n      }, {\n        type: forge.pki.oids.signingTime\n        // value will be auto-populated at signing time\n        //value: new Date('2050-01-01T00:00:00Z')\n      }]\n    });\n  }\n\n  p7.sign();\n\n  var pem = forge.pkcs7.messageToPem(p7);\n  console.log('Signed PKCS #7 message:\\n' + pem);\n} catch(ex) {\n  if(ex.stack) {\n    console.log(ex.stack);\n  } else {\n    console.log('Error', ex);\n  }\n}\n\nfunction createSigner(name) {\n  console.log('Creating signer \"' + name + '\"...');\n\n  // generate a keypair\n  console.log('Generating 2048-bit key-pair...');\n  var keys = forge.pki.rsa.generateKeyPair(2048);\n  console.log('Key-pair created:');\n  console.log(forge.pki.privateKeyToPem(keys.privateKey));\n  console.log(forge.pki.publicKeyToPem(keys.publicKey));\n\n  // create a certificate\n  var certificate = createCertificate(name, keys);\n  console.log('Signer \"' + name + '\" created.');\n\n  return {\n    name: name,\n    keys: keys,\n    certificate: certificate\n  };\n}\n\nfunction createCertificate(name, keys) {\n  // create a certificate\n  console.log('Creating self-signed certificate...');\n  var cert = forge.pki.createCertificate();\n  cert.publicKey = keys.publicKey;\n  cert.serialNumber = '01';\n  cert.validity.notBefore = new Date();\n  cert.validity.notAfter = new Date();\n  cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 1);\n  var attrs = [{\n    name: 'commonName',\n    value: name\n  }, {\n    name: 'countryName',\n    value: 'US'\n  }, {\n    shortName: 'ST',\n    value: 'Virginia'\n  }, {\n    name: 'localityName',\n    value: 'Blacksburg'\n  }, {\n    name: 'organizationName',\n    value: 'Test'\n  }, {\n    shortName: 'OU',\n    value: 'Test'\n  }];\n  cert.setSubject(attrs);\n  cert.setIssuer(attrs);\n  cert.setExtensions([{\n    name: 'basicConstraints',\n    cA: true\n  }, {\n    name: 'keyUsage',\n    keyCertSign: true,\n    digitalSignature: true,\n    nonRepudiation: true,\n    keyEncipherment: true,\n    dataEncipherment: true\n  }, {\n    name: 'subjectAltName',\n    altNames: [{\n      type: 6, // URI\n      value: 'http://example.org/webid#me'\n    }]\n  }]);\n\n  // self-sign certificate\n  cert.sign(keys.privateKey);\n  console.log('Certificate created: \\n' + forge.pki.certificateToPem(cert));\n\n  return cert;\n}\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Quickstart source reference, node-forge",
      "display": "sign-p7.js",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project function, node-forge",
      "display": "async sign(pdfBuffer, signingTime = undefined) {\n        if (!(pdfBuffer instanceof Buffer)) {\n            throw new SignPdfError(\n                'PDF expected as Buffer.',\n                SignPdfError.TYPE_INPUT,\n            );\n        }\n\n        // Convert Buffer P12 to a forge implementation.\n        const p12Asn1 = forge.asn1.fromDer(this.cert);\n        const p12 = forge.pkcs12.pkcs12FromAsn1(\n            p12Asn1,\n            this.options.asn1StrictParsing,\n            this.options.passphrase,\n        );\n\n        // Extract safe bags by type.\n        // We will need all the certificates and the private key.\n        const certBags = p12.getBags({\n            bagType: forge.pki.oids.certBag,\n        })[forge.pki.oids.certBag];\n        const keyBags = p12.getBags({\n            bagType: forge.pki.oids.pkcs8ShroudedKeyBag,\n        })[forge.pki.oids.pkcs8ShroudedKeyBag];\n\n        const privateKey = keyBags[0].key;\n        // Here comes the actual PKCS#7 signing.\n        const p7 = forge.pkcs7.createSignedData();\n        // Start off by setting the content.\n        p7.content = forge.util.createBuffer(pdfBuffer.toString('binary'));\n\n        // Then add all the certificates (-cacerts & -clcerts)\n        // Keep track of the last found client certificate.\n        // This will be the public key that will be bundled in the signature.\n        let certificate;\n        Object.keys(certBags).forEach((i) => {\n            const {publicKey} = certBags[i].cert;\n\n            p7.addCertificate(certBags[i].cert);\n\n            // Try to find the certificate that matches the private key.\n            if (privateKey.n.compareTo(publicKey.n) === 0\n                && privateKey.e.compareTo(publicKey.e) === 0\n            ) {\n                certificate = certBags[i].cert;\n            }\n        });\n\n        if (typeof certificate === 'undefined') {\n            throw new SignPdfError(\n                'Failed to find a certificate that matches the private key.',\n                SignPdfError.TYPE_INPUT,\n            );\n        }\n\n        // Add a sha256 signer. That's what Adobe.PPKLite adbe.pkcs7.detached expects.\n        // Note that the authenticatedAttributes order is relevant for correct\n        // EU signature validation:\n        // https://ec.europa.eu/digital-building-blocks/DSS/webapp-demo/validation\n        p7.addSigner({\n            key: privateKey,\n            certificate,\n            digestAlgorithm: forge.pki.oids.sha256,\n            authenticatedAttributes: [\n                {\n                    type: forge.pki.oids.contentType,\n                    value: forge.pki.oids.data,\n                }, {\n                    type: forge.pki.oids.signingTime,\n                    // value can also be auto-populated at signing time\n                    value: signingTime ?? new Date(),\n                }, {\n                    type: forge.pki.oids.messageDigest,\n                    // value will be auto-populated at signing time\n                },\n            ],\n        });\n\n        // Sign in detached mode.\n        p7.sign({detached: true});\n\n        return Buffer.from(forge.asn1.toDer(p7.toAsn1()).getBytes(), 'binary');\n    }\n",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project function reference, node-forge",
      "display": "P12Signer.js · sign()",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project repository, node-forge",
      "display": "vbuch/node-signpdf",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Project stars, vbuch/node-signpdf",
      "display": "943",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Project push date, vbuch/node-signpdf",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F54": {
      "label": "Library name, @noble/curves",
      "display": "noble-curves",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Monthly downloads, @noble/curves",
      "display": "184.5M",
      "asOf": "2026-11-15"
    },
    "F56": {
      "label": "License, @noble/curves",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Package release, @noble/curves",
      "display": "2.4.0",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Undated package release, @noble/curves",
      "display": "v2.4.0",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Repository stars, @noble/curves",
      "display": "972",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "EdDSA signatures, @noble/curves",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Key-pair generation, @noble/curves",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Install, @noble/curves",
      "display": "npm install @noble/curves",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "What it does, @noble/curves",
      "display": "Provides ECDSA, EdDSA, Schnorr, and BLS signing primitives.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, @noble/curves",
      "display": "Supports several curve signature schemes",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, @noble/curves",
      "display": "Use ECDSA, EdDSA, Schnorr, or BLS through the curve modules.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, @noble/curves",
      "display": "Can sign already-hashed messages",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, @noble/curves",
      "display": "Set prehash=false when passing an existing ECDSA digest.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, @noble/curves",
      "display": "Hashes ECDSA messages by default",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, @noble/curves",
      "display": "Disable prehash when the application already supplies the required digest.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations lead, @noble/curves",
      "display": "DER signatures need explicit configuration",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations, @noble/curves",
      "display": "Specify the DER format when verifying DER-encoded ECDSA signatures.",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Quickstart, @noble/curves",
      "display": "// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size\nimport { secp256k1 } from '@noble/curves/secp256k1.js';\nconst { secretKey, publicKey } = secp256k1.keygen();\nconst msg = new TextEncoder().encode('hello noble');\nconst sig = secp256k1.sign(msg, secretKey);\nconst isValid = secp256k1.verify(sig, msg, publicKey);\n",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project function, @noble/curves",
      "display": "export function ed25519Sign(\n    message: Uint8Array,\n    privateKey: Uint8Array,\n): Uint8Array | Error {\n    try {\n        return ed25519.sign(message, privateKey);\n    } catch (error: unknown) {\n        return wrapError(error, \"Error signing message with Ed25519 key\");\n    }\n}\n",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project function reference, @noble/curves",
      "display": "cryptography.ts · ed25519Sign()",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project repository, @noble/curves",
      "display": "Psiphon-Inc/conduit",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project stars, Psiphon-Inc/conduit",
      "display": "255",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Project push date, Psiphon-Inc/conduit",
      "display": "Sep 2026",
      "asOf": "2026-09-30"
    },
    "F78": {
      "label": "Library name, elliptic",
      "display": "elliptic",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Monthly downloads, elliptic",
      "display": "64.9M",
      "asOf": "2026-11-15"
    },
    "F80": {
      "label": "License, elliptic",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Package release, elliptic",
      "display": "6.6.1",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Undated package release, elliptic",
      "display": "v6.6.1",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Repository stars, elliptic",
      "display": "1.8K",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "EdDSA signatures, elliptic",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Key-pair generation, elliptic",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Install, elliptic",
      "display": "npm install elliptic",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "What it does, elliptic",
      "display": "Provides elliptic-curve cryptography in JavaScript.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths lead, elliptic",
      "display": "Exports DER-encoded ECDSA signatures",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths, elliptic",
      "display": "Use signature.toDER() when the receiving system expects DER encoding.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths lead, elliptic",
      "display": "Also supports Edwards signatures",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths, elliptic",
      "display": "Use the eddsa constructor for Ed25519 message signatures.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "limitations lead, elliptic",
      "display": "ECDSA expects a message digest",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations, elliptic",
      "display": "Hash the message before calling the ECDSA signing API.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Quickstart, elliptic",
      "display": "var EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign the message's hash (input must be an array, or a hex-string)\nvar msgHash = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msgHash);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msgHash, derSign));\n\n",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Developer need",
      "display": "Producing standardized signed JSON messages",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Why choose jose",
      "display": "General JWS JSON Serialization",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need in introduction",
      "display": "producing standardized signed JSON messages",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "When to consider node-forge",
      "display": "certificates and PKCS signed-data containers are required",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need",
      "display": "Signing with explicit curve primitives",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Why choose @noble/curves",
      "display": "the ECDSA, EdDSA, Schnorr, and BLS modules",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need in introduction",
      "display": "signing with explicit curve primitives",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need",
      "display": "Creating certificate-backed signed-data messages",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose node-forge",
      "display": "PKCS signed data and authenticated attributes",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "creating certificate-backed signed-data messages",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "When to consider jose",
      "display": "standardized JSON JWS messages cover the integration",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need",
      "display": "Returning DER-encoded ECDSA signatures",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Why choose elliptic",
      "display": "signature.toDER output",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need in introduction",
      "display": "returning DER-encoded ECDSA signatures",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Page introduction",
      "display": "JavaScript digital signature libraries sign data with a private key and verify the signature with the matching public key.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: How is a digital signature different from encrypting data?",
      "display": "jose JWS signing creates signed messages, while its JWE support handles encrypted messages.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: How is a digital signature different from encrypting data?",
      "display": "Forge separately exposes signing/verifying and encryption/decryption APIs.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Which library provides a standard signed JSON envelope?",
      "display": "jose GeneralSign produces General JWS JSON Serialization with digital signatures or MACs.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Do all jose operations create public-key signatures?",
      "display": "SignJWT can use a digital signature or a symmetric MAC; the own public-key example uses an imported RSA key.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Which libraries support Edwards signatures?",
      "display": "noble-curves includes the Ed25519 curve module.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Which libraries support Edwards signatures?",
      "display": "Forge includes Ed25519 key generation and signing/verifying.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Which libraries support Edwards signatures?",
      "display": "elliptic exposes Ed25519 through its eddsa constructor.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Which libraries support Edwards signatures?",
      "display": "jose key generation supports Ed25519 subject to runtime support.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Should ECDSA receive a raw message or an existing digest?",
      "display": "Current noble-curves ECDSA hashes raw messages by default; prehash=false lets callers supply a digest.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Should ECDSA receive a raw message or an existing digest?",
      "display": "The elliptic ECDSA example signs a message-hash input.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: How should DER-encoded ECDSA signatures be handled?",
      "display": "elliptic Signature.toDER exports DER encoding.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: How should DER-encoded ECDSA signatures be handled?",
      "display": "Current noble-curves verification requires the explicit der format option for DER signatures.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can existing PEM keys be imported?",
      "display": "jose imports PEM formats including SPKI, certificates, and private PKCS containers.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Can existing PEM keys be imported?",
      "display": "Forge pki helpers load PEM-formatted private keys.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Can Forge verify the signed-data messages it creates?",
      "display": "Its PKCS signed-data verify method throws an unimplemented-verification error.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Why prefer asynchronous RSA key generation in Forge?",
      "display": "The own API warns synchronous generation can block JavaScript execution and recommends its asynchronous variant.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Does a PDF signing integration mean Forge exports PDFs?",
      "display": "The project adapter creates a detached PKCS signature, then returns its DER bytes as an application Buffer.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: How does the project choose local versus remote signing?",
      "display": "The Better Auth example supplies application claim defaults, resolves a signing key, and optionally delegates to a remote signer.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: How does the project choose local versus remote signing?",
      "display": "Its local signer explicitly sets issuer and audience values around the native JWT builder.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: What does a verifier return when an application wrapper catches errors?",
      "display": "The native curve verification result is returned on success; the application wrapper converts thrown errors into its own Error result.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "Library name, jose",
      "display": "jose",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Monthly downloads, jose",
      "display": "878.5M",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "License, jose",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Package release, jose",
      "display": "6.2.17",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Package release date, jose",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Install, jose",
      "display": "npm install jose",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Quickstart, jose",
      "display": "import * as jose from \"jose\";\n\nconst { privateKey } = await jose.generateKeyPair(\"ES256\");\nconst token = await new jose.SignJWT({ sub: \"example\" })\n  .setProtectedHeader({ alg: \"ES256\" })\n  .sign(privateKey);\nconsole.log(token);\n",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Repository stars, jose",
      "display": "7.9K",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "JWS envelopes, jose",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Certificate issuance, jose",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Signature layer and role, jose",
      "display": "WebCrypto-oriented JOSE/JWS/JWT toolkit across supported web runtimes.",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "First-call prerequisites, jose",
      "display": "[\"Disclosed minimal ES-module API recipe replaces a lengthy static demonstration private key with official generateKeyPair setup. Requires a supported WebCrypto runtime and secure randomness; keys are generated locally when a reader runs the snippet. No key generation or token signing executed during research. Demonstration token has no automatic expiration unless caller sets one.\"]",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Original project API contract, jose",
      "display": "{\"status\": \"verified\", \"arguments\": \"Better Auth imports SignJWT from the supported jose root. The complete host function optionally delegates to a custom/remote signer; that branch does not execute jose and is not counted as another native call. The local branch constructs a JWTPayload object,sets a protected header with a supported alg and matching kid,sets numeric-or-supported-duration expiration,a string issuer,and string-or-string-array audience,then optional registered claims before signing. Its actual resolveSigningKey helper imports a matching private JWK through current importJWK; callers supplying resolvedKey must satisfy the same alg/key contract. These are application configuration and key-store prerequisites,not generated stand-in keys or an executed service request.\", \"used_return_shapes\": \"Native setters return SignJWT for chaining; sign(privateKey) returns Promise<string> containing compact JWS/JWT. Custom signer return is owned by the host configuration. Arbitrary key material,unsupported algorithms,or incompatible registered claim values are not made valid by the wrapper.\"}",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Project function, jose",
      "display": "export async function signJWT(\n\tctx: GenericEndpointContext,\n\tconfig: {\n\t\toptions?: JwtOptions | undefined;\n\t\tpayload: JWTPayloadWithOptional;\n\t\t/** Pre-resolved key from resolveSigningKey. Skips redundant DB lookup. */\n\t\tresolvedKey?: ResolvedSigningKey;\n\t\t/**\n\t\t * Extra JWS Protected Header parameters to merge with the defaults\n\t\t * (`alg` and `kid`). Used by token profiles that require an explicit\n\t\t * media type, such as OIDC Back-Channel Logout's `typ: \"logout+jwt\"`.\n\t\t *\n\t\t * @see https://www.rfc-editor.org/rfc/rfc8725#section-3.11\n\t\t */\n\t\theader?: {\n\t\t\ttyp?: string;\n\t\t\tcty?: string;\n\t\t};\n\t\t/**\n\t\t * Optional override for the signing key. When set, looks up the key\n\t\t * by its `id` (matches the JWS `kid` header) via the JWKS adapter.\n\t\t * Throws if no key with that id exists.\n\t\t *\n\t\t * When unset, falls back to the most recently created key with the\n\t\t * primary `keyPairConfig.alg` (the historical default).\n\t\t */\n\t\tsigningKeyId?: string | undefined;\n\t\t/**\n\t\t * Optional override for the signing algorithm. Selects the most\n\t\t * recent key with this algorithm. When neither this nor\n\t\t * `signingKeyId` is set, the most recent key matching\n\t\t * `keyPairConfig.alg` is used (historical default).\n\t\t *\n\t\t * If both `signingKeyId` and `signingAlgorithm` are set, `signingKeyId`\n\t\t * wins; the algorithm is validated to match the resolved key and\n\t\t * the call throws on mismatch.\n\t\t */\n\t\tsigningAlgorithm?: JWSAlgorithms | undefined;\n\t},\n) {\n\tconst { options } = config;\n\tconst payload = config.payload as JWTPayload;\n\n\t// Iat\n\tconst nowSeconds = Math.floor(Date.now() / 1000);\n\tconst iat = payload.iat!;\n\n\t// Exp\n\tlet exp = payload.exp;\n\tconst defaultExp = toExpJWT(\n\t\toptions?.jwt?.expirationTime ?? \"15m\",\n\t\tiat ?? nowSeconds,\n\t);\n\texp = exp ?? defaultExp;\n\n\t// Nbf\n\tconst nbf = payload.nbf!;\n\n\t// Empty only for a direct `auth.api` call when no baseURL is configured\n\tconst baseURLOrigin =\n\t\ttypeof ctx.context.options.baseURL === \"string\"\n\t\t\t? ctx.context.options.baseURL\n\t\t\t: \"\";\n\n\t// Iss\n\tconst iss = payload.iss;\n\tconst defaultIss = options?.jwt?.issuer ?? baseURLOrigin;\n\n\t// Aud\n\tconst aud = payload.aud;\n\tconst defaultAud = options?.jwt?.audience ?? baseURLOrigin;\n\n\tif (!(iss ?? defaultIss) || !(aud ?? defaultAud)) {\n\t\tctx.context.logger.warn(\n\t\t\t\"[better-auth] The JWT plugin signed a JWT without an issuer or audience because no base URL was resolved for this call. Set `baseURL`, or `jwt.issuer` and `jwt.audience` in the JWT plugin options.\",\n\t\t);\n\t}\n\n\t// Custom/remote signing function\n\tif (options?.jwt?.sign) {\n\t\tconst jwtPayload = {\n\t\t\t...payload,\n\t\t\tiat,\n\t\t\texp,\n\t\t\tnbf,\n\t\t\tiss: iss ?? defaultIss,\n\t\t\taud: aud ?? defaultAud,\n\t\t};\n\t\t// Forward extra protected-header parameters (e.g. `typ: \"logout+jwt\"`)\n\t\t// so profiles that require an explicit media type stay conformant even\n\t\t// with a remote signer. The signer still owns `alg`/`kid`. Also forward\n\t\t// per-call signing overrides as a third arg so remote KMS integrations\n\t\t// can honor per-resource kid/alg pinning. Both extra args are optional,\n\t\t// so existing single-arg implementations continue to work unchanged.\n\t\treturn options.jwt.sign(jwtPayload, config.header, {\n\t\t\tsigningKeyId: config.signingKeyId,\n\t\t\tsigningAlgorithm: config.signingAlgorithm,\n\t\t});\n\t}\n\n\t// Use pre-resolved key if available, otherwise resolve from DB with\n\t// any per-call overrides plumbed through.\n\tconst { alg, kid, privateKey } =\n\t\tconfig.resolvedKey ??\n\t\t(await resolveSigningKey(ctx, options, {\n\t\t\tsigningKeyId: config.signingKeyId,\n\t\t\tsigningAlgorithm: config.signingAlgorithm,\n\t\t}))!;\n\n\tconst jwt = new SignJWT(payload)\n\t\t.setProtectedHeader({\n\t\t\t// Spread caller header first so the resolved `alg`/`kid` always win.\n\t\t\t...config.header,\n\t\t\talg,\n\t\t\tkid,\n\t\t})\n\t\t.setExpirationTime(exp)\n\t\t.setIssuer(iss ?? defaultIss)\n\t\t.setAudience(aud ?? defaultAud);\n\tif (iat) jwt.setIssuedAt(iat);\n\tif (payload.sub) jwt.setSubject(payload.sub);\n\tif (payload.nbf) jwt.setNotBefore(payload.nbf);\n\tif (payload.jti) jwt.setJti(payload.jti);\n\treturn await jwt.sign(privateKey);\n}\n",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project source file, jose",
      "display": "packages/better-auth/src/plugins/jwt/sign.ts",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project full_name, jose",
      "display": "better-auth/better-auth",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Project stargazers_count, jose",
      "display": "30.8K",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Library name, jws",
      "display": "node-jws",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Monthly downloads, jws",
      "display": "483.8M",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "License, jws",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Package release, jws",
      "display": "4.0.1",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Package release date, jws",
      "display": "Dec 2025",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Install, jws",
      "display": "npm install jws",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Quickstart, jws",
      "display": "const fs = require(\"node:fs\");\nconst jws = require(\"jws\");\nconst privateKey = fs.readFileSync(\"private.key\");\nconst signature = jws.sign({\n  header: { alg: \"RS256\" }, payload: \"example\", privateKey,\n});\n",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Official description, jws",
      "display": "Implements JSON Web Signatures.",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Quickstart source file, jws",
      "display": "readme.md",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Repository stars, jws",
      "display": "721",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "JWS envelopes, jws",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Certificate issuance, jws",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Signature layer and role, jws",
      "display": "Protocol layer for compact JSON Web Signatures,with synchronous and stream APIs.",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "First-call prerequisites, jws",
      "display": "[\"Disclosed minimal Node CommonJS RSA signing recipe. Provide a compatible PEM-encoded RSA private.key; file is an explicit input,not a shipped secret. Payload is a raw string JWS,not JWT claim validation.\"]",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Original project API contract, jws",
      "display": "{\"status\": \"verified\", \"arguments\": \"This original jsonwebtoken signing workflow imports jws. It accepts a validated supported JWS header,serialized/string/Buffer or JSON payload,private key/secret,and encoding. Current4.0.1 retains createSign and sign. Its async callback branch creates a native SignStream,then observes error/done; its synchronous branch invokes sign directly. These are two distinct native APIs on mutually exclusive execution paths,not a claim that both run for every token. Current JWA2 accepts Node KeyObject private keys: the exact own checkIsPrivateKey and crypto signer source are retained in addition to public PEM/Buffer API documentation. Node crypto key conversion/options and JWT claim handling belong to this real higher-level consumer.\", \"used_return_shapes\": \"Synchronous sign returns a compact JWS string. SignStream emits done with that signature string. The consumer callback receives (error,signature),while the sync branch returns it. JWS signing alone does not validate registered JWT claims,trust certificate chains,or authorize users.\"}",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Public layering and download scope, jws",
      "display": "jsonwebtoken supplies JWT claim policy over node-jws,which supplies JWS encoding over node-jwa. Each has an independently documented public sign/verify interface and a different developer-facing abstraction.",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Project function, jws",
      "display": "function (payload, secretOrPrivateKey, options, callback) {\n  if (typeof options === 'function') {\n    callback = options;\n    options = {};\n  } else {\n    options = options || {};\n  }\n\n  const isObjectPayload = typeof payload === 'object' &&\n                        !Buffer.isBuffer(payload);\n\n  const header = Object.assign({\n    alg: options.algorithm || 'HS256',\n    typ: isObjectPayload ? 'JWT' : undefined,\n    kid: options.keyid\n  }, options.header);\n\n  function failure(err) {\n    if (callback) {\n      return callback(err);\n    }\n    throw err;\n  }\n\n  if (!secretOrPrivateKey && options.algorithm !== 'none') {\n    return failure(new Error('secretOrPrivateKey must have a value'));\n  }\n\n  if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) {\n    try {\n      secretOrPrivateKey = createPrivateKey(secretOrPrivateKey)\n    } catch (_) {\n      try {\n        secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === 'string' ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey)\n      } catch (_) {\n        return failure(new Error('secretOrPrivateKey is not valid key material'));\n      }\n    }\n  }\n\n  if (header.alg.startsWith('HS') && secretOrPrivateKey.type !== 'secret') {\n    return failure(new Error((`secretOrPrivateKey must be a symmetric key when using ${header.alg}`)))\n  } else if (/^(?:RS|PS|ES)/.test(header.alg)) {\n    if (secretOrPrivateKey.type !== 'private') {\n      return failure(new Error((`secretOrPrivateKey must be an asymmetric key when using ${header.alg}`)))\n    }\n    if (!options.allowInsecureKeySizes &&\n      !header.alg.startsWith('ES') &&\n      secretOrPrivateKey.asymmetricKeyDetails !== undefined && //KeyObject.asymmetricKeyDetails is supported in Node 15+\n      secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) {\n      return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`));\n    }\n  }\n\n  if (typeof payload === 'undefined') {\n    return failure(new Error('payload is required'));\n  } else if (isObjectPayload) {\n    try {\n      validatePayload(payload);\n    }\n    catch (error) {\n      return failure(error);\n    }\n    if (!options.mutatePayload) {\n      payload = Object.assign({},payload);\n    }\n  } else {\n    const invalid_options = options_for_objects.filter(function (opt) {\n      return typeof options[opt] !== 'undefined';\n    });\n\n    if (invalid_options.length > 0) {\n      return failure(new Error('invalid ' + invalid_options.join(',') + ' option for ' + (typeof payload ) + ' payload'));\n    }\n  }\n\n  if (typeof payload.exp !== 'undefined' && typeof options.expiresIn !== 'undefined') {\n    return failure(new Error('Bad \"options.expiresIn\" option the payload already has an \"exp\" property.'));\n  }\n\n  if (typeof payload.nbf !== 'undefined' && typeof options.notBefore !== 'undefined') {\n    return failure(new Error('Bad \"options.notBefore\" option the payload already has an \"nbf\" property.'));\n  }\n\n  try {\n    validateOptions(options);\n  }\n  catch (error) {\n    return failure(error);\n  }\n\n  if (!options.allowInvalidAsymmetricKeyTypes) {\n    try {\n      validateAsymmetricKey(header.alg, secretOrPrivateKey);\n    } catch (error) {\n      return failure(error);\n    }\n  }\n\n  const timestamp = payload.iat || Math.floor(Date.now() / 1000);\n\n  if (options.noTimestamp) {\n    delete payload.iat;\n  } else if (isObjectPayload) {\n    payload.iat = timestamp;\n  }\n\n  if (typeof options.notBefore !== 'undefined') {\n    try {\n      payload.nbf = timespan(options.notBefore, timestamp);\n    }\n    catch (err) {\n      return failure(err);\n    }\n    if (typeof payload.nbf === 'undefined') {\n      return failure(new Error('\"notBefore\" should be a number of seconds or string representing a timespan eg: \"1d\", \"20h\", 60'));\n    }\n  }\n\n  if (typeof options.expiresIn !== 'undefined' && typeof payload === 'object') {\n    try {\n      payload.exp = timespan(options.expiresIn, timestamp);\n    }\n    catch (err) {\n      return failure(err);\n    }\n    if (typeof payload.exp === 'undefined') {\n      return failure(new Error('\"expiresIn\" should be a number of seconds or string representing a timespan eg: \"1d\", \"20h\", 60'));\n    }\n  }\n\n  Object.keys(options_to_payload).forEach(function (key) {\n    const claim = options_to_payload[key];\n    if (typeof options[key] !== 'undefined') {\n      if (typeof payload[claim] !== 'undefined') {\n        return failure(new Error('Bad \"options.' + key + '\" option. The payload already has an \"' + claim + '\" property.'));\n      }\n      payload[claim] = options[key];\n    }\n  });\n\n  const encoding = options.encoding || 'utf8';\n\n  if (typeof callback === 'function') {\n    callback = callback && once(callback);\n\n    jws.createSign({\n      header: header,\n      privateKey: secretOrPrivateKey,\n      payload: payload,\n      encoding: encoding\n    }).once('error', callback)\n      .once('done', function (signature) {\n        // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version\n        if(!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) {\n          return callback(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`))\n        }\n        callback(null, signature);\n      });\n  } else {\n    let signature = jws.sign({header: header, payload: payload, secret: secretOrPrivateKey, encoding: encoding});\n    // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version\n    if(!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) {\n      throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)\n    }\n    return signature\n  }\n}\n",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project source file, jws",
      "display": "sign.js",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Project full_name, jws",
      "display": "auth0/node-jsonwebtoken",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Project stargazers_count, jws",
      "display": "18.2K",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Library name, jwa",
      "display": "node-jwa",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Monthly downloads, jwa",
      "display": "481.7M",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "License, jwa",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Package release, jwa",
      "display": "2.0.1",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Package release date, jwa",
      "display": "May 2025",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Install, jwa",
      "display": "npm install jwa",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Quickstart, jwa",
      "display": "const fs = require(\"node:fs\");\nconst jwa = require(\"jwa\");\nconst privateKey = fs.readFileSync(\"ecdsa-p521-private.pem\");\nconst ecdsa = jwa(\"ES512\");\nconst signature = ecdsa.sign(\"very important stuff\", privateKey);\n",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Official description, jwa",
      "display": "Implements the JSON Web Algorithms that JWS signing uses.",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Quickstart source file, jwa",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Repository stars, jwa",
      "display": "103",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "JWS envelopes, jwa",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Certificate issuance, jwa",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Signature layer and role, jwa",
      "display": "Direct JWA algorithm selector returning sign/verify primitives; used under JWS wrappers.",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "First-call prerequisites, jwa",
      "display": "[\"Disclosed first-sign recipe from the official With keys example,omitting public-key verification setup until needed. Provide an ECDSA P-521 PEM private key matching ES512. Output is raw base64url signature,not a JWS envelope; HS shared-secret examples are separate MAC operations.\"]",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Original project API contract, jwa",
      "display": "{\"status\": \"verified\", \"arguments\": \"This complete node-jws protocol integration imports jwa and selects the algorithm from header.alg. Current2.0.1 accepts supported case-sensitive JWA names and returns sign/verify methods. jwsSecuredInput,retained in the same immutable module,JSON/base64url encodes the protected header and payload before the native algorithm signs that ASCII input. RSA/ECDSA require compatible PEM/Buffer/KeyObject private keys; HS algorithms use a shared secret and are MACs,not public-key digital signatures. The original helper is a higher-level JWS consumer,not a vendored implementation of jwa.\", \"used_return_shapes\": \"The selected primitive returns a base64url signature string. The host joins header.payload with that signature into a complete compact JWS. The native jwa API does not itself assemble that envelope or validate JWT expiration/audience claims.\"}",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Public layering and download scope, jwa",
      "display": "jsonwebtoken supplies JWT claim policy over node-jws,which supplies JWS encoding over node-jwa. Each has an independently documented public sign/verify interface and a different developer-facing abstraction.",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Project function, jwa",
      "display": "function jwsSign(opts) {\n  var header = opts.header;\n  var payload = opts.payload;\n  var secretOrKey = opts.secret || opts.privateKey;\n  var encoding = opts.encoding;\n  var algo = jwa(header.alg);\n  var securedInput = jwsSecuredInput(header, payload, encoding);\n  var signature = algo.sign(securedInput, secretOrKey);\n  return util.format('%s.%s', securedInput, signature);\n}\n",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Project source file, jwa",
      "display": "lib/sign-stream.js",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Project full_name, jwa",
      "display": "auth0/node-jws",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Project stargazers_count, jwa",
      "display": "721",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Library name, jsonwebtoken",
      "display": "jsonwebtoken",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Monthly downloads, jsonwebtoken",
      "display": "317.9M",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "License, jsonwebtoken",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Package release, jsonwebtoken",
      "display": "9.0.3",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Package release date, jsonwebtoken",
      "display": "Dec 2025",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Install, jsonwebtoken",
      "display": "npm install jsonwebtoken",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Quickstart, jsonwebtoken",
      "display": "const fs = require('node:fs');\nconst jwt = require('jsonwebtoken');\nconst privateKey = fs.readFileSync('private.key');\nconst token = jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256' });\n",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Official description, jsonwebtoken",
      "display": "Signs and verifies JSON Web Tokens with symmetric or asymmetric keys.",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Quickstart source file, jsonwebtoken",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Repository stars, jsonwebtoken",
      "display": "18.2K",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "JWS envelopes, jsonwebtoken",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Certificate issuance, jsonwebtoken",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Signature layer and role, jsonwebtoken",
      "display": "Node-oriented JWT signing and verification with registered claim options.",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "First-call prerequisites, jsonwebtoken",
      "display": "[\"Disclosed complete import/setup recipe for the official basic RSA first call. Supply a compatible PEM RSA private.key. Current library enforces supported key type/size; no expiration is added by default. No file or key is read by this research process.\"]",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Original project API contract, jsonwebtoken",
      "display": "{\"status\": \"verified\", \"arguments\": \"Umami imports jsonwebtoken and verifies a token with the provided compatible shared secret or asymmetric public key. Current9.0.3 retains synchronous verify(token,key). The complete original parseToken catches native parse,signature,and registered-time-claim failures and returns null. It does not pass issuer,audience,or an explicit algorithms allowlist,so the example must not be described as enforcing those caller-specific policies. The target package supports public-key signing,while this function works with either supported HMAC or asymmetric tokens under actual key requirements.\", \"used_return_shapes\": \"Synchronous verify returns decoded payload (object or string under documented token shape). The application preserves that result and returns null on any thrown exception. It is not jwt.decode,and a syntactically decoded payload is not treated as verified.\"}",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Public layering and download scope, jsonwebtoken",
      "display": "jsonwebtoken supplies JWT claim policy over node-jws,which supplies JWS encoding over node-jwa. Each has an independently documented public sign/verify interface and a different developer-facing abstraction.",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Project function, jsonwebtoken",
      "display": "export function parseToken(token: string, secret: any) {\n  try {\n    return jwt.verify(token, secret);\n  } catch {\n    return null;\n  }\n}\n",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Project source file, jsonwebtoken",
      "display": "src/lib/jwt.ts",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Project full_name, jsonwebtoken",
      "display": "umami-software/umami",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Project stargazers_count, jsonwebtoken",
      "display": "40.2K",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Library name, node-forge",
      "display": "Forge",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Monthly downloads, node-forge",
      "display": "211.3M",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "License, node-forge",
      "display": "(BSD-3-Clause OR GPL-2.0)",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Package release, node-forge",
      "display": "1.4.3",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Package release date, node-forge",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Install, node-forge",
      "display": "npm install node-forge",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Quickstart, node-forge",
      "display": "const forge = require(\"node-forge\");\nconst ed25519 = forge.pki.ed25519;\nconst keypair = ed25519.generateKeyPair();\nconst signature = ed25519.sign({\n  message: \"test\", encoding: \"utf8\", privateKey: keypair.privateKey,\n});\n",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Repository stars, node-forge",
      "display": "5.4K",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "JWS envelopes, node-forge",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Certificate issuance, node-forge",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Signature layer and role, node-forge",
      "display": "Broad pure-JavaScript PKI toolkit spanning RSA,Ed25519,ASN1,PKCS12,and CMS signatures.",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "First-call prerequisites, node-forge",
      "display": "[\"Disclosed minimal Ed25519 recipe uses the explicitly initialized lowercase ed25519 alias consistently; the README later switches to an undeclared uppercase ED25519 alias. This recipe is not claimed verbatim. Cryptographically secure randomness is required for actual key generation. It demonstrates raw Ed25519 bytes; the advanced project example separately uses RSA PKCS12/CMS.\"]",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Original project API contract, node-forge",
      "display": "{\"status\": \"verified\", \"arguments\": \"P12Signer imports node-forge and its constructor retains a Forge buffer of actual PKCS12 bytes. Current1.4.3 supports DER parsing,optional ASN1 strict flag/passphrase,certBag and pkcs8ShroudedKeyBag lookup,and PKCS7 signing with authenticated contentType,signingTime,and messageDigest attributes. This particular original signer requires at least one shrouded RSA private-key bag and a matching RSA certificate: it compares BigInteger n/e fields and is not an ECDSA-P12 example. Matching object fields and compareTo are checked against the current RSA/jsbn source. Native addSigner receives SHA256 OID,private key,certificate,and attribute list; detached:true remains supported. Caller supplies the already prepared PDF bytes-to-sign; this method alone does not place a PDF placeholder or produce a whole validated PDF.\", \"used_return_shapes\": \"Current PKCS7 signed-data object can serialize via toAsn1; toDer returns a Forge byte buffer,whose getBytes binary string becomes a Node Buffer. Output is DER-encoded detached CMS/PKCS7 signature bytes. Source comments about validation/order are not measured standards-compliance or trust claims. Return is not a PEM string or full PDF.\"}",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Selected CMS signer constraints, node-forge",
      "display": "The P12Signer example requires a shrouded RSA key bag and matching certificate and returns DER detached PKCS7/CMS bytes. It does not create a complete PDF or prove trust/compliance.",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Project function, node-forge",
      "display": "async sign(pdfBuffer, signingTime = undefined) {\n    if (!(pdfBuffer instanceof Buffer)) {\n        throw new SignPdfError(\n            'PDF expected as Buffer.',\n            SignPdfError.TYPE_INPUT,\n        );\n    }\n\n    // Convert Buffer P12 to a forge implementation.\n    const p12Asn1 = forge.asn1.fromDer(this.cert);\n    const p12 = forge.pkcs12.pkcs12FromAsn1(\n        p12Asn1,\n        this.options.asn1StrictParsing,\n        this.options.passphrase,\n    );\n\n    // Extract safe bags by type.\n    // We will need all the certificates and the private key.\n    const certBags = p12.getBags({\n        bagType: forge.pki.oids.certBag,\n    })[forge.pki.oids.certBag];\n    const keyBags = p12.getBags({\n        bagType: forge.pki.oids.pkcs8ShroudedKeyBag,\n    })[forge.pki.oids.pkcs8ShroudedKeyBag];\n\n    const privateKey = keyBags[0].key;\n    // Here comes the actual PKCS#7 signing.\n    const p7 = forge.pkcs7.createSignedData();\n    // Start off by setting the content.\n    p7.content = forge.util.createBuffer(pdfBuffer.toString('binary'));\n\n    // Then add all the certificates (-cacerts & -clcerts)\n    // Keep track of the last found client certificate.\n    // This will be the public key that will be bundled in the signature.\n    let certificate;\n    Object.keys(certBags).forEach((i) => {\n        const {publicKey} = certBags[i].cert;\n\n        p7.addCertificate(certBags[i].cert);\n\n        // Try to find the certificate that matches the private key.\n        if (privateKey.n.compareTo(publicKey.n) === 0\n            && privateKey.e.compareTo(publicKey.e) === 0\n        ) {\n            certificate = certBags[i].cert;\n        }\n    });\n\n    if (typeof certificate === 'undefined') {\n        throw new SignPdfError(\n            'Failed to find a certificate that matches the private key.',\n            SignPdfError.TYPE_INPUT,\n        );\n    }\n\n    // Add a sha256 signer. That's what Adobe.PPKLite adbe.pkcs7.detached expects.\n    // Note that the authenticatedAttributes order is relevant for correct\n    // EU signature validation:\n    // https://ec.europa.eu/digital-building-blocks/DSS/webapp-demo/validation\n    p7.addSigner({\n        key: privateKey,\n        certificate,\n        digestAlgorithm: forge.pki.oids.sha256,\n        authenticatedAttributes: [\n            {\n                type: forge.pki.oids.contentType,\n                value: forge.pki.oids.data,\n            }, {\n                type: forge.pki.oids.signingTime,\n                // value can also be auto-populated at signing time\n                value: signingTime ?? new Date(),\n            }, {\n                type: forge.pki.oids.messageDigest,\n                // value will be auto-populated at signing time\n            },\n        ],\n    });\n\n    // Sign in detached mode.\n    p7.sign({detached: true});\n\n    return Buffer.from(forge.asn1.toDer(p7.toAsn1()).getBytes(), 'binary');\n}\n",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Project source file, node-forge",
      "display": "packages/signer-p12/src/P12Signer.js",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Project full_name, node-forge",
      "display": "vbuch/node-signpdf",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Project stargazers_count, node-forge",
      "display": "943",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Library name, tweetnacl",
      "display": "TweetNaCl.js",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Monthly downloads, tweetnacl",
      "display": "195.3M",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "License, tweetnacl",
      "display": "Unlicense",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Package release, tweetnacl",
      "display": "1.0.3",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Package release date, tweetnacl",
      "display": "Feb 2020",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Install, tweetnacl",
      "display": "npm install tweetnacl",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Quickstart, tweetnacl",
      "display": "const nacl = require(\"tweetnacl\");\nconst keypair = nacl.sign.keyPair();\nconst message = new Uint8Array([1, 2, 3]);\nconst signature = nacl.sign.detached(message, keypair.secretKey);\n",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Official description, tweetnacl",
      "display": "Ports the TweetNaCl cryptography library to JavaScript.",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Quickstart source file, tweetnacl",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Repository stars, tweetnacl",
      "display": "1.9K",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "JWS envelopes, tweetnacl",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Certificate issuance, tweetnacl",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Signature layer and role, tweetnacl",
      "display": "NaCl primitive toolkit whose signature interface uses Ed25519 byte arrays.",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "First-call prerequisites, tweetnacl",
      "display": "[\"Disclosed native byte-array first-sign recipe. Secure randomness is required for generating the keypair. Keep secretKey64bytes distinct from a32byte seed; publicKey and detached signature are separate byte arrays. No JSON/JWS envelope or X509 certificate is generated.\"]",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Original project API contract, tweetnacl",
      "display": "{\"status\": \"verified\", \"arguments\": \"The immutable historical Solana transaction module directly imports TweetNaCl,unlike the current ref-ignored Contents response which switched underlying implementation. The complete verifier takes actual serialized transaction bytes and iterates signature/public-key pairs. Current1.0.3 detached.verify accepts Uint8Array-compatible Node Buffers,64-byte detached Ed25519 signatures,and32-byte public keys. Solana PublicKey.toBuffer must supply that valid32-byte encoding; malformed-size input can throw rather than return false. Null signatures are accepted only when requireAllSignatures is false.\", \"used_return_shapes\": \"Each native verify returns boolean for a well-formed signature. Original method returns false on missing required or invalid signatures,and true when all supplied signatures verify. It does not validate transaction semantics or implement account authorization. Whole16-line task-specific one-native-call exception; loop iterations do not inflate the native API count.\"}",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Byte contract, tweetnacl",
      "display": "{\"publicKey_bytes\": 32, \"secretKey_bytes\": 64, \"signature_bytes\": 64}",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Project function, tweetnacl",
      "display": "_verifySignatures(signData: Buffer, requireAllSignatures: boolean): boolean {\n  for (const {signature, publicKey} of this.signatures) {\n    if (signature === null) {\n      if (requireAllSignatures) {\n        return false;\n      }\n    } else {\n      if (\n        !nacl.sign.detached.verify(signData, signature, publicKey.toBuffer())\n      ) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Project source file, tweetnacl",
      "display": "src/transaction/legacy.ts",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Project full_name, tweetnacl",
      "display": "solana-foundation/solana-web3.js",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Project stargazers_count, tweetnacl",
      "display": "2.8K",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Library name, @noble/curves",
      "display": "@noble/curves",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Monthly downloads, @noble/curves",
      "display": "188.7M",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "License, @noble/curves",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Package release, @noble/curves",
      "display": "2.4.0",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Package release date, @noble/curves",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Install, @noble/curves",
      "display": "npm install @noble/curves",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Quickstart, @noble/curves",
      "display": "import { ed25519 } from '@noble/curves/ed25519.js';\nconst { secretKey, publicKey } = ed25519.keygen();\nconst msg = new TextEncoder().encode('hello noble');\nconst sig = ed25519.sign(msg, secretKey);\n",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Repository stars, @noble/curves",
      "display": "972",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "JWS envelopes, @noble/curves",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Certificate issuance, @noble/curves",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Signature layer and role, @noble/curves",
      "display": "Elliptic-curve signature primitives with explicit scheme subpath imports.",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "First-call prerequisites, @noble/curves",
      "display": "[\"Official first-sign prefix; current2 subpath requires .js. A supported runtime with WebCrypto secure randomness is required by keygen. Ed25519 message is bytes; no Ethereum/ECDSA hashing semantics are implied.\"]",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Original project API contract, @noble/curves",
      "display": "{\"status\": \"verified\", \"arguments\": \"ICP JavaScript core imports ed25519 through the current required @noble/curves/ed25519.js export. The old Psiphon candidate imports the removed extensionless v1 path and is rejected for that actual incompatibility,not its dependency range. Current2.4.0 EdDSA.sign accepts message Uint8Array and32-byte secret-key seed. The complete original class method slices the first32bytes from its stored private key (which may contain an appended public key),then signs challenge bytes. A correctly initialized identity and valid32-byte seed are host prerequisites.\", \"used_return_shapes\": \"The native Ed25519 signature is a Uint8Array. Original code adds a nonenumerable __signature__ marker to satisfy the host branded Signature type and returns it via Promise; no encoded-string or DER signature shape is assumed. This is an Ed25519 example,not Noble ECDSA prehash/format semantics.\"}",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Import and verification profile, @noble/curves",
      "display": "Current2 requires explicit .js subpath imports. Ed25519 verification defaults to ZIP215 rules; explicit zip215:false changes verification profile.",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Project function, @noble/curves",
      "display": "public async sign(challenge: Uint8Array): Promise<Signature> {\n  // Some implementations of Ed25519 private keys append a public key to the end of the private key. We only want the private key.\n  const signature = ed25519.sign(challenge, this.#privateKey.slice(0, 32));\n  // add { __signature__: void; } to the signature to make it compatible with the agent\n\n  Object.defineProperty(signature, '__signature__', {\n    enumerable: false,\n    value: undefined,\n  });\n\n  return signature as Signature;\n}\n",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Project source file, @noble/curves",
      "display": "packages/core/src/identity/identity/ed25519.ts",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Project full_name, @noble/curves",
      "display": "dfinity/icp-js-core",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Project stargazers_count, @noble/curves",
      "display": "171",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Library name, @peculiar/x509",
      "display": "@peculiar/x509",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Monthly downloads, @peculiar/x509",
      "display": "85.7M",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "License, @peculiar/x509",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "Package release, @peculiar/x509",
      "display": "3.1.0",
      "asOf": "2026-11-20"
    },
    "F267": {
      "label": "Package release date, @peculiar/x509",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F268": {
      "label": "Install, @peculiar/x509",
      "display": "npm install @peculiar/x509 reflect-metadata",
      "asOf": "2026-11-20"
    },
    "F269": {
      "label": "Quickstart, @peculiar/x509",
      "display": "import \"reflect-metadata\";\nimport * as x509 from \"@peculiar/x509\";\n\nconst algorithm = { name: \"ECDSA\", namedCurve: \"P-256\", hash: \"SHA-256\" };\nconst keys = await crypto.subtle.generateKey(algorithm, false, [\"sign\", \"verify\"]);\nconst cert = await x509.X509CertificateGenerator.createSelfSigned({\n  name: \"CN=Example Root CA, O=Example Org, C=US\", keys, signingAlgorithm: algorithm,\n});\n",
      "asOf": "2026-11-20"
    },
    "F270": {
      "label": "Official description, @peculiar/x509",
      "display": "Generates X.509 certificates and certificate requests and validates certificate chains in TypeScript or JavaScript.",
      "asOf": "2026-11-20"
    },
    "F271": {
      "label": "Quickstart source file, @peculiar/x509",
      "display": "website/docs/examples/certificates/self-signed.example.ts",
      "asOf": "2026-11-20"
    },
    "F272": {
      "label": "Repository stars, @peculiar/x509",
      "display": "137",
      "asOf": "2026-11-20"
    },
    "F273": {
      "label": "JWS envelopes, @peculiar/x509",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F274": {
      "label": "Certificate issuance, @peculiar/x509",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F275": {
      "label": "Signature layer and role, @peculiar/x509",
      "display": "WebCrypto-backed X509 certificate,CSR,and revocation-list creation/parsing/verification.",
      "asOf": "2026-11-20"
    },
    "F276": {
      "label": "First-call prerequisites, @peculiar/x509",
      "display": "[\"Disclosed minimal ES-module API recipe omits optional CA extensions and fixed validity dates from the fuller official self-signed example. Default serial/validity are library-generated; absence of CA extensions does not create a trusted issuing CA. Current3 requires reflection polyfill imported first,and Node ^20.19.0 or >=22.12.0 with usable WebCrypto (or a compatible configured provider). Current peer ASN1 packages must share compatible major versions. No service/trust store is contacted.\"]",
      "asOf": "2026-11-20"
    },
    "F277": {
      "label": "Fixture versus production certificate, @peculiar/x509",
      "display": "Selected original integration fixture uses RSA SHA384,2048bit keys,and fixed expired2020validity dates to test chain construction. Official first call separately uses current-date defaults with ECDSA P256 and reflection setup.",
      "asOf": "2026-11-20"
    },
    "F278": {
      "label": "Project function, @peculiar/x509",
      "display": "function buildExtensions(userExtensions, commonName) {\n  if (!userExtensions || userExtensions.length === 0) {\n    // Default extensions\n    return [\n      new BasicConstraintsExtension(false, undefined, true),\n      new KeyUsagesExtension(KeyUsageFlags.digitalSignature | KeyUsageFlags.keyEncipherment, true),\n      new ExtendedKeyUsageExtension([ExtendedKeyUsage.serverAuth, ExtendedKeyUsage.clientAuth], false),\n      new SubjectAlternativeNameExtension([\n        { type: 'dns', value: commonName },\n        ...(commonName === 'localhost' ? [{ type: 'ip', value: '127.0.0.1' }] : [])\n      ], false)\n    ];\n  }\n\n  // Convert user extensions from node-forge format to @peculiar/x509 format\n  const extensions = [];\n\n  for (const ext of userExtensions) {\n    const critical = ext.critical || false;\n\n    switch (ext.name) {\n      case 'basicConstraints':\n        extensions.push(new BasicConstraintsExtension(\n          ext.cA || false,\n          ext.pathLenConstraint,\n          critical\n        ));\n        break;\n\n      case 'keyUsage':\n        let flags = 0;\n        if (ext.digitalSignature) flags |= KeyUsageFlags.digitalSignature;\n        if (ext.nonRepudiation || ext.contentCommitment) flags |= KeyUsageFlags.nonRepudiation;\n        if (ext.keyEncipherment) flags |= KeyUsageFlags.keyEncipherment;\n        if (ext.dataEncipherment) flags |= KeyUsageFlags.dataEncipherment;\n        if (ext.keyAgreement) flags |= KeyUsageFlags.keyAgreement;\n        if (ext.keyCertSign) flags |= KeyUsageFlags.keyCertSign;\n        if (ext.cRLSign) flags |= KeyUsageFlags.cRLSign;\n        if (ext.encipherOnly) flags |= KeyUsageFlags.encipherOnly;\n        if (ext.decipherOnly) flags |= KeyUsageFlags.decipherOnly;\n        extensions.push(new KeyUsagesExtension(flags, critical));\n        break;\n\n      case 'extKeyUsage':\n        const usages = [];\n        if (ext.serverAuth) usages.push(ExtendedKeyUsage.serverAuth);\n        if (ext.clientAuth) usages.push(ExtendedKeyUsage.clientAuth);\n        if (ext.codeSigning) usages.push(ExtendedKeyUsage.codeSigning);\n        if (ext.emailProtection) usages.push(ExtendedKeyUsage.emailProtection);\n        if (ext.timeStamping) usages.push(ExtendedKeyUsage.timeStamping);\n        extensions.push(new ExtendedKeyUsageExtension(usages, critical));\n        break;\n\n      case 'subjectAltName':\n        const altNames = (ext.altNames || []).map(alt => {\n          // node-forge type values:\n          // 1 = email (rfc822Name)\n          // 2 = DNS\n          // 6 = URI\n          // 7 = IP\n          switch (alt.type) {\n            case 1: // email\n              return { type: 'email', value: alt.value };\n            case 2: // DNS\n              return { type: 'dns', value: alt.value };\n            case 6: // URI\n              return { type: 'url', value: alt.value };\n            case 7: // IP\n              return { type: 'ip', value: alt.ip || alt.value };\n            default:\n              // Try to infer type from properties\n              if (alt.ip) return { type: 'ip', value: alt.ip };\n              if (alt.dns) return { type: 'dns', value: alt.dns };\n              if (alt.email) return { type: 'email', value: alt.email };\n              if (alt.uri || alt.url) return { type: 'url', value: alt.uri || alt.url };\n              return { type: 'dns', value: alt.value };\n          }\n        });\n        extensions.push(new SubjectAlternativeNameExtension(altNames, critical));\n        break;\n\n      default:\n        // Skip unknown extensions with a warning\n        console.warn(`Unknown extension \"${ext.name}\" ignored`);\n    }\n  }\n\n  return extensions;\n}",
      "asOf": "2026-11-20"
    },
    "F279": {
      "label": "Project source file, @peculiar/x509",
      "display": "index.js",
      "asOf": "2026-11-20"
    },
    "F280": {
      "label": "Project full_name, @peculiar/x509",
      "display": "jfromaniello/selfsigned",
      "asOf": "2026-11-20"
    },
    "F281": {
      "label": "Project stargazers_count, @peculiar/x509",
      "display": "253",
      "asOf": "2026-11-20"
    },
    "F282": {
      "label": "Synchronous and streaming APIs",
      "display": "Synchronous and streaming APIs",
      "asOf": "2026-11-17"
    },
    "F283": {
      "label": "Sign with jws.sign, or stream large payloads through jws.createSign.",
      "display": "Sign with jws.sign, or stream large payloads through jws.createSign.",
      "asOf": "2026-11-17"
    },
    "F284": {
      "label": "No certificate chain signing",
      "display": "No certificate chain signing",
      "asOf": "2026-11-17"
    },
    "F285": {
      "label": "Certificate chain signing and verifying fall outside the library.",
      "display": "Certificate chain signing and verifying fall outside the library.",
      "asOf": "2026-11-17"
    },
    "F286": {
      "label": "Returns sign and verify methods",
      "display": "Returns sign and verify methods",
      "asOf": "2026-11-17"
    },
    "F287": {
      "label": "Pick an algorithm such as HS256 to get its sign and verify functions.",
      "display": "Pick an algorithm such as HS256 to get its sign and verify functions.",
      "asOf": "2026-11-17"
    },
    "F288": {
      "label": "Invalid algorithm names throw",
      "display": "Invalid algorithm names throw",
      "asOf": "2026-11-17"
    },
    "F289": {
      "label": "An unknown or miscased algorithm name throws a TypeError.",
      "display": "An unknown or miscased algorithm name throws a TypeError.",
      "asOf": "2026-11-17"
    },
    "F290": {
      "label": "Checks expiration, audience, and issuer",
      "display": "Checks expiration, audience, and issuer",
      "asOf": "2026-11-17"
    },
    "F291": {
      "label": "jwt.verify returns the payload only after the signature and claims pass.",
      "display": "jwt.verify returns the payload only after the signature and claims pass.",
      "asOf": "2026-11-17"
    },
    "F292": {
      "label": "Accepts readable expiry times",
      "display": "Accepts readable expiry times",
      "asOf": "2026-11-17"
    },
    "F293": {
      "label": "Set expiresIn in seconds or as a time-span string.",
      "display": "Set expiresIn in seconds or as a time-span string.",
      "asOf": "2026-11-17"
    },
    "F294": {
      "label": "Signs with Ed25519",
      "display": "Signs with Ed25519",
      "asOf": "2026-11-17"
    },
    "F295": {
      "label": "Generate a key pair with nacl.sign.keyPair and sign byte arrays.",
      "display": "Generate a key pair with nacl.sign.keyPair and sign byte arrays.",
      "asOf": "2026-11-17"
    },
    "F296": {
      "label": "Bundles encryption with signing",
      "display": "Bundles encryption with signing",
      "asOf": "2026-11-17"
    },
    "F297": {
      "label": "The same package covers authenticated encryption, hashing, and random bytes.",
      "display": "The same package covers authenticated encryption, hashing, and random bytes.",
      "asOf": "2026-11-17"
    },
    "F298": {
      "label": "Creates and verifies certificates",
      "display": "Creates and verifies certificates",
      "asOf": "2026-11-17"
    },
    "F299": {
      "label": "Issue, parse, and verify certificates, requests, and revocation lists with WebCrypto.",
      "display": "Issue, parse, and verify certificates, requests, and revocation lists with WebCrypto.",
      "asOf": "2026-11-17"
    },
    "F300": {
      "label": "Needs a Reflect polyfill",
      "display": "Needs a Reflect polyfill",
      "asOf": "2026-11-17"
    },
    "F301": {
      "label": "Import reflect-metadata or another Reflect polyfill at the entry point.",
      "display": "Import reflect-metadata or another Reflect polyfill at the entry point.",
      "asOf": "2026-11-17"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best JavaScript digital signature libraries jose noble-curves node-forge elliptic code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
