pub struct UnlockKey { /* private fields */ }Expand description
A LUKS key used to unlock a device.
This struct ensures that the sensitive material used to unlock the LUKS container
is protected while in memory and is automatically zeroed when no longer needed.
It intentionally does not implement Debug to prevent accidental exposure of
the unlock key in logs or error reports.
Implementations§
Source§impl UnlockKey
impl UnlockKey
Sourcepub fn from_passphrase(passphrase: String) -> Self
pub fn from_passphrase(passphrase: String) -> Self
Creates a new LUKS unlock key from a passphrase.
Sourcepub fn expose_bytes(&self) -> &[u8] ⓘ
pub fn expose_bytes(&self) -> &[u8] ⓘ
Unboxes the LUKS key, returning its raw bytes for use in cryptographic operations.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UnlockKey
impl RefUnwindSafe for UnlockKey
impl Send for UnlockKey
impl Sync for UnlockKey
impl Unpin for UnlockKey
impl UnsafeUnpin for UnlockKey
impl UnwindSafe for UnlockKey
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