From 0c24fe68cd2866cea6322016bf993cd897fefc98 Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Wed, 13 Feb 2019 15:49:01 +0000 Subject: [PATCH] Fix 'cert' token which isn't a cert (#554) 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); }); ```