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()
Browse files Browse the repository at this point in the history
  • Loading branch information
thehenrytsai committed May 7, 2024
1 parent c7da892 commit 48ded39
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 must to metadata.from')
}

return signer
Expand Down

0 comments on commit 48ded39

Please sign in to comment.