Created
August 19, 2016 13:37
-
-
Save vcsjones/08e30593925dd199cedf199ccede87dd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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