pub struct SigningKeypair(/* private fields */);Implementations§
Source§impl SigningKeypair
impl SigningKeypair
pub fn generate<R>(csprng: &mut R) -> SigningKeypair
pub fn try_from_bytes_slices( pubkey: [u8; 32], seckey: [u8; 32], ) -> Result<SigningKeypair, CryptoError>
pub fn try_from_str( public_key: &str, secret_key: &str, ) -> Result<SigningKeypair, CryptoError>
pub fn try_from_secret_bytes( secret_key_bytes: &[u8; 32], ) -> Result<SigningKeypair, CryptoError>
pub fn public(&self) -> [u8; 32]
pub fn secret(&self) -> [u8; 32]
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn sign(&self, msg: &[u8]) -> Signature
Trait Implementations§
Source§impl Debug for SigningKeypair
impl Debug for SigningKeypair
Source§impl<'de> Deserialize<'de> for SigningKeypair
impl<'de> Deserialize<'de> for SigningKeypair
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SigningKeypair, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SigningKeypair, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&SigningKeypair> for SigningKeypair
impl From<&SigningKeypair> for SigningKeypair
Source§fn from(other: &SigningKeypair) -> SigningKeypair
fn from(other: &SigningKeypair) -> SigningKeypair
Converts to this type from the input type.
Source§impl PartialEq for SigningKeypair
impl PartialEq for SigningKeypair
Source§impl Serialize for SigningKeypair
impl Serialize for SigningKeypair
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for SigningKeypair
impl RefUnwindSafe for SigningKeypair
impl Send for SigningKeypair
impl Sync for SigningKeypair
impl Unpin for SigningKeypair
impl UnwindSafe for SigningKeypair
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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