pub struct StaticSecret(/* private fields */);
Expand description
A curve25519 secret key that can be used more than once, and whose value can be inspected.
See [x25519_dalek::StaticSecret
] for more information.
Implementations§
Source§impl StaticSecret
impl StaticSecret
Sourcepub fn random_from_rng<R: RngCore + CryptoRng>(csprng: R) -> Self
pub fn random_from_rng<R: RngCore + CryptoRng>(csprng: R) -> Self
Return a new random static secret key.
Sourcepub fn diffie_hellman(&self, their_public: &PublicKey) -> SharedSecret
pub fn diffie_hellman(&self, their_public: &PublicKey) -> SharedSecret
Negotiate a shared secret using this secret key and a public key.
Trait Implementations§
Source§impl Clone for StaticSecret
impl Clone for StaticSecret
Source§fn clone(&self) -> StaticSecret
fn clone(&self) -> StaticSecret
Returns a duplicate 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<'a> From<&'a StaticSecret> for PublicKey
impl<'a> From<&'a StaticSecret> for PublicKey
Source§fn from(secret: &'a StaticSecret) -> Self
fn from(secret: &'a StaticSecret) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StaticSecret
impl RefUnwindSafe for StaticSecret
impl Send for StaticSecret
impl Sync for StaticSecret
impl Unpin for StaticSecret
impl UnwindSafe for StaticSecret
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more