|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datecs.api.smartcard.ResponseAPDU
public final class ResponseAPDU
This class represents the smart card response APDU as defined in ISO/IEC 7816-4.
Instances of this class are immutable. Where data is passed in or out via byte arrays, defensive cloning is performed.
Constructor Summary | |
---|---|
ResponseAPDU(byte[] apdu)
Constructs a new instance of this class from a given byte array containing the complete APDU contents. |
Method Summary | |
---|---|
byte[] |
getBytes()
Returns a copy of the bytes in this APDU. |
byte[] |
getData()
Returns a copy of the data bytes in the response body. |
int |
getSW()
Returns the value of the status bytes SW1 and SW2 as a single status word SW. |
int |
getSW1()
Returns the value of the status byte SW1 as a value between 0 and 255. |
int |
getSW2()
Returns the value of the status byte SW2 as a value between 0 and 255. |
java.lang.String |
toString()
Returns the string representation of object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResponseAPDU(byte[] apdu)
If apdu
is null
, a
NullPointerException
is thrown.
if apdu.length < 2
, a IllegalArgumentException
is thrown.
Note that the byte array is cloned to protect against subsequent modification.
apdu
- the complete response APDU.Method Detail |
---|
public byte[] getData()
public int getSW1()
public int getSW2()
public int getSW()
(getSW1() << 8) | getSW2()
.
public byte[] getBytes()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |