pub struct KeyHandle { /* private fields */ }Expand description
Opaque, redacted reference to a key stored inside a
KeyVault.
A KeyHandle is cheap to clone (it is Copy-shaped — currently Clone + Copy) and safe to pass across threads. It exposes no methods that return
raw key bytes; all operations that need the underlying material are performed
by the vault on the caller’s behalf.
§Examples
use key_vault::KeyHandle;
// Handles are only constructed by the vault. In tests you can construct one
// via the unit-tested helper. The important property is opacity:
let rendered = format!("{h:?}");
assert!(rendered.contains("redacted"));§Equality
KeyHandle implements both PartialEq and
subtle::ConstantTimeEq. The latter is the equality check the vault
uses internally: it compares both inner identifiers in constant time
regardless of input values, eliminating timing side-channels even
though the underlying ids are not themselves secret.
Trait Implementations§
Source§impl ConstantTimeEq for KeyHandle
impl ConstantTimeEq for KeyHandle
impl Copy for KeyHandle
impl Eq for KeyHandle
Auto Trait Implementations§
impl Freeze for KeyHandle
impl RefUnwindSafe for KeyHandle
impl Send for KeyHandle
impl Sync for KeyHandle
impl Unpin for KeyHandle
impl UnsafeUnpin for KeyHandle
impl UnwindSafe for KeyHandle
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