|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MFStandardConnection
The interface representing the connection to a Mifare Standard 1k or 4k card.
This interface extends the MFDataArea
and thus the entire tag
is accessible via this interface.
The device may have some default authentication keys that it uses. Typically these are known public keys such as the public MAD key A. These are used if the user doesn't specify a authentication key.
Field Summary | |
---|---|
static int |
MAD_V1
MAD version 1. |
static int |
MAD_V2
MAD version 2. |
Method Summary | |
---|---|
MFApplicationDirectory |
createApplicationDirectory(MFKey createKey,
MFKey.KeyB madKeyB,
int madVersion)
Creates an application directory to the card. |
MFApplicationDirectory |
getApplicationDirectory()
Returns the application directory of the card in read-only mode. |
MFApplicationDirectory |
getApplicationDirectory(MFKey.KeyB keyB)
Returns the application directory of the card. |
MFBlock |
getBlock(int blockIndex)
Returns the block at the specified block index. |
int |
getBlockCount()
Returns the total number of blocks in the card. |
MFManufacturerBlock |
getManufacturerBlock()
Returns the manufacturer block of this card. |
MFSector |
getSector(int sectorIndex)
Returns the sector at the specified sector index. |
int |
getSectorCount()
Returns the total number of sectors in the card. |
Methods inherited from interface com.nokia.nfc.nxp.mfstd.MFDataArea |
---|
read, size, toString, write, write |
Field Detail |
---|
static final int MAD_V1
static final int MAD_V2
Method Detail |
---|
MFManufacturerBlock getManufacturerBlock()
null
.int getSectorCount()
MFSector getSector(int sectorIndex)
0
to
getSectorCount()
- 1
.
sectorIndex
- the sector index.
MFSector
object that corresponds with the specified index.
java.lang.IllegalArgumentException
- if the sectorIndex
is invalid.int getBlockCount()
MFBlock getBlock(int blockIndex)
0
to
getBlockCount()
- 1
.
blockIndex
- the block index.
MFBlock
object that corresponds with the specified index.
java.lang.IllegalArgumentException
- if the blockIndex
is invalid.MFApplicationDirectory getApplicationDirectory() throws java.io.IOException, MFStandardException
MFStandardException
.
If the MAD sectors cannot be read then it is assumed that the
application directory doesn't exist and the return value will be
null
.
java.io.IOException
- if a connection error occurs.
MFStandardException
- if authentication fails, i.e. the MAD doesn't use the public key A.MFApplicationDirectory getApplicationDirectory(MFKey.KeyB keyB) throws java.io.IOException, MFStandardException
null
.
keyB
- the authentication key to use when modifying the MAD area.
If null
then the device's default keys are used.
java.io.IOException
- if a connection error occurs.
MFStandardException
- if authentication fails, i.e. the MAD doesn't use the public key A.MFApplicationDirectory createApplicationDirectory(MFKey createKey, MFKey.KeyB madKeyB, int madVersion) throws MFStandardException, java.io.IOException
Creates an application directory to the card. The authentication key
createKey
will be used when creating the MAD area and
the key madKeyB
will be written to the MAD sector's
trailer as the B key.
Note that the reserved MAD sectors will be cleared and set into initial state. Any previous data is permanently lost from the MAD sector(s).
The madVersion
parameter value must be either
MAD_V1
or MAD_V2
.
createKey
- key to use when writing the MAD sectors.
If null
then the device's default keys are used.madKeyB
- the key to use as the B key in the MAD sector trailer(s).madVersion
- the MAD version to use.
java.lang.NullPointerException
- if madKeyB
is null
.
java.io.IOException
- if a connection error occurs.
java.lang.IllegalArgumentException
- if the madVersion
is not valid.
MFStandardException
- if authentication fails.
|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |