public class CommandApdu extends AbstractCommandApdu
Command APDU Object
EXPECTED_LENGTH_WILDCARD_EXTENDED, EXPECTED_LENGTH_WILDCARD_SHORT| Constructor and Description |
|---|
CommandApdu(int cla,
int ins,
int p1,
int p2)
Constructs a case 1 command APDU just from the 4 header bytes
|
CommandApdu(int cla,
int ins,
int p1,
int p2,
byte[] data)
Constructs a case 3 APDU
If data is
null or empty, it constructs a case 1 APDU. |
CommandApdu(int cla,
int ins,
int p1,
int p2,
byte[] data,
java.lang.Integer ne)
Constructs a case 4 APDU from the four header bytes, command data,
and expected response data length.
|
CommandApdu(int cla,
int ins,
int p1,
int p2,
java.lang.Integer ne)
Constructs a case 2 APDU
If ne is
null it is encoded as case 1 APDU |
public CommandApdu(int cla,
int ins,
int p1,
int p2)
Constructs a case 1 command APDU just from the 4 header bytes
cla - class octet of command APDUins - INS octet of command APDUp1 - P1 octet of command APDUp2 - P2 octet of command APDUpublic CommandApdu(int cla,
int ins,
int p1,
int p2,
java.lang.Integer ne)
Constructs a case 2 APDU
If ne is null it is encoded as case 1 APDU
cla - class octet of command APDUins - INS octet of command APDUp1 - P1 octet of command APDUp2 - P2 octet of command APDUne - number of expected lengthpublic CommandApdu(int cla,
int ins,
int p1,
int p2,
byte[] data)
Constructs a case 3 APDU
If data is null or empty, it constructs a case 1 APDU. Command data length Nc is derived from the
byte array of data param
cla - class octet of command APDUins - INS octet of command APDUp1 - P1 octet of command APDUp2 - P2 octet of command APDUdata - command datapublic CommandApdu(int cla,
int ins,
int p1,
int p2,
byte[] data,
java.lang.Integer ne)
Constructs a case 4 APDU from the four header bytes, command data, and expected response data length. Command data length Nc is derived from the byte array of data param
If data is empty or null and/or ne is null, APDU is encoded as case 1, 2, or 3 per ISO 7816 respectively.
cla - CLA byteins - INS bytep1 - P1 bytep2 - P2 bytedata - data octet string
if data is null it is encoded as case 1 or 3 respectivelyne - number of expected bytes in response.
if ne is null it is encoded as case 1 or 3 respectively
ne = 0 is encoded as wildcard (short or extended)
ne = AbstractApdu.EXPECTED_LENGTH_WILDCARD_SHORT or ne = AbstractApdu.EXPECTED_LENGTH_WILDCARD_EXTENDED it is encoded as
short or extended wildcard respectivelyjava.lang.IllegalArgumentException - thrown in case of invalid parameter values