public interface CPUCard extends Card
CPUCard
interface defines the operations for CPU cards, enabling
the transmission of APDU (Application Protocol Data Unit) commands between
the CPU card and the card reader.
CPU cards can be either smart cards (contact cards) or contactless cards.
PROTOCOL_RFCARD_TYPE_A, PROTOCOL_RFCARD_TYPE_B, PROTOCOL_T_0, PROTOCOL_T_1, PROTOCOL_UNKNOWN, STATUS_ABSENT, STATUS_CONNECTED, STATUS_DISCONNECTED
Modifier and Type | Method and Description |
---|---|
ATR |
connect()
Connects to the card and retrieves the ATR (Answer To Reset) information for contact cards,
or the ATS (Answer To Select) for contactless cards.
|
void |
disconnect()
Disconnects the card from the card reader.
|
byte[] |
transmit(byte[] apdu)
Transmits an APDU command to the card reader and receives a response.
|
byte[] |
transmit(byte[] apdu,
int operation)
Transmits a Level 3 command to a contactless (RF) card and retrieves the response.
|
getCardStatus, getID, getIDInfo, getProtocol
ATR connect() throws DeviceException
ATR
object containing ATR information for contact cards or ATS information for contactless cards.DeviceException
- for standard reasons as documented in DeviceException
.void disconnect() throws DeviceException
DeviceException
- for standard reasons as documented in DeviceException
.byte[] transmit(byte[] apdu) throws DeviceException
apdu
must adhere to the APDU format defined by ISO 7816-4 and EMV specifications.
In the case of ISO 7816-4 Case 4 APDUs used with T=0 CPU cards, the method automatically converts them into an appropriate sequence of TPDUs, consistent with the current operating mode (EMV or ISO). All response data from the transmitted APDU command is fully retrieved, stored, and made accessible through the returned response buffer.
apdu
- Data buffer containing the APDU command to be transmitted.DeviceException
- for standard reasons as documented in DeviceException
and also:
ON
.
byte[] transmit(byte[] apdu, int operation) throws DeviceException
apdu
- Data buffer containing the command to be transmitted.operation
- The default value is 0. To disable CRC and parity, set to 16.DeviceException
- for standard reasons as documented in DeviceException
and also:
ON
.