Skip to content

Commit

Permalink
Merge pull request #6 from msamblanet/issue5
Browse files Browse the repository at this point in the history
Update: include key in JWS.verify result (Closes #5)
  • Loading branch information
linuxwolf committed Oct 8, 2015
2 parents eeef0c0 + d5a31b8 commit d1267b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -320,6 +320,7 @@ jose.JWS.createVerify(keystore).
// * header: the combined 'protected' and 'unprotected' header members
// * payload: Buffer of the signed content
// * signature: Buffer of the verified signature
// * key: The key used to verify the signature
});
```

Expand Down
3 changes: 2 additions & 1 deletion lib/jws/verify.js
Expand Up @@ -108,7 +108,8 @@ var JWSVerifier = function(ks) {
var jws = {
header: sig.header,
payload: payload,
signature: result.mac
signature: result.mac,
key: algKey
};
resolve(jws);
}, processSig);
Expand Down
3 changes: 3 additions & 0 deletions test/jws/jws-test.js
Expand Up @@ -89,6 +89,7 @@ describe("jws", function() {
// But let's make it clear that result.payload needs to be
// converted before actually being a string.
var payload = result.payload.toString();
assert.deepEqual(result.key, input.key);
assert.deepEqual(payload, input.payload);
});
});
Expand All @@ -103,6 +104,7 @@ describe("jws", function() {
// But let's make it clear that result.payload needs to be
// converted before actually being a string.
var payload = result.payload.toString();
assert.deepEqual(result.key, input.key);
assert.deepEqual(payload, input.payload);
});
});
Expand All @@ -117,6 +119,7 @@ describe("jws", function() {
// But let's make it clear that result.payload needs to be
// converted before actually being a string.
var payload = result.payload.toString();
assert.deepEqual(result.key, input.key);
assert.deepEqual(payload, input.payload);
});
});
Expand Down

0 comments on commit d1267b2

Please sign in to comment.