Trait tor_checkable::SelfSigned [−][src]
pub trait SelfSigned<T>: Sized { type Error; fn is_well_signed(&self) -> Result<(), Self::Error>; fn dangerously_assume_wellsigned(self) -> T; fn check_signature(self) -> Result<T, Self::Error> { ... } }
Expand description
A cryptographically signed object that can be validated without additional public keys.
It’s better to wrap things in a SelfSigned than to give them an is_valid() method, so that you can make sure that nobody uses the object before checking it. It’s better to wrap things in a SelfSigned than to check them immediately, since you might want to defer the signature checking operation to another thread.
Associated Types
Required methods
fn is_well_signed(&self) -> Result<(), Self::Error>
fn is_well_signed(&self) -> Result<(), Self::Error>Check the signature on this object
fn dangerously_assume_wellsigned(self) -> T
fn dangerously_assume_wellsigned(self) -> TReturn the underlying object without checking its signature.
Provided methods
fn check_signature(self) -> Result<T, Self::Error>
fn check_signature(self) -> Result<T, Self::Error>Unwrap this object if the signature is valid