pub struct PrimaryHeader {
pub version: u8,
pub size: u64,
pub timestamp: u64,
pub encryption_type: HeaderEncryptionType,
pub name: [u8; 64],
pub arch: ImageArch,
pub directory_nonce: [u8; 12],
pub directory_offset: u64,
pub directory_size: u32,
pub public: u8,
pub reserved: [u8; 64],
}Expand description
Contains metadata which is always plaintext. Anything potentially useful to an attacker should instead reside in the protected header unless the user may want to read it without decrypting the image first.
Fields§
§version: u8The format version
size: u64The total size of all blocks combined in bytes
timestamp: u64Image creation time
encryption_type: HeaderEncryptionTypeThe encryption type for metadata
name: [u8; 64]A copy of the name field from the config
arch: ImageArchSystem architecture
directory_nonce: [u8; 12]Directory nonce
directory_offset: u64The byte offset of the directory
directory_size: u32The size of the directory in bytes
public: u8Whether the image is public
reserved: [u8; 64]Extra space for the future
Implementations§
Trait Implementations§
Source§impl BinRead for PrimaryHeader
impl BinRead for PrimaryHeader
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
Read
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for PrimaryHeader
impl BinWrite for PrimaryHeader
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer using default arguments. Read moreSource§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming little-endian byte order. Read moreSource§fn write_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Write
Self to the writer using the given arguments. Read moreSource§impl Debug for PrimaryHeader
impl Debug for PrimaryHeader
Source§impl PartialEq for PrimaryHeader
impl PartialEq for PrimaryHeader
Source§impl ReadEndian for PrimaryHeader
impl ReadEndian for PrimaryHeader
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
Source§impl ReadMagic for PrimaryHeader
impl ReadMagic for PrimaryHeader
Source§impl WriteEndian for PrimaryHeader
impl WriteEndian for PrimaryHeader
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
Source§impl WriteMagic for PrimaryHeader
impl WriteMagic for PrimaryHeader
impl Eq for PrimaryHeader
impl StructuralPartialEq for PrimaryHeader
Auto Trait Implementations§
impl Freeze for PrimaryHeader
impl RefUnwindSafe for PrimaryHeader
impl Send for PrimaryHeader
impl Sync for PrimaryHeader
impl Unpin for PrimaryHeader
impl UnwindSafe for PrimaryHeader
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