Class Index | File Index

Classes


Class Mifare

Class encapsulating access to a Mifare classic 1K/4K card
Defined in: mifare.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Mifare(card)
Create a Mifare card object
Field Summary
Field Attributes Field Name and Description
<static>  
Mifare.KEY_A
Identifier for Key A
<static>  
Mifare.KEY_B
Identifier for Key B
<static>  
Mifare.PUBLICKEYS
Mifare Public Key Values
Method Summary
Method Attributes Method Name and Description
 
authenticate(block, keytype, keyid)
Perform authentication procedure using General Authenticate command as defined in PCSC Part 3, chapter 3.2.2.1.6
<static>  
Mifare.crc8(data)
Calculate CRC-8 checksum Based on code from nfc-tools.
 
Read UID using Get Data command as defined in PCSC Part 3, chapter 3.2.2.1.3

FEIG readers require Le='04' to automatically switch to Mifare if the card supports both T=CL and Mifare.

 
loadKey(keyid, key)
Load key value into reader using Load Key command as defined in PCSC Part 3, chapter 3.2.2.1.4

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.

 
Create a sector object bound to the current Mifare instance
 
readBlock(block)
Read a block using the Read Binary command as defined in PCSC Part 3, chapter 3.2.2.1.8
 
updateBlock(block, data)
Update a block using the Update Binary command as defined in PCSC Part 3, chapter 3.2.2.1.9
Class Detail
Mifare(card)
Create a Mifare card object
Parameters:
{card} card
the card object
Field Detail
<static> Mifare.KEY_A
Identifier for Key A

<static> Mifare.KEY_B
Identifier for Key B

<static> Mifare.PUBLICKEYS
Mifare Public Key Values
Method Detail
{boolean} authenticate(block, keytype, keyid)
Perform authentication procedure using General Authenticate command as defined in PCSC Part 3, chapter 3.2.2.1.6
Parameters:
{Number} block
the block to authenticate against
{Number} keytype
must be either Mifare.KEY_A or Mifare.KEY_B
{Number} keyid
the key id of the key in the reader
Returns:
true if authentication successfull

<static> {Number} Mifare.crc8(data)
Calculate CRC-8 checksum Based on code from nfc-tools.
Parameters:
{ByteString} data
the data to calculate the checksum for
Returns:
the crc checksum

{ByteString} getUID()
Read UID using Get Data command as defined in PCSC Part 3, chapter 3.2.2.1.3

FEIG readers require Le='04' to automatically switch to Mifare if the card supports both T=CL and Mifare.

Returns:
the 4 byte UID

loadKey(keyid, key)
Load key value into reader using Load Key command as defined in PCSC Part 3, chapter 3.2.2.1.4

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.

Parameters:
{Number} keyid
the key identifier under which the key should be refered to in the reader
{ByteString} key
the 6 byte key value

newSector(no)
Create a sector object bound to the current Mifare instance
Parameters:
{Number} no
the sector number

{ByteString} readBlock(block)
Read a block using the Read Binary command as defined in PCSC Part 3, chapter 3.2.2.1.8
Parameters:
{Number} block
the block to read, starting at 0 for the first block in the first sector.
Returns:
the 16 byte block content read from the card

updateBlock(block, data)
Update a block using the Update Binary command as defined in PCSC Part 3, chapter 3.2.2.1.9
Parameters:
{Number} block
the block to read, starting at 0 for the first block in the first sector.
{ByteString} data
the 16 bytes of the data block to write

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jun 30 2014 21:40:10 GMT+0200 (CEST)