pub struct SensitiveBytes<const N: usize, O> { /* private fields */ }Expand description
N is the byte length and O is a chosen zero-sized type that lets the
type system track where the bytes came from (BIP39 seed, dice entropy, AES
key, decrypted KEF payload, etc…).
§Example
use kdk_zeroize::SensitiveBytes;
// A caller-chosen marker type.
pub enum AesKey {}
type AesKey256 = SensitiveBytes<32, AesKey>;
let key = AesKey256::new([0u8; 32]);Implementations§
Source§impl<const N: usize, O> SensitiveBytes<N, O>
impl<const N: usize, O> SensitiveBytes<N, O>
Trait Implementations§
Source§impl<const N: usize, O> Debug for SensitiveBytes<N, O>
impl<const N: usize, O> Debug for SensitiveBytes<N, O>
Source§impl<const N: usize, O> Display for SensitiveBytes<N, O>
impl<const N: usize, O> Display for SensitiveBytes<N, O>
Source§impl<const N: usize, O> Drop for SensitiveBytes<N, O>
impl<const N: usize, O> Drop for SensitiveBytes<N, O>
Source§impl<const N: usize, O> Sensitive for SensitiveBytes<N, O>
impl<const N: usize, O> Sensitive for SensitiveBytes<N, O>
Source§impl<const N: usize, O> SensitiveMut for SensitiveBytes<N, O>
impl<const N: usize, O> SensitiveMut for SensitiveBytes<N, O>
Source§fn expose_secret_mut(&mut self) -> &mut [u8; N]
fn expose_secret_mut(&mut self) -> &mut [u8; N]
Mutable explicit-secret-access getter.
Auto Trait Implementations§
impl<const N: usize, O> Freeze for SensitiveBytes<N, O>
impl<const N: usize, O> RefUnwindSafe for SensitiveBytes<N, O>where
O: RefUnwindSafe,
impl<const N: usize, O> Send for SensitiveBytes<N, O>where
O: Send,
impl<const N: usize, O> Sync for SensitiveBytes<N, O>where
O: Sync,
impl<const N: usize, O> Unpin for SensitiveBytes<N, O>where
O: Unpin,
impl<const N: usize, O> UnsafeUnpin for SensitiveBytes<N, O>
impl<const N: usize, O> UnwindSafe for SensitiveBytes<N, O>where
O: UnwindSafe,
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