pub struct StaticKeyExchange { /* private fields */ }Expand description
X25519 key exchange with a static (reusable) secret
Unlike KeyExchange which uses ephemeral secrets that can only be used once,
this struct uses a static secret that can be reused for multiple key derivations.
Implementations§
Source§impl StaticKeyExchange
impl StaticKeyExchange
Sourcepub fn from_secret(secret_bytes: [u8; 32]) -> Self
pub fn from_secret(secret_bytes: [u8; 32]) -> Self
Create from existing secret bytes
Sourcepub fn public_key_bytes(&self) -> [u8; 32]
pub fn public_key_bytes(&self) -> [u8; 32]
Get our public key bytes
Sourcepub fn public_key_base64(&self) -> String
pub fn public_key_base64(&self) -> String
Get our public key as base64
Derive shared secret from peer’s public key This can be called multiple times (unlike ephemeral key exchange)
Trait Implementations§
Source§impl Debug for StaticKeyExchange
impl Debug for StaticKeyExchange
Auto Trait Implementations§
impl Freeze for StaticKeyExchange
impl RefUnwindSafe for StaticKeyExchange
impl Send for StaticKeyExchange
impl Sync for StaticKeyExchange
impl Unpin for StaticKeyExchange
impl UnwindSafe for StaticKeyExchange
Blanket Implementations§
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request