use of javax.smartcardio.CommandAPDU in project open-ecard by ecsec.
the class PCSCTest method PCSCTest.
@Test(enabled = false)
public void PCSCTest() {
connect();
byte[] selectmf = new byte[] { (byte) 0x00, (byte) 0xA4, (byte) 0x00, (byte) 0x0C, (byte) 0x02, (byte) 0x3F, (byte) 0x00 };
try {
logger.info("Send APDU {}", ByteUtils.toHexString(selectmf));
ResponseAPDU response = connection.transmit(new CommandAPDU(selectmf));
logger.info("Receive APDU {}", ByteUtils.toHexString(response.getBytes()));
} catch (CardException ex) {
logger.error(ex.getMessage(), ex);
}
}
use of javax.smartcardio.CommandAPDU in project open-ecard by ecsec.
the class PCSCChannel method transmit.
@Override
public CardResponseAPDU transmit(byte[] command) throws SCIOException {
try {
CommandAPDU convertCommand = new CommandAPDU(command);
ResponseAPDU response = channel.transmit(convertCommand);
return new CardResponseAPDU(response.getBytes());
} catch (CardException ex) {
String msg = "Failed to transmit APDU to the card in terminal '%s'.";
throw new SCIOException(String.format(msg, card.getTerminal().getName()), getCode(ex), ex);
}
}
Aggregations