Verify the signature. Any edited covered field — operations, changes, chain link, agent, counters — fails; so does a missing signature.
(&self, key_hex: &str)
| 531 | /// Verify the signature. Any edited covered field — operations, changes, |
| 532 | /// chain link, agent, counters — fails; so does a missing signature. |
| 533 | pub fn verify_mac(&self, key_hex: &str) -> bool { |
| 534 | let Some(signature) = &self.signature else { |
| 535 | return false; |
| 536 | }; |
| 537 | let input = self.signature_input(); |
| 538 | let key = blake3::derive_key("atomic-attestation v3 signature", key_hex.as_bytes()); |
| 539 | blake3::Hasher::new_keyed(&key) |
| 540 | .update(&input) |
| 541 | .finalize() |
| 542 | .to_hex() |
| 543 | .as_str() |
| 544 | == signature.as_str() |
| 545 | } |
| 546 | |
| 547 | /// Whether this attestation was signed by a session MAC key (V3 signer |
| 548 | /// class `session-mac:<session_id>`). |
no test coverage detected