Methods Summary |
---|
public void | done()Safely closes the connection.
try {
if (h != null) {
APDUManager.closeConnection(h);
}
} catch (IOException e) {} // ignore
h = null;
|
public byte[] | getATR()This method returns the ATR received from the card that this
Handle object is used to communicate with.
return h.getATR();
|
public byte[] | getFCI()This method returns the FCI received from the card that this
Handle object is used to communicate with.
return h.getFCI();
|
public com.sun.satsa.util.Connection | putByte(int data)Places one byte into command buffer.
command[offset++] = (byte) data;
return this;
|
public com.sun.satsa.util.Connection | putBytes(byte[] data, int off, int length)Places the byte sequence into the buffer.
System.arraycopy(data, off, command, offset, length);
offset += length;
return this;
|
public com.sun.satsa.util.Connection | putShort(int data)Places short value into the buffer.
command[offset++] = (byte) (data >> 8);
command[offset++] = (byte) data;
return this;
|
public com.sun.satsa.util.Connection | resetCommand()Resets command buffer.
offset = 5;
return this;
|
public byte[] | sendCommand(int INS, int P1P2)Sends the command.
return sendCommand(INS, P1P2, 240, true);
|
public byte[] | sendCommand(int INS, int P1P2, int LE, boolean check)Sends the command.
command[0] = (byte) (CLAbyte | h.channel);
command[1] = (byte) INS;
command[2] = (byte) (P1P2 >> 8);
command[3] = (byte) P1P2;
command[4] = (byte) (offset - 5);
putByte(LE);
byte[] tmp = APDUManager.exchangeAPDU(h, command);
lastSW = ((tmp[tmp.length - 2] & 0xff) << 8) |
(tmp[tmp.length - 1] & 0xff);
if (check && lastSW != 0x9000) {
throw new IOException("SW = " + Integer.toHexString(lastSW));
}
return tmp;
|
public void | setCLAbyte(byte cla)This method sets value for the CLAbyte variable
this.CLAbyte = cla;
|
public void | setUnitSize(int unitSize)This method sets value for the unitSize variable
this.unitSize = unitSize;
|