From 049b15627c741360c214b6dd61d91a4c04acd0cd Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Wed, 14 Nov 2018 10:57:45 +0000 Subject: [PATCH] Fix 'cert' token which isn't a cert Certs have pubkeys. We sign things with private keys. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6e653d3..8013221 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,13 @@ var token = jwt.sign({ foo: 'bar' }, 'shhhhh'); Synchronous Sign with RSA SHA256 ```js // sign with RSA SHA256 -var cert = fs.readFileSync('private.key'); -var token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'}); +var privateKey = fs.readFileSync('private.key'); +var token = jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256'}); ``` Sign asynchronously ```js -jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(err, token) { +jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256' }, function(err, token) { console.log(token); }); ```