Sign this attestation in place with the session MAC key (64 hex chars). The key is domain-separated through `blake3::derive_key` so the same session key signing commit-time captures cannot be transplanted into an attestation signature or vice versa. The signer is recorded as `session-mac: `; this is evidence authentication, not a trust-policy decision (RFC §19 Q4 stays undecided).
(&mut self, key_hex: &str)
| 516 | /// `session-mac:<session_id>`; this is evidence authentication, not a |
| 517 | /// trust-policy decision (RFC §19 Q4 stays undecided). |
| 518 | pub fn sign_with_mac(&mut self, key_hex: &str) { |
| 519 | self.signer = Some(format!("session-mac:{}", self.session_id)); |
| 520 | let input = self.signature_input(); |
| 521 | let key = blake3::derive_key("atomic-attestation v3 signature", key_hex.as_bytes()); |
| 522 | self.signature = Some( |
| 523 | blake3::Hasher::new_keyed(&key) |
| 524 | .update(&input) |
| 525 | .finalize() |
| 526 | .to_hex() |
| 527 | .to_string(), |
| 528 | ); |
| 529 | } |
| 530 | |
| 531 | /// Verify the signature. Any edited covered field — operations, changes, |
| 532 | /// chain link, agent, counters — fails; so does a missing signature. |
no test coverage detected