myna-card 1.0.0

A library for accessing the Japanese Individual Number Card (個人番号カード) over PC/SC
Documentation
//! The applications hosted on the card.
//!
//! The card is organised as a set of dedicated files (DFs), each holding its own elementary
//! files (EFs) and its own key references. One module here corresponds to one application:
//!
//! | Module | Application | AID |
//! |---|---|---|
//! | [`common`] | 共通カードAP | `D3 92 10 00 31 00 01 01 01 00` |
//! | [`juki`] | 住基AP | `D3 92 10 00 31 00 01 01 04 01` |
//! | [`surface`] | 券面事項確認AP | `D3 92 10 00 31 00 01 01 04 02` |
//! | [`text`] | 券面入力補助AP | `D3 92 10 00 31 00 01 01 04 08` |
//! | [`jpki`] | 公的個人認証AP | `D3 92 F0 00 26 01 00 00 00 01` |
//!
//! Each module exposes its AID as `DF`, its file identifiers under `ef`, and a wrapper type that
//! selects the application and offers the operations that are known to work on it. The wrapper
//! borrows the [`Card`](crate::Card) for as long as it lives, which keeps a second application
//! from being used while one is selected.
//!
//! The contents of several EFs are not yet understood; those are reachable through the generic
//! `read_ef` and `read_record` methods rather than a named accessor.
//!
//! # Short EF identifiers
//!
//! Every EF listed here has an identifier in `0001`-`001E`, so every one of them also has a short
//! EF identifier (JICSAP 4.2 (2)). A command carrying one selects the file and acts on it in a
//! single exchange. These wrappers do not use that — they issue an explicit SELECT FILE, which
//! works whatever the card supports — but [`Card::read_binary_chunk_sfi`](crate::Card::read_binary_chunk_sfi)
//! and [`Card::verify_sfi`](crate::Card::verify_sfi) are there if you want to halve the round
//! trips.
//!
//! # Enumerating what is on a card
//!
//! Selecting a DF by a *prefix* of its name is legal (JICSAP 4.2 (1)), so a SELECT FILE that
//! succeeds does not prove you reached the DF you meant. The specification's answer is the
//! application folder list file, which names the current DF and its children; see
//! [`crate::mf::ApplicationFolders`].

pub mod common;
pub mod jpki;
pub mod juki;
pub mod surface;
pub mod text;

/// The AID of the DF that is selected when the card is powered up.
pub const DEFAULT_DF: [u8; 7] = [0xA0, 0x00, 0x00, 0x01, 0x51, 0x00, 0x00];