pub struct Sig(pub Signature);
Expand description
Represents Ethereum-style “recoverable signatures”.
Tuple Fields
0: Signature
Implementations
sourceimpl Sig
impl Sig
sourcepub fn from_bytes(b: &[u8]) -> Result<Self>
pub fn from_bytes(b: &[u8]) -> Result<Self>
Loads the recoverable signature from the bytes.
sourcepub fn from_der(
raw_sig: &[u8],
digest: &[u8],
vkey: &VerifyingKey
) -> Result<Self>
pub fn from_der(
raw_sig: &[u8],
digest: &[u8],
vkey: &VerifyingKey
) -> Result<Self>
Loads the recoverable signature from the DER-encoded bytes, as defined by ANS X9.62–2005 and RFC 3279 Section 2.2.3. ref. https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html#KMS-Sign-response-Signature
sourcepub fn recover_public_key(&self, digest: &[u8]) -> Result<(Key, VerifyingKey)>
pub fn recover_public_key(&self, digest: &[u8]) -> Result<(Key, VerifyingKey)>
Recovers the public key from the 32-byte SHA256 output message using its signature.
pub fn r(&self) -> U256
pub fn s(&self) -> U256
Trait Implementations
impl Eq for Sig
impl StructuralEq for Sig
impl StructuralPartialEq for Sig
Auto Trait Implementations
impl RefUnwindSafe for Sig
impl Send for Sig
impl Sync for Sig
impl Unpin for Sig
impl UnwindSafe for Sig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.