Skip to content

Instantly share code, notes, and snippets.

@vcsjones
Created August 19, 2016 13:37
Show Gist options
  • Save vcsjones/08e30593925dd199cedf199ccede87dd to your computer and use it in GitHub Desktop.
Save vcsjones/08e30593925dd199cedf199ccede87dd to your computer and use it in GitHub Desktop.
const jwt = require('jsonwebtoken');
const privateKey = `-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIA/Hp5bQItOQCKBdgH6sHLZAhTBNID/x8Fb5xwrWrZVQoAoGCCqGSM49
AwEHoUQDQgAEAwTleT8M/rlF8nE/qhY+26axJzFroVz7WciGZYxB1wI/U0jJgyr5
PBdQASFywG+QgGP/xD3eEozUnVOX+1z+9g==
-----END EC PRIVATE KEY-----`;
const publicKey = `-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAwTleT8M/rlF8nE/qhY+26axJzFr
oVz7WciGZYxB1wI/U0jJgyr5PBdQASFywG+QgGP/xD3eEozUnVOX+1z+9g==
-----END PUBLIC KEY-----`;
const token = jwt.sign({"toot": "peep"}, privateKey, { algorithm : 'RS256' });
console.log(token);
process.exit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment