My Number Card

The My Number reader targets JPKI and card-info-input-support application (AP) paths used by Japanese Individual Number cards.

let card = try await CoreExtendedNFC.readMyNumberCard(
    items: [.tokenInfo, .individualNumber],
    cardInfoInputSupportPIN: "1234",
    onProgress: { message in print(message) }   // localized, also shown on the NFC sheet
)

// Over a transport you already hold (no session handling):
let token = try await CoreExtendedNFC.readMyNumberCard(transport: transport, items: [.tokenInfo])
let attempts = try await CoreExtendedNFC.lookupMyNumberRemainingPINAttempts(
    transport: transport,
    pinType: .cardInfoInputSupport
)

readMyNumberCard also accepts a manager: to run the session on your own NFCSessionManager or a subclass. To customize the read itself, subclass MyNumberCardReader and override read(items:cardInfoInputSupportPIN:onProgress:).

AppletAIDUse
JPKID392F000260100000001Token information from EF 0006.
Card-info input supportD3921000310001010408PIN domain and protected reads.
Individual numberD3921000310001010100Individual-number data flow.

Requesting .individualNumber without a PIN throws NFCError.pinRequired(.cardInfoInputSupport); a PIN that is not exactly 4 digits, or an empty items list, throws NFCError.invalidParameter. Before sending the PIN, the reader sends an empty VERIFY to read the retry counter. If the PIN is already blocked (63C0, 6983, 6984), the PIN is never transmitted and NFCError.pinVerificationFailed(remainingAttempts: 0) is thrown. A wrong PIN throws the same error with the counter the card reports, or nil when it reports none. lookupMyNumberRemainingPINAttempts(transport:pinType:) returns the counter without sending a PIN; the 1.x overload with an unused info: argument is deprecated.

The byte-level EF layout is documented in My Number Card Data Format.