|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datecs.api.rfid.ContactlessCard
com.datecs.api.rfid.ISO14443Card
public class ISO14443Card
A class that represents ISO14443 cards.
Field Summary |
---|
Fields inherited from class com.datecs.api.rfid.ContactlessCard |
---|
afi, atqa, blockSize, capacity, 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_ST_SRI, CARD_UNKNOWN, channel, dsfid, hyatt64Card, maxBlocks, sak, type, uid |
Constructor Summary | |
---|---|
ISO14443Card(RC663 module)
Constructs a new instance of this class. |
Method Summary | |
---|---|
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. |
boolean |
initialize()
Initialize card. |
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. |
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. |
Methods inherited from class com.datecs.api.rfid.ContactlessCard |
---|
getModule, waitRemove |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ISO14443Card(RC663 module)
module
- The instance of RC663
module.Method Detail |
---|
public boolean initialize() throws java.io.IOException
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 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |