Skip to main content

SensitiveSlice

Type Alias SensitiveSlice 

Source
pub type SensitiveSlice<'a> = Sensitive<&'a [u8]>;
Expand description

A zero-copy view over a borrowed slice of secret bytes. Wrapping a &[u8] borrows the underlying buffer instead of cloning it, so the wrapper is bound by the borrow’s lifetime 'a and cannot outlive the data it points at. Debug/Display are redacted via the inner Sensitive.

For owned secret bytes (e.g. when deserializing, where borrowing is not possible) use Sensitive<Vec<u8>> instead.

Aliased Type§

pub struct SensitiveSlice<'a>(pub(crate) &'a [u8]);

Tuple Fields§

§0: &'a [u8]

Trait Implementations§

Source§

impl<'a, const N: usize> From<&'a [u8; N]> for SensitiveSlice<'a>

Source§

fn from(value: &'a [u8; N]) -> Self

Converts to this type from the input type.