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>

source

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.

source

pub fn from_bech32_str(s: &str) -> Result<Self, Error>

try to decode the given bech32 string into a valid signature

source

pub fn to_hex(&self) -> String

source

pub fn from_hex(s: &str) -> Result<Self, SignatureFromStrError>

source

pub fn coerce<U>(self) -> Signature<U, A>

source§

impl<A: VerificationAlgorithm, T: AsRef<[u8]>> Signature<T, A>

source

pub fn verify(&self, identifier: &Identifier<A>, object: &T) -> Verification

Trait Implementations§

source§

impl<T, A: VerificationAlgorithm> AsRef<Signature<T, A>> for Signature<T, A>

source§

fn as_ref(&self) -> &Signature<T, A>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, A: VerificationAlgorithm> Clone for Signature<T, A>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, A: VerificationAlgorithm> Debug for Signature<T, A>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T, A: VerificationAlgorithm> Display for Signature<T, A>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, A: VerificationAlgorithm> From<Signature<T, A>> for Signature<T, A>

source§

fn from(signature: Signature<T, A>) -> Self

Converts to this type from the input type.
source§

impl<T, A: VerificationAlgorithm> FromStr for Signature<T, A>

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<T, A: VerificationAlgorithm> Hash for Signature<T, A>

source§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<S, T, A: VerificationAlgorithm> PartialEq<Signature<S, A>> for Signature<T, A>

source§

fn eq(&self, other: &Signature<S, A>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, A: VerificationAlgorithm> Serialize for Signature<T, A>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,