public final class ApduResponse
extends java.lang.Object
implements java.io.Serializable
ApduRequest
.
The ApduResponse is built by a reader from an array of bytes received from the card in response to an ApduRequest. The status code and the success status of the command are retrieved from the data.
Constructor and Description |
---|
ApduResponse(byte[] buffer,
java.util.Set<java.lang.Integer> successfulStatusCodes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
byte[] |
getBytes()
Gets all the data received from the card including SW1SW2.
|
byte[] |
getDataOut()
Get the data received from the card excluding SW1SW2.
|
int |
getStatusCode()
Gets the status code SW1SW2 of the APDU.
|
int |
hashCode() |
boolean |
isSuccessful()
Tells if the current APDU is successful or not.
|
java.lang.String |
toString() |
public ApduResponse(byte[] buffer, java.util.Set<java.lang.Integer> successfulStatusCodes)
The internal successful status is determined by the current status code (sw1sw2) and the optional successful status codes list.
The list of additional successful status codes is used to possibly set the successful flag only if not equal to 0x9000.
buffer
- A byte array (must be not null)successfulStatusCodes
- An optional Set of Integer (may be null)public boolean isSuccessful()
public int getStatusCode()
public byte[] getBytes()
public byte[] getDataOut()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object