pub struct NetworkStatusUnverified {
body: NetworkStatus,
pub sigs: SignaturesData<NetworkStatusUnverified>,
}Expand description
Signed (unverified) form of NetworkStatus
Embodies:
NetworkStatus: document bodyNetworkStatusSignatures: signatures
If this type was parsed from a document text, the signatures have not yet been verified.
Use a .verify_... method to obtain useable, verified, contents.
Fields§
§body: NetworkStatusThe actual body
sigs: SignaturesData<NetworkStatusUnverified>Signatures
Implementations§
Source§impl NetworkStatusUnverified
impl NetworkStatusUnverified
Sourcepub fn can_verify(
&self,
trusted_authorities: &[RsaIdentity],
certs_already: &[AuthCert],
) -> Result<(), ConsensusVerifiabilityError>
pub fn can_verify( &self, trusted_authorities: &[RsaIdentity], certs_already: &[AuthCert], ) -> Result<(), ConsensusVerifiabilityError>
Could we verify this consensus or do we need more authcerts?
Ok means that we have enough authcerts to verify the signature.
Err means that we have not enough authcerts,
or the consensus has not enough signatures.
The ConsensusVerifiabilityError error gives the details.
Sourcepub fn verify(
self,
trusted_authorities: &[RsaIdentity],
certs: &[AuthCert],
) -> Result<TimerangeBound<NetworkStatus>, ConsensusVerifyFailed>
pub fn verify( self, trusted_authorities: &[RsaIdentity], certs: &[AuthCert], ) -> Result<TimerangeBound<NetworkStatus>, ConsensusVerifyFailed>
Verify the signatures
Doesn’t check the validity period:
the document is wrapped in TimerangeBound,
ensuring that the caller does that check.
Sourcefn verify_general<E>(
sigs: &SignaturesData<Self>,
trusted: &[RsaIdentity],
certs: &[AuthCert],
do_verify: impl Fn(ConsensusSignatureToVerify<'_>) -> Result<SignatureVerifiedIfIntended, E>,
) -> Result<(), E>where
ConsensusVerifiabilityError: Into<E>,
fn verify_general<E>(
sigs: &SignaturesData<Self>,
trusted: &[RsaIdentity],
certs: &[AuthCert],
do_verify: impl Fn(ConsensusSignatureToVerify<'_>) -> Result<SignatureVerifiedIfIntended, E>,
) -> Result<(), E>where
ConsensusVerifiabilityError: Into<E>,
Glue to call SignatureGroup::verify_general given our SignaturesData
SignatureGroup::verify_general contains the actual verification code,
shared between the old parser and the new.
Trait Implementations§
Source§impl Clone for NetworkStatusUnverified
impl Clone for NetworkStatusUnverified
Source§fn clone(&self) -> NetworkStatusUnverified
fn clone(&self) -> NetworkStatusUnverified
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NetworkStatusUnverified
impl Debug for NetworkStatusUnverified
Source§impl NetdocParseable for NetworkStatusUnverified
impl NetdocParseable for NetworkStatusUnverified
Source§fn doctype_for_error() -> &'static str
fn doctype_for_error() -> &'static str
Source§fn is_intro_item_keyword(kw: KeywordRef<'_>) -> bool
fn is_intro_item_keyword(kw: KeywordRef<'_>) -> bool
Keyword an intro Item Keyword for this kind of document? Read moreSource§fn is_structural_keyword(kw: KeywordRef<'_>) -> Option<IsStructural>
fn is_structural_keyword(kw: KeywordRef<'_>) -> Option<IsStructural>
Keyword a structural keyword for this kind of document? Read moreSource§fn from_items<'s>(
input: &mut ItemStream<'s>,
outer_stop: StopAt<impl StopPredicate>,
) -> Result<NetworkStatusUnverified, ErrorProblem>
fn from_items<'s>( input: &mut ItemStream<'s>, outer_stop: StopAt<impl StopPredicate>, ) -> Result<NetworkStatusUnverified, ErrorProblem>
Source§impl NetdocParseableUnverified for NetworkStatusUnverified
impl NetdocParseableUnverified for NetworkStatusUnverified
Source§type Body = NetworkStatus
type Body = NetworkStatus
Source§type Signatures = NetworkStatusSignatures
type Signatures = NetworkStatusSignatures
Source§fn inspect_unverified(
&self,
) -> (&Self::Body, &SignaturesData<NetworkStatusUnverified>)
fn inspect_unverified( &self, ) -> (&Self::Body, &SignaturesData<NetworkStatusUnverified>)
Source§fn unwrap_unverified(
self,
) -> (Self::Body, SignaturesData<NetworkStatusUnverified>)
fn unwrap_unverified( self, ) -> (Self::Body, SignaturesData<NetworkStatusUnverified>)
Source§fn from_parts(
body: Self::Body,
sigs: SignaturesData<NetworkStatusUnverified>,
) -> Self
fn from_parts( body: Self::Body, sigs: SignaturesData<NetworkStatusUnverified>, ) -> Self
NetdocParseableUnverified from a body and signatures Read moreAuto Trait Implementations§
impl Freeze for NetworkStatusUnverified
impl RefUnwindSafe for NetworkStatusUnverified
impl Send for NetworkStatusUnverified
impl Sync for NetworkStatusUnverified
impl Unpin for NetworkStatusUnverified
impl UnsafeUnpin for NetworkStatusUnverified
impl UnwindSafe for NetworkStatusUnverified
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more