pub struct EphemeralSecret(EphemeralSecret);
Expand description
A curve25519 secret key that can only be used once, and that can never be inspected.
See [x25519_dalek::EphemeralSecret
] for more information.
Tuple Fields§
§0: EphemeralSecret
Implementations§
Source§impl EphemeralSecret
impl EphemeralSecret
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 ephemeral 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<'a> From<&'a EphemeralSecret> for PublicKey
impl<'a> From<&'a EphemeralSecret> for PublicKey
Source§fn from(secret: &'a EphemeralSecret) -> Self
fn from(secret: &'a EphemeralSecret) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EphemeralSecret
impl RefUnwindSafe for EphemeralSecret
impl Send for EphemeralSecret
impl Sync for EphemeralSecret
impl Unpin for EphemeralSecret
impl UnwindSafe for EphemeralSecret
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
§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