|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Sector
Class representing a sector on a Mifare card
Defined in mifare.js
Field Summary | |
Object |
blocks
|
Object |
keyid
|
Object |
mifare
|
Object |
no
|
<static> Object |
AC_ALWAYS
|
<static> Object |
AC_DATA
|
<static> Object |
AC_FIXED_AC_NOKEY_B
|
<static> Object |
AC_FIXED_AC_UPDATE_WITH_KEYB
|
<static> Object |
AC_KEYBONLY
|
<static> Object |
AC_KEYBREADONLY
|
<static> Object |
AC_NEVER
|
<static> Object |
AC_NEVER2
|
<static> Object |
AC_NONRECHARGEABLE
|
<static> Object |
AC_READONLY
|
<static> Object |
AC_READONLY_NOKEY_B
|
<static> Object |
AC_RECHARGEABLE
|
<static> Object |
AC_TRAILER
|
<static> Object |
AC_UPDATE_AC_FIXED_KEYS
|
<static> Object |
AC_UPDATE_AC_NOKEY_B
|
<static> Object |
AC_UPDATE_WITH_KEYB
|
<static> Object |
AC_UPDATEKEYB
|
<static> Object |
MASK
|
Constructor Summary | |
Sector(<Mifare> mifare, <Number> no)
Create an object representing an on card sector. |
Method Summary | |
boolean
|
authenticate(<Number> block, <Number> keytype)
Authenticate against block Uses the internal key id for this sector for key A and the internal key id + 1 for key B. |
Number
|
authenticatePublic(<Number> block, <Number> keytype)
Authenticate against block using list from public key table |
Number
|
getACforBlock(<Number> block)
Return access conditions for a block within the sector |
ByteString
|
read(<Number> block)
Read a block within the sector |
Object
|
readAll(<Number> keytype)
Read all blocks from a sector |
void
|
setACforBlock(<Number> block, <Number> ac)
Set the access condition for a block within the sector |
void
|
setHeaderDataByte(<ByteString> db)
Set the data byte in the sector trailer |
void
|
setKeyA(<ByteString> key)
Set the value for Key A |
void
|
setKeyB(<ByteString> key)
Set the value for Key B |
void
|
setKeyId(keyid, <Number> keytype)
Overwrite internal key id |
Object
|
toString()
Return a human readable presentation of the sector |
void
|
update(<Number> block, <ByteString> data)
Update a block within the sector |
<static> String
|
toASCII(<ByteString> data)
Convert binary data to ASCII code if within the range 0x20 to 0x7E |
Field Detail |
Object blocks
Object keyid
Object mifare
Object no
<static> Object AC_ALWAYS
<static> Object AC_DATA
<static> Object AC_FIXED_AC_NOKEY_B
<static> Object AC_FIXED_AC_UPDATE_WITH_KEYB
<static> Object AC_KEYBONLY
<static> Object AC_KEYBREADONLY
<static> Object AC_NEVER
<static> Object AC_NEVER2
<static> Object AC_NONRECHARGEABLE
<static> Object AC_READONLY
<static> Object AC_READONLY_NOKEY_B
<static> Object AC_RECHARGEABLE
<static> Object AC_TRAILER
<static> Object AC_UPDATE_AC_FIXED_KEYS
<static> Object AC_UPDATE_AC_NOKEY_B
<static> Object AC_UPDATE_WITH_KEYB
<static> Object AC_UPDATEKEYB
<static> Object MASK
Constructor Detail |
Sector(<Mifare> mifare, <Number> no)
mifare
- the card
no
- the sector number
Method Detail |
boolean authenticate(<Number> block, <Number> keytype)
Uses the internal key id for this sector for key A and the internal key id + 1 for key B.
block
- the block number between 0 and 3
keytype
- must be either Mifare.KEY_A or Mifare.KEY_B
Number authenticatePublic(<Number> block, <Number> keytype)
block
- the block number between 0 and 3
keytype
- must be either Mifare.KEY_A or Mifare.KEY_B
Number getACforBlock(<Number> block)
block
- the block number between 0 and 3
ByteString read(<Number> block)
block
- the block number between 0 and 3
Object readAll(<Number> keytype)
keytype
- key type to use for authentication (Mifare.KEY_A or Mifare.KEY_B. Defaults to key B.
void setACforBlock(<Number> block, <Number> ac)
block
- the block number between 0 and 3
ac
- one of the Sector.AC_ constants
void setHeaderDataByte(<ByteString> db)
db
- the data byte (1 bytes)
void setKeyA(<ByteString> key)
key
- the key value (6 bytes)
void setKeyB(<ByteString> key)
key
- the key value (6 bytes)
void setKeyId(keyid, <Number> keytype)
keytype
- either Mifare.KEY_A (Default) or Mifare.KEY_B.
keyId
- the key id for the Mifare key
Object toString()
void update(<Number> block, <ByteString> data)
block
- the block number between 0 and 3
data
- the data to write (Optional for sector trailer)
<static> String toASCII(<ByteString> data)
data
- the input data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |