Skip to content

Commit

Permalink
Fix 'cert' token which isn't a cert (#554)
Browse files Browse the repository at this point in the history
Certs have pubkeys. We sign things with private keys.
  • Loading branch information
mikemaccana authored and ziluvatar committed Feb 13, 2019
1 parent da8f55c commit 0c24fe6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
```
Expand Down

0 comments on commit 0c24fe6

Please sign in to comment.