pub struct Curve25519SecretKey(/* private fields */);
Expand description
Struct representing a Curve25519 secret key.
Implementations§
Source§impl Curve25519SecretKey
impl Curve25519SecretKey
Sourcepub fn from_slice(bytes: &[u8; 32]) -> Self
pub fn from_slice(bytes: &[u8; 32]) -> Self
Create a Curve25519SecretKey
from the given slice of bytes.
Sourcepub fn diffie_hellman(
&self,
their_public_key: &Curve25519PublicKey,
) -> SharedSecret
pub fn diffie_hellman( &self, their_public_key: &Curve25519PublicKey, ) -> SharedSecret
Perform a Diffie-Hellman key exchange between the given
Curve25519PublicKey
and this Curve25519SecretKey
and return a shared
secret.
Trait Implementations§
Source§impl Clone for Curve25519SecretKey
impl Clone for Curve25519SecretKey
Source§fn clone(&self) -> Curve25519SecretKey
fn clone(&self) -> Curve25519SecretKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for Curve25519SecretKey
impl Default for Curve25519SecretKey
Source§impl<'de> Deserialize<'de> for Curve25519SecretKey
impl<'de> Deserialize<'de> for Curve25519SecretKey
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
Source§impl<'a> From<&'a Curve25519SecretKey> for Curve25519PublicKey
impl<'a> From<&'a Curve25519SecretKey> for Curve25519PublicKey
Source§fn from(secret: &'a Curve25519SecretKey) -> Curve25519PublicKey
fn from(secret: &'a Curve25519SecretKey) -> Curve25519PublicKey
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Curve25519SecretKey
impl RefUnwindSafe for Curve25519SecretKey
impl Send for Curve25519SecretKey
impl Sync for Curve25519SecretKey
impl Unpin for Curve25519SecretKey
impl UnwindSafe for Curve25519SecretKey
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