Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brianloveswords committed Feb 13, 2013
1 parent 1a25e29 commit 808d1b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Options:

* `header` (required)
* `payload`
* `key` || `publicKey` || `secret`
* `key` || `privateKey` || `secret`

Other than `header`, all options expect a string or a buffer when the
value is known ahead of time, or a stream for convenience.
Expand All @@ -102,7 +102,7 @@ Example
// This...
jws.createSign({
header: { alg: 'rs256' },
key: privateKeyStream,
privateKey: privateKeyStream,
payload: payloadStream,
}).on('done', function(signature) {
// ...
Expand All @@ -112,7 +112,7 @@ jws.createSign({
const signer = jws.createSign(
header: { alg: 'rs256' },
);
privateKeyStream.pipe(signer.key);
privateKeyStream.pipe(signer.privateKey);
payloadStream.pipe(signer.payload);
signer.on('done', function(signature) {
// ...
Expand All @@ -135,15 +135,15 @@ Example

// This...
jws.createVerify({
key: pubKeyStream,
publicKey: pubKeyStream,
signature: sigStream,
}).on('done', function(verified, obj) {
// ...
});

// is equivilant to this:
const verifier = jws.createVerify();
pubKeyStream.pipe(verifier.key);
pubKeyStream.pipe(verifier.publicKey);
sigStream.pipe(verifier.signature);
verifier.on('done', function(verified, obj) {
// ...
Expand Down

0 comments on commit 808d1b1

Please sign in to comment.