pub struct Envelope { /* private fields */ }Expand description
Immutable input and canonical image, validated without authorizing a flash.
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn load(input: &[u8]) -> Result<Self, Error>
pub fn load(input: &[u8]) -> Result<Self, Error>
Load exactly one 2 MiB plaintext or OEM encrypted image. Positive boot framing and a nonempty valid CMAC table are required. Raw captures are rejected. No model, filename or absence of encryption selects a format.
Sourcepub fn image(&self) -> &[u8] ⓘ
pub fn image(&self) -> &[u8] ⓘ
Canonical stored image, used for acceptance and readback verification.
Sourcepub fn input_encoding(&self) -> InputEncoding
pub fn input_encoding(&self) -> InputEncoding
Original input encoding; does not select the receiver’s transfer mode.
Sourcepub fn input_sha256(&self) -> &[u8; 32]
pub fn input_sha256(&self) -> &[u8; 32]
SHA-256 of the original bytes.
Sourcepub fn image_sha256(&self) -> &[u8; 32]
pub fn image_sha256(&self) -> &[u8; 32]
SHA-256 of canonical stored bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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