|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nokia.nfc.nxp.mfstd.MFTrailerContents
public class MFTrailerContents
Describes the contents of a sector trailer, including authentication keys and access bits.
Field Summary | |
---|---|
static int |
MAX_GPB_VALUE
The largest general purpose byte (GPB) value. |
static int |
MIN_GPB_VALUE
The smallest general purpose byte (GPB) value. |
Constructor Summary | |
---|---|
MFTrailerContents()
Constructs a new MFTrailerContents instance. |
|
MFTrailerContents(byte[] trailerBlock)
Constructs a new MFTrailerContents instance using the given trailer block bytes. |
|
MFTrailerContents(MFKey.KeyA keyA,
MFKey.KeyB keyB,
MFAccessBits accessBits,
int gpb)
Constructs a new MFTrailerContents instance using the specified values. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Tests if the given object equal to this object. |
MFAccessBits |
getAccessBits()
Returns the access bits of the trailer. |
int |
getGeneralPurposeByte()
Returns the general purpose byte (GPB) of this sector trailer. |
MFKey.KeyA |
getKeyA()
Returns the authentication key A. |
MFKey.KeyB |
getKeyB()
Returns the authentication key B. |
void |
setAccessBits(MFAccessBits accessBits)
Sets the access bits of the sector trailer. |
void |
setGeneralPurposeByte(int gpb)
Sets the new general purpose byte (GPB) value. |
void |
setKeyA(MFKey.KeyA key)
Set the authentication key A. |
void |
setKeyB(MFKey.KeyB key)
Set the authentication key B. |
byte[] |
toByteArray()
Returns the contents of the sector trailer as a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_GPB_VALUE
public static final int MIN_GPB_VALUE
Constructor Detail |
---|
public MFTrailerContents()
null
and the general purpose byte is set to 0.
The trailer contents must be set with the set methods before using this
object.
public MFTrailerContents(MFKey.KeyA keyA, MFKey.KeyB keyB, MFAccessBits accessBits, int gpb)
keyA
- the authentication key A.keyB
- the authentication key B.accessBits
- the access bits.gpb
- the general purpose byte.
java.lang.NullPointerException
- if keyA
, keyB
or
accessBits
is null
.
java.lang.IllegalArgumentException
- if gpb
value is out of range.public MFTrailerContents(byte[] trailerBlock)
trailerBlock.length
must equal
to 16.
trailerBlock
- sector trailer block contents.
java.lang.NullPointerException
- if trailerBlock
is null
.
java.lang.IllegalArgumentException
- if trailerBlock
is not a valid trailer block.Method Detail |
---|
public MFKey.KeyB getKeyB()
null
if it has not been set.public MFKey.KeyA getKeyA()
null
if it has not been set.public void setKeyB(MFKey.KeyB key)
key
- the authentication key B.
java.lang.NullPointerException
- if key
is null
.public void setKeyA(MFKey.KeyA key)
key
- the authentication key A.
java.lang.NullPointerException
- if key
is null
.public MFAccessBits getAccessBits()
public void setAccessBits(MFAccessBits accessBits)
accessBits
- the access bits.
java.lang.NullPointerException
- if accessBits
is null
.public void setGeneralPurposeByte(int gpb)
0
to 255
.
gpb
- the general purpose byte value.
java.lang.IllegalArgumentException
- if gpb
is out of range.public int getGeneralPurposeByte()
public byte[] toByteArray()
java.lang.NullPointerException
- if either of the keys or the access bits are not set.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
true
if the objects are equal and false
if not.
|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |