Opt out of unsolicited calls, postal mail, and credit offers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createSigner, createValidator, createVerifier } from 'twj/v0'; | |
import { generateKeyPairSync } from 'node:crypto'; | |
/** | |
* Generate a key-pair, if you don't already have one, as a JWK object. | |
* Here's how you can do that using native APIs provided by Node.js | |
* In production scenarios, you'll already have this somewhere under | |
* configuration management alongside your other secrets. | |
*/ | |
const { privateKey, publicKey } = generateKeyPairSync('ec', { |
OlderNewer