Skip to content

Instantly share code, notes, and snippets.

View canterberry's full-sized avatar

Devin Canterberry canterberry

View GitHub Profile
@canterberry
canterberry / OPTOUT.md
Created January 4, 2022 07:12
Resources for US residents to opt out of solicitations.
@canterberry
canterberry / main.mjs
Created July 21, 2022 22:19
TWJ is JWT for Node.js apps. Here's how to use it.
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', {