Skip to content

Commit 0c24fe6

Browse files
mikemaccanaziluvatar
authored andcommitted
Fix 'cert' token which isn't a cert (#554)
Certs have pubkeys. We sign things with private keys.
1 parent da8f55c commit 0c24fe6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ var token = jwt.sign({ foo: 'bar' }, 'shhhhh');
7272
Synchronous Sign with RSA SHA256
7373
```js
7474
// sign with RSA SHA256
75-
var cert = fs.readFileSync('private.key');
76-
var token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'});
75+
var privateKey = fs.readFileSync('private.key');
76+
var token = jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256'});
7777
```
7878

7979
Sign asynchronously
8080
```js
81-
jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(err, token) {
81+
jwt.sign({ foo: 'bar' }, privateKey, { algorithm: 'RS256' }, function(err, token) {
8282
console.log(token);
8383
});
8484
```

0 commit comments

Comments
 (0)