Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Updated error message in verifySignature() (#247)
Browse files Browse the repository at this point in the history
* Updated error message in verifySignature()

* Update packages/protocol/src/resource.ts

Co-authored-by: Moe Jangda <[email protected]>

---------

Co-authored-by: Moe Jangda <[email protected]>
  • Loading branch information
thehenrytsai and mistermoe authored Jun 12, 2024
1 parent c7da892 commit cae2114
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/protocol/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export abstract class Message {
const signer = await Crypto.verify({ detachedPayload: this.digest(), signature: this.signature })

if (this.metadata.from !== signer) { // ensure that DID used to sign matches `from` property in metadata
throw new Error('Signature verification failed: Expected DID in kid of JWS header must match metadata.from')
throw new Error('Signature verification failed: Expected DID in kid of JWS header to match metadata.from')
}

return signer
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export abstract class Resource {
const signer = await Crypto.verify({ detachedPayload: this.digest(), signature: this.signature })

if (this.metadata.from !== signer) { // ensure that DID used to sign matches `from` property in metadata
throw new Error('Signature verification failed: Expected DID in kid of JWS header must match metadata.from')
throw new Error('Signature verification failed: Expected DID in kid of JWS header to match metadata.from')
}

return signer
Expand Down

0 comments on commit cae2114

Please sign in to comment.