Struct orion::kex::EphemeralClientSession
source · [−]pub struct EphemeralClientSession { /* private fields */ }
Available on crate feature
safe_api
only.Expand description
A key pair used to establish shared keys for a single session.
Implementations
sourceimpl EphemeralClientSession
impl EphemeralClientSession
sourcepub fn new() -> Result<Self, UnknownCryptoError>
pub fn new() -> Result<Self, UnknownCryptoError>
Generate a new random key pair.
sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Get a reference to the PublicKey
.
sourcepub fn private_key(&self) -> &PrivateKey
pub fn private_key(&self) -> &PrivateKey
Get a reference to the PrivateKey
.
sourcepub fn establish_with_server(
self,
server_public_key: &PublicKey
) -> Result<SessionKeys, UnknownCryptoError>
pub fn establish_with_server(
self,
server_public_key: &PublicKey
) -> Result<SessionKeys, UnknownCryptoError>
Establish session keys with a server. This moves self
to ensure that the keys
generated with Self::new()
are only used for this key exchange, thus remaining ephemeral.
Trait Implementations
sourceimpl Debug for EphemeralClientSession
impl Debug for EphemeralClientSession
sourceimpl PartialEq<EphemeralClientSession> for EphemeralClientSession
impl PartialEq<EphemeralClientSession> for EphemeralClientSession
sourcefn eq(&self, other: &EphemeralClientSession) -> bool
fn eq(&self, other: &EphemeralClientSession) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &EphemeralClientSession) -> bool
fn ne(&self, other: &EphemeralClientSession) -> bool
This method tests for !=
.
impl StructuralPartialEq for EphemeralClientSession
Auto Trait Implementations
impl RefUnwindSafe for EphemeralClientSession
impl Send for EphemeralClientSession
impl Sync for EphemeralClientSession
impl Unpin for EphemeralClientSession
impl UnwindSafe for EphemeralClientSession
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more