|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectds.ov2.util.Response_apdu
public class Response_apdu
Utility functions around Response APDU's. Takes the status words
defined for the OV-chip project (in Response_status) into
account.
| Nested Class Summary | |
|---|---|
class |
Response_apdu.Card_response_error
Exception of response APDU's that indicate an error. |
| Field Summary | |
|---|---|
private String |
name
A readable representation of the respose status. |
private ResponseAPDU |
response_apdu
The raw response APDU. |
private short |
response_argument
The response status argument. |
private short |
response_code
The pure response status. |
| Constructor Summary | |
|---|---|
Response_apdu(ResponseAPDU r)
Constructs a new response APDU from a raw response APDU r. |
|
| Method Summary | |
|---|---|
boolean |
error()
Check whether the respose status indicates an error. |
short |
get_argument()
Argument of the respose status. |
short |
get_code()
Return the pure response status. |
byte[] |
get_data()
The data of the response APDU. |
int |
get_length()
Length of the data in the response APDU. |
String |
get_name()
Return a readable name of the response status. |
short |
get_status()
Return the response status as obtained from the card. |
boolean |
OK()
Check whether the response status is OK. |
void |
print(PrintWriter out,
boolean with_message)
Print this response APDU in human readable form to out. |
void |
throw_if_not_ok(int check_expected_length)
Check whether the response status is OK and the contained data has the expected length. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ResponseAPDU response_apdu
private short response_code
ISO7816.SW_BYTES_REMAINING_00
the argument is stripped off.
private short response_argument
private String name
get_name().
| Constructor Detail |
|---|
public Response_apdu(ResponseAPDU r)
r.
r - the raw response APDU| Method Detail |
|---|
public boolean OK()
ISO7816.SW_NO_ERROR or 0x9000. Negation of
error().
ISO7816.SW_NO_ERROR;public boolean error()
ISO7816.SW_NO_ERROR and 0x9000. Negation of OK().
ISO7816.SW_NO_ERRORpublic short get_code()
ISO7816.SW_BYTES_REMAINING_00,
the argument is stripped off.
public short get_status()
public short get_argument()
public int get_length()
public byte[] get_data()
public String get_name()
Response_status.
public void print(PrintWriter out,
boolean with_message)
out.
Print the data in the body if with_message is true,
otherwise the data is supressed.
out - channel to print to, pass null to disable printingwith_message - print payload data if true
public void throw_if_not_ok(int check_expected_length)
throws Response_apdu.Card_response_error
Response_apdu.Card_response_error if the check fails.
This method combines precisely all the tests that are needed
after the OV-chip protocol layer received a response APDU.
If the status is ok, but the length of the data is wrong, then
the status of this response APDU is set to Response_status.OV_WRONG_RESPONSE_LENGTH and an Response_apdu.Card_response_error is thrown.
check_expected_length - the expected length of the data in
the response APDU; the special value -1 indicates that 255 and
256 data bytes are ok.
Response_apdu.Card_response_error - in case the status is not ok or the
length of the response data does not match
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||