A Diffie-Hellman secret key that can be used to compute multiple
This type is identical to the
EphemeralSecret type, except that the
StaticSecret::diffie_hellman method does not consume the secret key, and the type provides
serialization methods to save and load key material. This means that the secret may be used
multiple times (but does not have to be).
Some protocols, such as Noise, already handle the static/ephemeral distinction, so the
additional guarantees provided by
EphemeralSecret are not helpful or would cause duplicate
code paths. In this case, it may be useful to
use x25519_dalek::StaticSecret as SecretKey;
since the only difference between the two is that
StaticSecret does not enforce at
compile-time that the key is only used once.
pub fn diffie_hellman(&self, their_public: &PublicKey) -> SharedSecret[src]
Perform a Diffie-Hellman key agreement between
their_public key to produce a
Generate an x25519 key.
Extract this key’s bytes for serialization.
impl Clone for StaticSecret[src]
impl Drop for StaticSecret[src]
impl<'a> From<&'a StaticSecret> for PublicKey[src]
fn from(secret: &'a StaticSecret) -> PublicKey[src]
impl Zeroize for StaticSecret[src]
impl RefUnwindSafe for StaticSecret
impl Send for StaticSecret
impl Sync for StaticSecret
impl Unpin for StaticSecret
impl UnwindSafe for StaticSecret
type Output = T
Should always be
type Owned = T
The resulting type after obtaining ownership.
pub fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.