pub struct RawKey { /* private fields */ }Expand description
Container for raw key material returned by a KeyFetch implementation.
RawKey deliberately exposes no method that returns a borrowed &[u8] to
outside the crate. The only consumers of the inner bytes are the
fragmentation pipeline and (eventually) the zero-on-drop wrapper introduced
in Phase 0.3. From outside key-vault you can construct a RawKey, hand it
to the vault, and never see it again.
§Layout
In this phase RawKey stores the bytes in a plain Vec<u8>. Phase 0.3
will swap this for Zeroizing<Vec<u8>> from the zeroize crate without a
public API change.
Implementations§
Source§impl RawKey
impl RawKey
Sourcepub fn new(bytes: Vec<u8>) -> Self
pub fn new(bytes: Vec<u8>) -> Self
Wrap a freshly-acquired byte buffer.
Callers are expected to overwrite the original buffer immediately after
constructing the RawKey if they kept a copy (for example a stack
buffer from read_exact). The vault itself never holds a separate
borrow.