Struct jormungandr_lib::crypto::key::Signature
source · pub struct Signature<T, A: VerificationAlgorithm>(Signature<T, A>);
Expand description
signature for the given cryptographic algorithm and associated type
It can be created from a SigningKey
and a value of type T
and
verified against an Identifier
and the value of type T
.
Tuple Fields§
§0: Signature<T, A>
Implementations§
source§impl<T, A: VerificationAlgorithm> Signature<T, A>
impl<T, A: VerificationAlgorithm> Signature<T, A>
sourcepub fn to_bech32_str(&self) -> String
pub fn to_bech32_str(&self) -> String
encode the Signature
into a bech32 string.
This is a human readable encoding that allows to check input validation. When displaying this signing key to the user it is preferable to provide the output of this function.
Serde implementation of Signature
provides the bech32 string support.
sourcepub fn from_bech32_str(s: &str) -> Result<Self, Error>
pub fn from_bech32_str(s: &str) -> Result<Self, Error>
try to decode the given bech32 string into a valid signature
pub fn to_hex(&self) -> String
pub fn from_hex(s: &str) -> Result<Self, SignatureFromStrError>
pub fn coerce<U>(self) -> Signature<U, A>
Trait Implementations§
source§impl<'de, T, A: VerificationAlgorithm> Deserialize<'de> for Signature<T, A>
impl<'de, T, A: VerificationAlgorithm> Deserialize<'de> for Signature<T, A>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<S, T, A: VerificationAlgorithm> PartialEq<Signature<S, A>> for Signature<T, A>
impl<S, T, A: VerificationAlgorithm> PartialEq<Signature<S, A>> for Signature<T, A>
impl<T, A: VerificationAlgorithm> Eq for Signature<T, A>
Auto Trait Implementations§
impl<T, A> RefUnwindSafe for Signature<T, A>where T: RefUnwindSafe, <A as VerificationAlgorithm>::Signature: RefUnwindSafe,
impl<T, A> Send for Signature<T, A>where T: Send, <A as VerificationAlgorithm>::Signature: Send,
impl<T, A> Sync for Signature<T, A>where T: Sync, <A as VerificationAlgorithm>::Signature: Sync,
impl<T, A> Unpin for Signature<T, A>where T: Unpin, <A as VerificationAlgorithm>::Signature: Unpin,
impl<T, A> UnwindSafe for Signature<T, A>where T: UnwindSafe, <A as VerificationAlgorithm>::Signature: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more