Verify this signature against a message and ensure the signer matches.
(
&self,
message: &[u8],
expected_signer: &IdentityId,
)
| 258 | |
| 259 | /// Verify this signature against a message and ensure the signer matches. |
| 260 | pub fn verify_signer( |
| 261 | &self, |
| 262 | message: &[u8], |
| 263 | expected_signer: &IdentityId, |
| 264 | ) -> Result<(), IdentityError> { |
| 265 | if self.signer_id != *expected_signer { |
| 266 | return Err(IdentityError::VerificationFailed( |
| 267 | "Signer does not match expected identity".to_string(), |
| 268 | )); |
| 269 | } |
| 270 | self.verify(message) |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | impl fmt::Display for SignatureInfo { |