[][src]Struct gbl::AppImage

pub struct AppImage<'a> { /* fields omitted */ }

A flash image containing application data.

It is expected that every application embeds an "application properties" data structure, which will be located by AppImage::parse and contains an AppInfo structure which can be accessed using AppImage::app_info.

Can be turned into a Gbl by calling Gbl::from_app_image or into a ProgramData section using From/Into conversion. The resulting section will be flashed at offset 0. It is the user's responsibility to ensure that the whole image fits in the target device's flash memory (this library is completely device-agnostic and thus cannot check that device-specific constraints are satisfied).

Methods

impl<'a> AppImage<'a>
[src]

Parses a raw application image by extracting the application properties.

Errors

Returns an error if image does not contain a valid application properties structure.

Consumes self and returns the raw bytes making up the application image.

Returns the AppInfo structure extracted from the application image.

Returns whether a cryptographic signature is embedded into the application image.

If present, returns the embedded ECDSA P-256 signature blob.

Signs this application image.

The signature will be embedded into the flashed data, and the application properties structure will be updated to point at the signature. If the signature pointer is non-zero and the signature type indicates an ECDSA P-256 signature, an existing signature is assumed to be present at that offset and will be overwritten with a new signature.

If no signature is present, this will append the new signature to the raw image, enlarging it.

If secure boot is enabled in the bootloader, a valid signature must be present for boot to continue.

Errors

Returns an error if:

  • pem_private_key is malformed or does not contain an ECDSA P-256 private key.
  • there is a problem accessing the system's random number generator.

Trait Implementations

impl<'a> From<AppImage<'a>> for ProgramData<'a>
[src]

impl<'a> Debug for AppImage<'a>
[src]

Auto Trait Implementations

impl<'a> Send for AppImage<'a>

impl<'a> Sync for AppImage<'a>

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]