pub struct PeerTrust { /* private fields */ }Expand description
Trust-on-first-use bookkeeping for one peer.
Pins a fingerprint the first time a peer is seen and never moves the pin silently: a later
mismatch is reported, not applied, and only PeerTrust::repin accepts a new key.
Implementations§
Source§impl PeerTrust
impl PeerTrust
Sourcepub fn observe(&mut self, fingerprint: Fingerprint) -> PinOutcome
pub fn observe(&mut self, fingerprint: Fingerprint) -> PinOutcome
Compare fingerprint against the pin, recording it on first contact.
Sourcepub fn repin(&mut self, fingerprint: Fingerprint)
pub fn repin(&mut self, fingerprint: Fingerprint)
Explicitly accept fingerprint as the pin, after the caller has decided a key change is
legitimate. Clears verification, since that was asserted for the old key.
Sourcepub const fn pinned(&self) -> Option<Fingerprint>
pub const fn pinned(&self) -> Option<Fingerprint>
The currently pinned fingerprint, if any.
Sourcepub const fn is_verified(&self) -> bool
pub const fn is_verified(&self) -> bool
Whether the pinned fingerprint has been confirmed out of band.
Sourcepub fn set_verified(&mut self, verified: bool)
pub fn set_verified(&mut self, verified: bool)
Record that the pinned fingerprint has (or has not) been confirmed out of band.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerTrust
impl RefUnwindSafe for PeerTrust
impl Send for PeerTrust
impl Sync for PeerTrust
impl Unpin for PeerTrust
impl UnsafeUnpin for PeerTrust
impl UnwindSafe for PeerTrust
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