Struct tor_netdoc::doc::netstatus::UnvalidatedConsensus
source · [−]pub struct UnvalidatedConsensus<RS> { /* private fields */ }
Expand description
A Microdesc consensus whose signatures have not yet been checked.
To validate this object, call set_n_authorities() on it, then call check_signature() on that result with the set of certs that you have. Make sure only to provide authority certificates representing real authorities!
Implementations
sourceimpl<RS> UnvalidatedConsensus<RS>
impl<RS> UnvalidatedConsensus<RS>
Tell the unvalidated consensus how many authorities we believe in.
Without knowing this number, we can’t validate the signature.
sourcepub fn signing_cert_ids(&self) -> impl Iterator<Item = AuthCertKeyIds>
pub fn signing_cert_ids(&self) -> impl Iterator<Item = AuthCertKeyIds>
Return an iterator of all the certificate IDs that we might use to validate this consensus.
sourcepub fn peek_lifetime(&self) -> &Lifetime
pub fn peek_lifetime(&self) -> &Lifetime
Return the lifetime of this unvalidated consensus
Return true if a client who believes in exactly the provided set of authority IDs might might consider this consensus to be well-signed.
(This is the case if the consensus claims to be signed by more than half of the authorities in the list.)
Trait Implementations
sourceimpl<RS: Clone> Clone for UnvalidatedConsensus<RS>
impl<RS: Clone> Clone for UnvalidatedConsensus<RS>
sourcefn clone(&self) -> UnvalidatedConsensus<RS>
fn clone(&self) -> UnvalidatedConsensus<RS>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<RS: Debug> Debug for UnvalidatedConsensus<RS>
impl<RS: Debug> Debug for UnvalidatedConsensus<RS>
sourceimpl<RS> ExternallySigned<Consensus<RS>> for UnvalidatedConsensus<RS>
impl<RS> ExternallySigned<Consensus<RS>> for UnvalidatedConsensus<RS>
type KeyHint = Vec<AuthCertKeyIds, Global>
type KeyHint = Vec<AuthCertKeyIds, Global>
A type that describes what keys are missing for this object.
sourcefn key_is_correct(&self, k: &Self::Key) -> Result<(), Self::KeyHint>
fn key_is_correct(&self, k: &Self::Key) -> Result<(), Self::KeyHint>
Check whether k is the right key for this object. If not, return an error describing what key would be right. Read more
sourcefn is_well_signed(&self, k: &Self::Key) -> Result<(), Self::Error>
fn is_well_signed(&self, k: &Self::Key) -> Result<(), Self::Error>
Check the signature on this object
sourcefn dangerously_assume_wellsigned(self) -> Consensus<RS>
fn dangerously_assume_wellsigned(self) -> Consensus<RS>
Unwrap this object without checking any signatures on it.
sourcefn check_signature(self, k: &Self::Key) -> Result<T, Self::Error>
fn check_signature(self, k: &Self::Key) -> Result<T, Self::Error>
Unwrap this object if it’s correctly signed by a provided key.
Auto Trait Implementations
impl<RS> RefUnwindSafe for UnvalidatedConsensus<RS> where
RS: RefUnwindSafe,
impl<RS> Send for UnvalidatedConsensus<RS> where
RS: Send,
impl<RS> Sync for UnvalidatedConsensus<RS> where
RS: Sync,
impl<RS> Unpin for UnvalidatedConsensus<RS> where
RS: Unpin,
impl<RS> UnwindSafe for UnvalidatedConsensus<RS> where
RS: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more