public class ResponseAPDU
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private byte[] |
data
Contains the bytearray-Representation of this APDU
|
private static short |
MAXIMUM_STAND_APDU_ARGUMENT_LENGTH |
static byte |
STATUS_B1_OK_BYTES_AVAILABLE |
static short |
STATUS_COMMAND_NOT_ALLOWED |
static short |
STATUS_COMMAND_RUNNING |
static short |
STATUS_INS_NOT_SUPPORTED |
static short |
STATUS_OK |
static short |
STATUS_RECORD_NOT_FOUND |
static short |
STATUS_UNKNOWN_ERROR |
Constructor and Description |
---|
ResponseAPDU(byte[] data)
Creates a ResponseAPDU object out of the raw bytes of an APDU.
|
ResponseAPDU(byte[] body,
short statuscode)
Create a ResponseAPDU out of a body and a statuscode
|
ResponseAPDU(short statuscode)
Create a ResponseAPDU only with a statuscode
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Returns true if the underlying bytearray is equal.
|
byte[] |
getArgumentData()
Returns a bytearray of the Argument Data.
|
int |
getArgumentDataLength()
Returns length of the Argument Data.
|
byte[] |
getRaw()
Returns a Copy of the underlying bytearray.
|
ResponseAPDU |
getStandardResponseAPDU(int parcelNumber)
Returns a non-extended ResponseAPDU.
|
int |
getStandardResponseAPDUCount() |
byte |
getStatusByte1()
The first status byte.
|
byte |
getStatusByte2()
The second status byte.
|
short |
getStatusBytes()
The status bytes as an integer..
|
boolean |
isExtendedAPDU()
Check if this is a extended response APDU.
|
boolean |
isValidAPDU()
Checks if this is a valid response APDU.
|
java.lang.String |
toString() |
private static final short MAXIMUM_STAND_APDU_ARGUMENT_LENGTH
public static final short STATUS_OK
public static final byte STATUS_B1_OK_BYTES_AVAILABLE
public static final short STATUS_UNKNOWN_ERROR
public static final short STATUS_INS_NOT_SUPPORTED
public static final short STATUS_RECORD_NOT_FOUND
public static final short STATUS_COMMAND_RUNNING
public static final short STATUS_COMMAND_NOT_ALLOWED
private final byte[] data
public ResponseAPDU(short statuscode)
statuscode
- The last two bytes of the integer will be used as status code.public ResponseAPDU(byte[] data)
data
- The Bytearray containing the Response APDUpublic ResponseAPDU(byte[] body, short statuscode)
body
- bytearray of arbitary length or null
. Null is
treated as no bodystatuscode
- The last two bytes of the integer will be used as status code.public boolean isValidAPDU()
true
if this is a valid response APDU,
false
otherwise.public boolean isExtendedAPDU()
true
if argument data length is greater than 256,
false
otherwise.public byte getStatusByte1()
public byte getStatusByte2()
public short getStatusBytes()
public byte[] getArgumentData()
public int getArgumentDataLength()
public byte[] getRaw()
byte[]
-Representation of this APDU.public ResponseAPDU getStandardResponseAPDU(int parcelNumber)
parcelNumber
- An extended ResponseAPDU has to be parceled in multiple
non-extended ResponseAPDUs. Starting from zero.ResponseAPDU
.public int getStandardResponseAPDUCount()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object