From cae21144d8e22da33cf36fb7cb36688517e0b771 Mon Sep 17 00:00:00 2001 From: Henry Tsai Date: Wed, 12 Jun 2024 11:47:40 -0700 Subject: [PATCH] Updated error message in verifySignature() (#247) * Updated error message in verifySignature() * Update packages/protocol/src/resource.ts Co-authored-by: Moe Jangda --------- Co-authored-by: Moe Jangda --- packages/protocol/src/message.ts | 2 +- packages/protocol/src/resource.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/protocol/src/message.ts b/packages/protocol/src/message.ts index adb30a3d..242eb2c6 100644 --- a/packages/protocol/src/message.ts +++ b/packages/protocol/src/message.ts @@ -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 diff --git a/packages/protocol/src/resource.ts b/packages/protocol/src/resource.ts index 6c1d2f4d..f972c673 100644 --- a/packages/protocol/src/resource.ts +++ b/packages/protocol/src/resource.ts @@ -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