App

Trait App 

Source
pub trait App<const R: usize>: App {
    // Required methods
    fn select(
        &mut self,
        interface: Interface,
        apdu: CommandView<'_>,
        reply: &mut Vec<u8, R>,
    ) -> Result<(), Status>;
    fn deselect(&mut self);
    fn call(
        &mut self,
        interface: Interface,
        apdu: CommandView<'_>,
        reply: &mut Vec<u8, R>,
    ) -> Result<(), Status>;
}
Expand description

An App can receive and respond APDUs at behest of the ApduDispatch.

Required Methods§

Source

fn select( &mut self, interface: Interface, apdu: CommandView<'_>, reply: &mut Vec<u8, R>, ) -> Result<(), Status>

Given parsed APDU for select command. Write response data back to buf, and return length of payload. Return APDU Error code on error. Alternatively, the app can defer the response until later by returning it in poll().

Source

fn deselect(&mut self)

Deselects the app. This is the result of another app getting selected. App should clear any sensitive state and reset security indicators.

Source

fn call( &mut self, interface: Interface, apdu: CommandView<'_>, reply: &mut Vec<u8, R>, ) -> Result<(), Status>

Given parsed APDU for app when selected. Write response data back to buf, and return length of payload. Return APDU Error code on error.

Implementors§