Struct fire_crypto::cipher::Keypair
source · pub struct Keypair {
pub secret: StaticSecret,
pub public: PublicKey,
}Expand description
A Keypair that can be used multiple times.
Fields§
§secret: StaticSecret§public: PublicKeyImplementations§
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 32 bytes long.
pub fn to_bytes(&self) -> [u8; 32]
pub fn public(&self) -> &PublicKey
pub fn diffie_hellman(&self, public_key: &PublicKey) -> SharedSecret
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