Skip to main content

scll_core/cap/
components.rs

1//! Individual CAP components — PDD §5.4a table.
2//!
3//! `no_std`: this holds parsed *metadata* only — small owned values (AIDs +
4//! offsets) — so the collections are bounded `heapless::Vec`, not borrows. The
5//! bulk component *bytes* are never held here; they are streamed from the input
6//! ZIP by [`super::LoadFileDataBlock`].
7
8use heapless::Vec;
9
10use crate::aid::Aid;
11use crate::limits::{MAX_CAP_APPLETS, MAX_CAP_IMPORTS};
12
13/// Extracted CAP components relevant to loading/installing.
14pub struct CapComponents {
15    pub jc_platform_version: (u8, u8, u8),  // from Header.cap
16    pub imports: Vec<Aid, MAX_CAP_IMPORTS>, // Import.cap dependencies
17    pub applets: Vec<AppletEntry, MAX_CAP_APPLETS>, // Applet.cap (class AID + install offset)
18}
19
20/// One applet class entry from `Applet.cap`.
21pub struct AppletEntry {
22    pub class_aid: Aid,
23    pub install_method_offset: u16,
24}