Trait tor_checkable::ExternallySigned
source · [−]pub trait ExternallySigned<T>: Sized {
type Key: ?Sized;
type KeyHint;
type Error;
fn key_is_correct(&self, k: &Self::Key) -> Result<(), Self::KeyHint>;
fn is_well_signed(&self, k: &Self::Key) -> Result<(), Self::Error>;
fn dangerously_assume_wellsigned(self) -> T;
fn check_signature(self, k: &Self::Key) -> Result<T, Self::Error> { ... }
}
Expand description
A cryptographically signed object that needs an external public key to validate it.
Associated Types
The type of the public key object.
You can use a tuple or a vector here if the object is signed with multiple keys.
Required methods
Check whether k is the right key for this object. If not, return an error describing what key would be right.
This function is allowed to return ‘true’ for a bad key, but never ‘false’ for a good key.
Check the signature on this object
fn dangerously_assume_wellsigned(self) -> T
fn dangerously_assume_wellsigned(self) -> T
Unwrap this object without checking any signatures on it.
Provided methods
fn 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.