Struct salty::signature::Keypair

source ·
pub struct Keypair {
    pub secret: SecretKey,
    pub public: PublicKey,
}
Expand description

pair of secret and corresponding public keys

Fields§

§secret: SecretKey§public: PublicKey

Implementations§

source§

impl Keypair

source

pub fn sign(&self, message: &[u8]) -> Signature

source

pub fn sign_with_context(&self, message: &[u8], context: &[u8]) -> Signature

source

pub fn sign_prehashed( &self, prehashed_message: &[u8; 64], context: Option<&[u8]> ) -> Signature

Trait Implementations§

source§

impl From<&[u8; 32]> for Keypair

source§

fn from(seed: &[u8; 32]) -> Keypair

Converts to this type from the input type.
source§

impl Signer<Signature> for Keypair

source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature, Error>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
§

fn sign(&self, msg: &[u8]) -> S

Sign the given message and return a digital signature

Auto Trait Implementations§

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.

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<S, T> SignerMut<S> for Twhere T: Signer<S>,

§

fn try_sign(&mut self, msg: &[u8]) -> Result<S, Error>

Attempt to sign the given message, updating the state, and returning a digital signature on success, or an error if something went wrong. Read more
§

fn sign(&mut self, msg: &[u8]) -> S

Sign the given message, update the state, and return a digital signature.
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.