public interface SLE4442Card extends MemoryCard
SLE4442Card
interface for handling SLE4442 smart cards, which combine functionalities of both smart cards and memory cards.
This interface provides methods to connect to and disconnect from the card, authenticate, and perform read/write operations
in different areas of the card's memory. It is used in applications that require secure data transactions and storage,
such as payment systems and access control.Modifier and Type | Field and Description |
---|---|
static int |
MEMORY_CARD_AREA_MAIN
Main data storage area of the memory card.
|
static int |
MEMORY_CARD_AREA_PROTECTED
Manufacturer-defined protected area of the memory card.
|
static int |
MEMORY_CARD_AREA_SECURITY
Security data storage area of the memory card.
|
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()
Powers up and performs a cold reset on the smart card reader slot.
|
void |
disconnect()
Powers down the smart card reader slot.
|
byte[] |
read(int area,
int address,
int length)
Reads data from a specified area of the card.
|
boolean |
verify(byte[] key)
Authenticates the card using the provided key.
|
void |
write(int area,
int address,
byte[] data)
Writes data to a specified area of the card.
|
getCardStatus, getID, getIDInfo, getProtocol
static final int MEMORY_CARD_AREA_MAIN
static final int MEMORY_CARD_AREA_PROTECTED
static final int MEMORY_CARD_AREA_SECURITY
ATR connect() throws DeviceException
This method resets the card, causing it to transmit an Answer to Reset (ATR) if the slot power is off.
DeviceException
- for standard device-related errors as documented in DeviceException
.void disconnect() throws DeviceException
This method safely disconnects from the card, ensuring proper termination of any ongoing communication.
DeviceException
- for standard device-related errors as documented in DeviceException
.boolean verify(byte[] key) throws DeviceException
key
- The byte array containing the authentication key.DeviceException
- for standard device-related errors as documented in DeviceException
.byte[] read(int area, int address, int length) throws DeviceException
The area parameter determines where the read operation occurs, and can be one of the following:
MEMORY_CARD_AREA_MAIN
- Main data area.
MEMORY_CARD_AREA_PROTECTED
- Protected area set by the manufacturer.
MEMORY_CARD_AREA_SECURITY
- Security data area.
area
- The memory area to read from, as defined in the constants.address
- The starting address for the read operation (from 0).length
- The length of the data to read.DeviceException
- for standard device-related errors as documented in DeviceException
.void write(int area, int address, byte[] data) throws DeviceException
The area parameter determines where the write operation occurs, and can be one of the following:
MEMORY_CARD_AREA_MAIN
- Main data area.
MEMORY_CARD_AREA_PROTECTED
- Protected area set by the manufacturer.
MEMORY_CARD_AREA_SECURITY
- Security data area.
area
- The memory area to write to, as defined in the constants.address
- The starting address for the write operation (from 0).data
- The data to be written.DeviceException
- for standard device-related errors as documented in DeviceException
.