Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Card (ISD) life-cycle transition state machine — PDD §5.11.

Verified against GPCS v2.3.1 §5.1.1.1–.5 and Figure 5-1 (PDF p. 54):

  • OP_READY → INITIALIZED → SECURED irreversible (§5.1.1.2/.3).
  • SECURED ↔ CARD_LOCKED reversible (§5.1.1.4).
  • any → TERMINATED irreversible (§5.1.1.5) — refused as a set target (§2.2).
  • Skip-ahead to SECURED is spec-legal (§5.1.2) — gated behind force.
  • Same-state = no-op (card rejects per §11.10.2.2); detected before any APDU.

P2 target bytes are the Card Life Cycle Coding of GPCS v2.3.1 Table 11-6 (INITIALIZED = 0x07, SECURED = 0x0F, CARD_LOCKED = 0x7F), as required by SET STATUS §11.10.2.2.

Enums§

TransitionPlan
Outcome of a legality check: either a no-op, or the P2 byte to send.

Functions§

check_transition
Validate a requested transition against the verified matrix. force permits skip-ahead to SECURED; never bypasses the TERMINATED refusal or backward-transition refusal.