pub struct AuditLog { /* private fields */ }Expand description
Appends signed, hash-chained entries to a tamper-evident log.
Each append signs the new entry’s digest and links it to
the previous entry, so the log can later be proven complete and unaltered. The
log holds the signing identity and the chain head; it does not store the entries
itself, so the caller persists each entry’s to_bytes to
durable storage (a file or SD card in the field) and rebuilds the chain from
there.
§Examples
use pamoja_audit::{verify_chain, AuditLog};
use pamoja_security::DeviceIdentity;
let device = DeviceIdentity::from_seed(&[9u8; 32]);
let public = device.public();
let mut log = AuditLog::new(device);
let entries = [log.append(b"4.6C"), log.append(b"4.9C")];
assert!(verify_chain(&public, &entries).is_ok());Implementations§
Auto Trait Implementations§
impl Freeze for AuditLog
impl RefUnwindSafe for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
impl UnwindSafe for AuditLog
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