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