Persistent Audit Trail
class PersistentAuditTrail(context: Context, retentionProvider: () -> RetentionPolicy, clock: Clock = Clock.SYSTEM, attestationProvider: () -> DeviceAttestationProvider? = null)
Room-backed persistent audit trail with hash chain integrity.
Unlike the file-based AuditTrail, this implementation:
Persists the hash chain across app restarts
Supports signed audit entries with device attestation
Provides integrity verification API
Constructors
Link copied to clipboard
constructor(context: Context, retentionProvider: () -> RetentionPolicy, clock: Clock = Clock.SYSTEM, attestationProvider: () -> DeviceAttestationProvider? = null)
Functions
Link copied to clipboard
Apply retention policy to delete old events.
Link copied to clipboard
Delete all events for a specific user.
Link copied to clipboard
Export signed audit events to a file.
Link copied to clipboard
Get all events for a specific user.
Link copied to clipboard
Get all events in a time range.
Link copied to clipboard
Get statistics about the audit trail.
Link copied to clipboard
Verify the integrity of the audit chain.