jpki/ap/
mod.rs

1//! Collection of APs that corresponds with DF (Dedicated File) in the card
2
3pub mod crypto;
4pub mod support;
5pub mod surface;
6
7pub use self::crypto::CryptoAp;
8pub use self::support::SupportAp;
9pub use self::surface::SurfaceAp;
10
11macro_rules! open {
12    ($t: ty, $ctx: ty, $df: expr) => {
13        /// Opens the AP in the card by selecting the DF.
14        pub fn open(ctx: Ctx, card: Rc<crate::Card<$t, $ctx>>) -> Result<Self, crate::card::Error> {
15            let ap = Self { card };
16
17            ap.card.select_df(ctx, $df.into()).map(|_| ap)
18        }
19    };
20}
21
22pub(crate) use open;