pub struct ReceiptLog { /* private fields */ }Expand description
An append-only, hash-chained receipt log.
Implementations§
Source§impl ReceiptLog
impl ReceiptLog
Sourcepub fn from_entries(entries: Vec<Receipt>) -> Self
pub fn from_entries(entries: Vec<Receipt>) -> Self
Create a log from existing entries (e.g., loaded from disk).
Sourcepub fn next_sequence(&self) -> u64
pub fn next_sequence(&self) -> u64
Get the next sequence number.
Sourcepub fn verify_integrity(&self) -> Result<()>
pub fn verify_integrity(&self) -> Result<()>
Verify the integrity of the hash chain (sequence numbers + previous_hash linkage).
This does NOT verify receipt signatures — use verify_integrity_with_key() for
full cryptographic verification including signature checks.
Sourcepub fn verify_integrity_with_key(
&self,
public_key_bytes: &[u8; 32],
) -> Result<()>
pub fn verify_integrity_with_key( &self, public_key_bytes: &[u8; 32], ) -> Result<()>
Verify full cryptographic integrity: hash chain linkage AND each receipt’s signature.
§Security: fix S2 (receipt signatures were never verified)
Without signature verification, an attacker with write access can forge receipts with correct hash chaining — invalidating the entire compliance audit trail.
public_key_bytes is the Ed25519 public key of the agent that signed the receipts.
For multi-agent logs, use verify_integrity_with_resolver() (future).
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReceiptLog
impl RefUnwindSafe for ReceiptLog
impl Send for ReceiptLog
impl Sync for ReceiptLog
impl Unpin for ReceiptLog
impl UnsafeUnpin for ReceiptLog
impl UnwindSafe for ReceiptLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more