Trait tor_checkable::SelfSigned
source · pub trait SelfSigned<T>: Sized {
type Error;
// Required methods
fn is_well_signed(&self) -> Result<(), Self::Error>;
fn dangerously_assume_wellsigned(self) -> T;
// Provided method
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.
Required Associated Types§
Required Methods§
sourcefn is_well_signed(&self) -> Result<(), Self::Error>
fn is_well_signed(&self) -> Result<(), Self::Error>
Check the signature on this object
sourcefn dangerously_assume_wellsigned(self) -> T
fn dangerously_assume_wellsigned(self) -> T
Return the underlying object without checking its signature.
Provided Methods§
sourcefn check_signature(self) -> Result<T, Self::Error>
fn check_signature(self) -> Result<T, Self::Error>
Unwrap this object if the signature is valid
Object Safety§
This trait is not object safe.