pub struct DataKey(/* private fields */);Expand description
The 32-byte symmetric key every leaf in one file is encrypted under.
Wrapped per recipient (age, PGP, KMS, …) into the sops.<provider>[].enc
fields; this type is the unwrapped form and is zeroed on drop. No Display,
no Debug of contents.
Implementations§
Source§impl DataKey
impl DataKey
Sourcepub const LEN: usize = 32
pub const LEN: usize = 32
Length in bytes of a data key. Not configurable — GenerateDataKey uses
make([]byte, 32).
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, WireError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, WireError>
Adopt bytes recovered from a key provider.
The length check is here rather than at the call site because a short key from a misbehaving provider would otherwise surface as an AEAD failure far from its cause.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataKey
impl RefUnwindSafe for DataKey
impl Send for DataKey
impl Sync for DataKey
impl Unpin for DataKey
impl UnsafeUnpin for DataKey
impl UnwindSafe for DataKey
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