pub struct RevocationLog { /* private fields */ }Expand description
The ordered, signed nodes of one user’s revocation log.
Implementations§
Source§impl RevocationLog
impl RevocationLog
Sourcepub fn genesis(user: &UserKey) -> Result<Self>
pub fn genesis(user: &UserKey) -> Result<Self>
A new log owned by user: just the signed genesis node.
§Errors
MeshError::Encoding if the node cannot be encoded.
Sourcepub fn append(&mut self, user: &UserKey, entry: RevocationEntry) -> Result<()>
pub fn append(&mut self, user: &UserKey, entry: RevocationEntry) -> Result<()>
Append entry, signed by user, parented on the current head.
§Errors
MeshError::RevocationState if user does not own this log, the log
is not valid, entry is a Genesis, or a Generation does not exceed
the current one. Nothing is appended on error.
Sourcepub fn verify(&self) -> Result<RevocationState>
pub fn verify(&self) -> Result<RevocationState>
Check the whole log and fold it into a RevocationState.
Fail-closed: genesis first, each parent is the previous id, every signature verifies under the genesis user, generations strictly increase.
§Errors
MeshError::RevocationState for a structural break;
MeshError::BadSignature for a signature that does not verify.
Sourcepub fn extends(&self, seen: &Seen) -> Result<()>
pub fn extends(&self, seen: &Seen) -> Result<()>
Refuse a log that is shorter than what the consumer seen, or whose
node at that position is not the head they saw (a fork). A log that is
itself invalid, or belongs to another user, is refused too.
§Errors
MeshError::RevocationState on rollback, fork, wrong user, or empty seen.