pub struct Luks2Header {
pub version: u16,
pub hdr_size: u64,
pub keyslots: Vec<Luks2Keyslot>,
pub segments: Vec<Luks2Segment>,
pub digests: Vec<Luks2Digest>,
}Expand description
A parsed LUKS2 header.
Fields§
§version: u16Version (2).
hdr_size: u64Total header size (binary + JSON) in bytes.
keyslots: Vec<Luks2Keyslot>Keyslots.
segments: Vec<Luks2Segment>Data segments.
digests: Vec<Luks2Digest>Digests.
Implementations§
Source§impl Luks2Header
impl Luks2Header
Sourcepub fn parse(data: &[u8]) -> Result<Self>
pub fn parse(data: &[u8]) -> Result<Self>
Parse a LUKS2 header from a buffer covering the binary header and JSON area.
§Errors
LuksError::NotLuks / LuksError::UnsupportedVersion on a bad
signature/version, LuksError::MalformedHeader if the JSON is absent or
invalid.
Sourcepub fn crypt_segment(&self) -> Option<&Luks2Segment>
pub fn crypt_segment(&self) -> Option<&Luks2Segment>
The first crypt data segment (the one we decrypt).
Trait Implementations§
Source§impl Clone for Luks2Header
impl Clone for Luks2Header
Source§fn clone(&self) -> Luks2Header
fn clone(&self) -> Luks2Header
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Luks2Header
impl RefUnwindSafe for Luks2Header
impl Send for Luks2Header
impl Sync for Luks2Header
impl Unpin for Luks2Header
impl UnsafeUnpin for Luks2Header
impl UnwindSafe for Luks2Header
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