public class ISO14443Card extends ContactlessCard
Modifier and Type | Class and Description |
---|---|
class |
ISO14443Card.DESFire |
afi, atqa, blockSize, capacity, CARD_EPASSPORT, CARD_FELICA, CARD_ISO14443A, CARD_ISO14443B, CARD_ISO15693, CARD_MIFARE_CLASSIC_1K, CARD_MIFARE_CLASSIC_4K, CARD_MIFARE_DESFIRE, CARD_MIFARE_MINI, CARD_MIFARE_PLUS, CARD_MIFARE_ULTRALIGHT, CARD_MIFARE_ULTRALIGHT_C, CARD_PAYMENT, CARD_PICOPASS_14443B, CARD_PICOPASS_15693, CARD_ST_SRI, CARD_UNKNOWN, channel, dsfid, hyatt64Card, maxBlocks, mModule, sak, type, uid
Constructor and Description |
---|
ISO14443Card(RC663 module)
Constructs a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
authenticate(char type,
int address,
byte[] key)
Authenticate mifare card block with direct key data.
|
void |
authenticate(char type,
int address,
int keyIndex)
Authenticate mifare card block with previously stored key.
|
protected boolean |
deinitialise()
Deinitialise card.
|
ISO14443Card.DESFire |
DESFire() |
byte[] |
executeAPDU(int cla,
int ins,
int p1,
int p2,
byte[] data)
Execute APDU command.
|
byte[] |
executeAPDU(int cla,
int ins,
int p1,
int p2,
byte[] data,
int le)
Execute APDU command.
|
byte[] |
getATS()
Get ATS.
|
byte[] |
getAttribB(int p1,
int p2,
int p3,
int p4)
Get attribute B
|
boolean |
initialize()
Initialize card.
|
boolean |
isPresentB()
Check if card present.
|
void |
loadKey(int keyIndex,
char type,
byte[] key)
Store key in the internal module memory for later use.
|
byte[] |
read16(int address)
Reads one block of data from Mifare Classic/Ultralight cards.
|
byte[] |
transceive(byte[] data)
Transceive data to ISO14443
|
byte[] |
transceiveA(byte[] data)
Transceive data to ISO14443 A
|
byte[] |
transceiveB(byte[] data)
Transceive data to ISO14443 B
|
void |
ulcAuthenticate(byte[] key)
Performs 3DES authentication of Mifare Ultralight C card using the given key.
|
void |
ulcSetKey(byte[] key)
Sets the 3DES key of Mifare Ultralight C cards.
|
void |
write16(int address,
byte[] data)
Writes one block of data to Mifare Classic/Ultralight cards.
|
void |
write4(int address,
byte[] data) |
getModule, getTypeName, waitRemove
protected boolean deinitialise() throws java.io.IOException
ContactlessCard
deinitialise
in class ContactlessCard
java.io.IOException
- if an I/O error occurs.public boolean initialize() throws java.io.IOException
initialize
in class ContactlessCard
java.io.IOException
- if an I/O error occurs.public void loadKey(int keyIndex, char type, byte[] key) throws java.io.IOException, RFIDException
keyIndex
- The index of the key, you can have up to 8 keys stored (0-7).type
- The key type, either 'A' or 'B'.key
- The 6 bytes key.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public void authenticate(char type, int address, byte[] key) throws java.io.IOException, RFIDException
This is less secure method, as it requires the key to be present in the program, the preferred way is to store a key once in a secure environment and then authenticate using the stored key.
type
- The key type, either 'A' or 'B'.address
- The address of the block to authenticate.key
- The 6 bytes key.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public void authenticate(char type, int address, int keyIndex) throws java.io.IOException, RFIDException
This the preferred method, as no key needs to reside in application.
type
- The key type, either 'A' or 'B'.address
- The address of the block to authenticate.keyIndex
- The index of the stored key, you can have up to 8 keys stored (0-7).java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public byte[] read16(int address) throws java.io.IOException, RFIDException
A read operation gets 16 bytes of data.
address
- The address of the block to read.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public void write16(int address, byte[] data) throws java.io.IOException, RFIDException
A write operation stores 16 bytes of data.
address
- The address of the block to write.data
- The data to write, must be multiple of the block size (16 bytes).java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public void write4(int address, byte[] data) throws java.io.IOException, RFIDException
java.io.IOException
RFIDException
public void ulcSetKey(byte[] key) throws java.io.IOException, RFIDException
key
- The 16 bytes 3DES key to set.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public void ulcAuthenticate(byte[] key) throws java.io.IOException, RFIDException
key
- The 16 bytes 3DES key to authenticate with.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public byte[] getATS() throws java.io.IOException, RFIDException
java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public byte[] getAttribB(int p1, int p2, int p3, int p4) throws java.io.IOException, RFIDException
p1
- param 1;p2
- param 2;p3
- param 3;p4
- param 4;java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public boolean isPresentB() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.public byte[] transceiveA(byte[] data) throws java.io.IOException, RFIDException
data
- the data.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public byte[] transceiveB(byte[] data) throws java.io.IOException, RFIDException
data
- the data.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public byte[] transceive(byte[] data) throws java.io.IOException, RFIDException
data
- the data.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public byte[] executeAPDU(int cla, int ins, int p1, int p2, byte[] data) throws java.io.IOException, RFIDException
cla
- CLAins
- INSp1
- P1p2
- P2data
- APDU data.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public byte[] executeAPDU(int cla, int ins, int p1, int p2, byte[] data, int le) throws java.io.IOException, RFIDException
cla
- CLAins
- INSp1
- P1p2
- P2data
- APDU data.le
- requested response length.java.io.IOException
- If an I/O error occurs.RFIDException
- if an RF663 error occurs.public ISO14443Card.DESFire DESFire()