Skip to main content

FveMetadata

Struct FveMetadata 

Source
pub struct FveMetadata {
    pub encryption_method: u16,
    pub volume_guid: [u8; 16],
    pub creation_time: u64,
    pub entries: Vec<MetadataEntry>,
    pub encrypted_volume_size: u64,
    pub volume_header_offset: u64,
    pub volume_header_size: u64,
    pub metadata_offsets: [u64; 3],
    pub metadata_size: u32,
}
Expand description

A parsed FVE metadata block: cipher, identity, and the entry array, plus the block-header fields the read path needs (encrypted size and the relocated volume-header region).

Fields§

§encryption_method: u16

Volume encryption method (metadata header offset 36).

§volume_guid: [u8; 16]

Volume identifier GUID (metadata header offset 16).

§creation_time: u64

Volume creation time as a Windows FILETIME (metadata header offset 40).

§entries: Vec<MetadataEntry>

The metadata entries.

§encrypted_volume_size: u64

Number of still-encrypted bytes from the front (block header, v2 offset 16). Zero means “whole volume”.

§volume_header_offset: u64

Byte offset where the original volume header is stored, relocated.

§volume_header_size: u64

Size in bytes of the relocated volume-header region.

§metadata_offsets: [u64; 3]

Byte offsets of the three metadata blocks (read back as zeros).

§metadata_size: u32

Size of the metadata region (metadata header offset 0).

Implementations§

Source§

impl FveMetadata

Source

pub fn parse(block: &[u8], bytes_per_sector: u16) -> Option<FveMetadata>

Parse an FVE metadata block from bytes beginning at its block header.

Returns None when the -FVE-FS- block-header signature is absent, so the caller can try the next candidate block offset.

Source

pub fn vmk_entries(&self) -> impl Iterator<Item = &MetadataEntry>

Iterate the VMK protector entries.

Source

pub fn protector_types(&self) -> Vec<u16>

The key-protection types present, in metadata order.

Source

pub fn fvek_entry(&self) -> Option<&MetadataEntry>

The top-level FVEK entry (an AES-CCM encrypted key wrapped by the VMK).

Trait Implementations§

Source§

impl Clone for FveMetadata

Source§

fn clone(&self) -> FveMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FveMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.