|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Mifare
Class encapsulating access to a Mifare classic 1K/4K card
Defined in mifare.js
Field Summary | |
Object |
card
|
<static> Object |
KEY_A
Identifier for Key A |
<static> Object |
KEY_B
Identifier for Key B |
<static> Object |
PUBLICKEYS
Mifare Public Key Values |
Constructor Summary | |
Mifare(<card> card)
Create a Mifare card object |
Method Summary | |
boolean
|
authenticate(<Number> block, <Number> keytype, <Number> keyid)
Perform authentication procedure using General Authenticate command as defined in PCSC Part 3, chapter 3.2.2.1.6 |
ByteString
|
getUID()
Read UID using Get Data command as defined in PCSC Part 3, chapter 3.2.2.1.3 |
void
|
loadKey(<Number> keyid, <ByteString> key)
Load key value into reader using Load Key command as defined in PCSC Part 3, chapter 3.2.2.1.4 |
Object
|
newSector(<Number> no)
Create a sector object bound to the current Mifare instance |
ByteString
|
readBlock(<Number> block)
Read a block using the Read Binary command as defined in PCSC Part 3, chapter 3.2.2.1.8 |
Object
|
updateBlock(<Number> block, <ByteString> data)
Update a block using the Update Binary command as defined in PCSC Part 3, chapter 3.2.2.1.9 |
<static> Number
|
crc8(<ByteString> data)
Calculate CRC-8 checksum |
Field Detail |
Object card
<static> Object KEY_A
<static> Object KEY_B
<static> Object PUBLICKEYS
Constructor Detail |
Mifare(<card> card)
card
- the card object
Method Detail |
boolean authenticate(<Number> block, <Number> keytype, <Number> keyid)
block
- the block to authenticate against
keytype
- must be either Mifare.KEY_A or Mifare.KEY_B
keyid
- the key id of the key in the reader
ByteString getUID()
FEIG readers require Le='04' to automatically switch to Mifare if the card supports both T=CL and Mifare.
void loadKey(<Number> keyid, <ByteString> key)
The ACR 122U contactless reader supports key ids 0x00 and 0x01
The Omnikey cardman 5321 reader supports key ids 0x00 to 0x1F
The ACR 122U contactless reader supports key ids 0x00 and 0x01
The method supports the SCM SDI010 contactless reader which uses a proprietary LOAD KEY APDU with preset key identifier 0x60 and 0x61. This command is activated if keyid is 0x60 or 0x61.
keyid
- the key identifier under which the key should be refered to in the reader
key
- the 6 byte key value
Object newSector(<Number> no)
no
- the sector number
ByteString readBlock(<Number> block)
block
- the block to read, starting at 0 for the first block in the first sector.
Object updateBlock(<Number> block, <ByteString> data)
block
- the block to read, starting at 0 for the first block in the first sector.
data
- the 16 bytes of the data block to write
<static> Number crc8(<ByteString> data)
data
- the data to calculate the checksum for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |