Struct fire_crypto::signature::Keypair
source · pub struct Keypair { /* private fields */ }Implementations§
source§impl Keypair
impl Keypair
pub const LEN: usize = 32usize
pub fn new() -> Self
sourcepub fn from_slice(slice: &[u8]) -> Self
pub fn from_slice(slice: &[u8]) -> Self
Panics
if the slice is not valid.
pub fn to_bytes(&self) -> [u8; 32]
pub fn public(&self) -> &PublicKey
pub fn sign(&self, msg: impl AsRef<[u8]>) -> Signature
pub fn verify(&self, msg: impl AsRef<[u8]>, signature: &Signature) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Keypair
impl<'de> Deserialize<'de> for Keypair
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Keypair
impl Send for Keypair
impl Sync for Keypair
impl Unpin for Keypair
impl UnwindSafe for Keypair
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