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).
Parses a raw application image by extracting the application properties.
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.
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.
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static