pub struct EphemeralKeyLease { /* private fields */ }Expand description
Ephemeral X25519 + Ed25519 material: generate, use, rotate, cancel, destroy.
Implementations§
Source§impl EphemeralKeyLease
impl EphemeralKeyLease
Sourcepub fn generate(purpose: KeyPurpose) -> Result<Self, CryptoError>
pub fn generate(purpose: KeyPurpose) -> Result<Self, CryptoError>
Generate a live lease from OS entropy. Failure is EntropyFailure.
Sourcepub fn purpose(&self) -> Result<KeyPurpose, CryptoError>
pub fn purpose(&self) -> Result<KeyPurpose, CryptoError>
The key purpose this lease was issued for.
Sourcepub fn x25519_public(&self) -> Result<[u8; 32], CryptoError>
pub fn x25519_public(&self) -> Result<[u8; 32], CryptoError>
The lease’s X25519 public key.
Sourcepub fn ed25519_public(&self) -> Result<[u8; 32], CryptoError>
pub fn ed25519_public(&self) -> Result<[u8; 32], CryptoError>
The lease’s Ed25519 public key.
Sourcepub fn diffie_hellman(&self, peer: &[u8; 32]) -> Result<[u8; 32], CryptoError>
pub fn diffie_hellman(&self, peer: &[u8; 32]) -> Result<[u8; 32], CryptoError>
Use: X25519 Diffie-Hellman. Rejects all-zero shared secrets via the adapter.
Sourcepub fn sign_ed25519(
&self,
message: &[u8],
context: &[u8],
sig_out: &mut [u8; 64],
) -> Result<(), CryptoError>
pub fn sign_ed25519( &self, message: &[u8], context: &[u8], sig_out: &mut [u8; 64], ) -> Result<(), CryptoError>
Use: Ed25519 with the network length-delimited context.
Sourcepub fn rotate(&mut self) -> Result<(), CryptoError>
pub fn rotate(&mut self) -> Result<(), CryptoError>
Replace material with a fresh OS draw; previous bytes are destroyed.
Trait Implementations§
Source§impl Debug for EphemeralKeyLease
impl Debug for EphemeralKeyLease
Source§impl Drop for EphemeralKeyLease
impl Drop for EphemeralKeyLease
Auto Trait Implementations§
impl Freeze for EphemeralKeyLease
impl RefUnwindSafe for EphemeralKeyLease
impl Send for EphemeralKeyLease
impl Sync for EphemeralKeyLease
impl Unpin for EphemeralKeyLease
impl UnsafeUnpin for EphemeralKeyLease
impl UnwindSafe for EphemeralKeyLease
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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