pub struct Signature;Expand description
structure contains serveral methods to handle signing of chunked data.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new_keypair() -> Keypair
pub fn new_keypair() -> Keypair
generates a new, random keypair.
Sourcepub fn new_keypair_from_base64<K: Into<String>>(key: K) -> Result<Keypair>
pub fn new_keypair_from_base64<K: Into<String>>(key: K) -> Result<Keypair>
returns a keypair, parsed from the input data (formatted as base64).
Input data can be a secret key (32 bytes) or a secret/public keypair (64 bytes).
Sourcepub fn sign(keypair: &Keypair, message: &[u8]) -> [u8; 64]
pub fn sign(keypair: &Keypair, message: &[u8]) -> [u8; 64]
sign the data with the given keypair bytes.
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more