[][src]Struct clarity::Signature

pub struct Signature {
    pub v: Uint256,
    pub r: Uint256,
    pub s: Uint256,
}

Fields

v: Uint256r: Uint256s: Uint256

Methods

impl Signature
[src]

pub fn new(v: Uint256, r: Uint256, s: Uint256) -> Signature
[src]

pub fn is_valid(&self) -> bool
[src]

pub fn network_id(&self) -> Option<Uint256>
[src]

pub fn check_low_s_metropolis(&self) -> Result<(), Error>
[src]

pub fn check_low_s_homestead(&self) -> Result<(), Error>
[src]

pub fn into_bytes(self) -> [u8; 65]
[src]

Deprecated since 0.1.20:

please use as_bytes instead

Converts a signature into a bytes string.

A signature in binary form consists of 65 bytes where first 32 bytes are "r" in big endian form, next 32 bytes are "s" in big endian form, and at the end there is one byte made of "v".

This also consumes the signature.

pub fn to_bytes(&self) -> [u8; 65]
[src]

Extracts signature as bytes.

This supersedes into_bytes as it does not consume the object itself.

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
[src]

Constructs a signature from a bytes string

This is opposite to into_bytes() where a signature is created based on a slice of bytes.

pub fn recover(&self, hash: &[u8]) -> Result<Address, Error>
[src]

Recover an address from a signature

This can be called with any arbitrary signature, and a hashed message.

Trait Implementations

impl Eq for Signature
[src]

impl Default for Signature
[src]

impl PartialEq<Signature> for Signature
[src]

impl ToString for Signature
[src]

impl Clone for Signature
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Signature
[src]

impl UpperHex for Signature
[src]

impl LowerHex for Signature
[src]

impl Hash for Signature
[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl FromStr for Signature
[src]

type Err = Error

The associated error which can be returned from parsing.

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

Constructs a signature back from a string representation

The input string's length should be exactly 130 not including optional "0x" prefix at the beggining.

impl Serialize for Signature
[src]

impl<'de> Deserialize<'de> for Signature
[src]

Auto Trait Implementations

impl Send for Signature

impl Sync for Signature

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self