(&self)
| 370 | } |
| 371 | |
| 372 | fn validate_signer(&self) -> Result<(), BindingEncodeError> { |
| 373 | let public_key = PublicKey::from_bytes(&self.signer.verifying_key).map_err(|error| { |
| 374 | BindingEncodeError::SignerMismatch { |
| 375 | did: self.signer.did.clone(), |
| 376 | reason: error.to_string(), |
| 377 | } |
| 378 | })?; |
| 379 | if !atomic_canonical::did::did_matches_public_key(&self.signer.did, &public_key) { |
| 380 | return Err(BindingEncodeError::SignerMismatch { |
| 381 | did: self.signer.did.clone(), |
| 382 | reason: "the DID does not resolve to the verifying key".to_string(), |
| 383 | }); |
| 384 | } |
| 385 | Ok(()) |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | fn validate_view_hint(hint: Option<&str>) -> Result<(), BindingEncodeError> { |
no test coverage detected