MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / sign_with_mac

Method sign_with_mac

atomic-core/src/change/attestation.rs:518–529  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Calls 5

signature_inputMethod · 0.80
as_bytesMethod · 0.45
to_hexMethod · 0.45
finalizeMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected