Struct chain_crypto::sign::Signature
source · pub struct Signature<T: ?Sized, A: VerificationAlgorithm> {
signdata: A::Signature,
phantom: PhantomData<T>,
}
Fields§
§signdata: A::Signature
§phantom: PhantomData<T>
Implementations§
source§impl<A: VerificationAlgorithm, T: ?Sized> Signature<T, A>
impl<A: VerificationAlgorithm, T: ?Sized> Signature<T, A>
pub fn from_binary(sig: &[u8]) -> Result<Self, SignatureError>
pub fn coerce<U: ?Sized>(self) -> Signature<U, A>
pub fn safe_coerce<U: ?Sized + SafeSignatureCoerce<T>>(self) -> Signature<U, A>
source§impl<A: VerificationAlgorithm, T: ?Sized + AsRef<[u8]>> Signature<T, A>
impl<A: VerificationAlgorithm, T: ?Sized + AsRef<[u8]>> Signature<T, A>
pub fn verify(&self, publickey: &PublicKey<A>, object: &T) -> Verification
source§impl<A: VerificationAlgorithm, T: ?Sized> Signature<T, A>
impl<A: VerificationAlgorithm, T: ?Sized> Signature<T, A>
pub fn verify_slice( &self, publickey: &PublicKey<A>, slice: &[u8] ) -> Verification
Trait Implementations§
source§impl<T, A> Arbitrary for Signature<T, A>where
A: VerificationAlgorithm + 'static,
A::Signature: Send,
T: Send + 'static,
impl<T, A> Arbitrary for Signature<T, A>where A: VerificationAlgorithm + 'static, A::Signature: Send, T: Send + 'static,
source§impl<T, A: VerificationAlgorithm> Bech32 for Signature<T, A>
impl<T, A: VerificationAlgorithm> Bech32 for Signature<T, A>
source§const BECH32_HRP: &'static str = A::SIGNATURE_BECH32_HRP
const BECH32_HRP: &'static str = A::SIGNATURE_BECH32_HRP
The human-readable prefix that is used to represent the
the object in the Bech32 format. On decoding, the HRP of the input
string is checked against this value.
source§fn try_from_bech32_str(bech32_str: &str) -> Result<Self, Error>
fn try_from_bech32_str(bech32_str: &str) -> Result<Self, Error>
Decodes the object from its Bech32 string representation.
source§fn to_bech32_str(&self) -> String
fn to_bech32_str(&self) -> String
Produces a Bech32 string format representation of the object.
source§impl<T, A: VerificationAlgorithm> Clone for Signature<T, A>
impl<T, A: VerificationAlgorithm> Clone for Signature<T, A>
Auto Trait Implementations§
impl<T: ?Sized, A> RefUnwindSafe for Signature<T, A>where T: RefUnwindSafe, <A as VerificationAlgorithm>::Signature: RefUnwindSafe,
impl<T: ?Sized, A> Send for Signature<T, A>where T: Send, <A as VerificationAlgorithm>::Signature: Send,
impl<T: ?Sized, A> Sync for Signature<T, A>where T: Sync, <A as VerificationAlgorithm>::Signature: Sync,
impl<T: ?Sized, A> Unpin for Signature<T, A>where T: Unpin, <A as VerificationAlgorithm>::Signature: Unpin,
impl<T: ?Sized, A> UnwindSafe for Signature<T, A>where T: UnwindSafe, <A as VerificationAlgorithm>::Signature: UnwindSafe,
Blanket Implementations§
§impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere T: AsRef<[u8]>,
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)