Struct x25519_dalek::StaticSecret [−][src]
pub struct StaticSecret(_);
Expand description
A Diffie-Hellman secret key that can be used to compute multiple SharedSecret
s.
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).
Warning
If you’re uncertain about whether you should use this, then you likely
should not be using this. Our strongly recommended advice is to use
EphemeralSecret
at all times, as that type enforces at compile-time that
secret keys are never reused, which can have very serious security
implications for many protocols.
Implementations
Perform a Diffie-Hellman key agreement between self
and
their_public
key to produce a SharedSecret
.
Trait Implementations
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
Given an x25519 StaticSecret
key, compute its corresponding PublicKey
.
Auto Trait Implementations
impl RefUnwindSafe for StaticSecret
impl Send for StaticSecret
impl Sync for StaticSecret
impl Unpin for StaticSecret
impl UnwindSafe for StaticSecret
Blanket Implementations
Mutably borrows from an owned value. Read more