Search in sources :

Example 6 with ResponseAPDU

use of javax.smartcardio.ResponseAPDU 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);
    }
}
Also used : SCIOException(org.openecard.common.ifd.scio.SCIOException) ResponseAPDU(javax.smartcardio.ResponseAPDU) CardResponseAPDU(org.openecard.common.apdu.common.CardResponseAPDU) CardException(javax.smartcardio.CardException) CardCommandAPDU(org.openecard.common.apdu.common.CardCommandAPDU) CommandAPDU(javax.smartcardio.CommandAPDU) CardResponseAPDU(org.openecard.common.apdu.common.CardResponseAPDU)

Aggregations

ResponseAPDU (javax.smartcardio.ResponseAPDU)6 CommandAPDU (javax.smartcardio.CommandAPDU)4 IOException (java.io.IOException)2 CardException (javax.smartcardio.CardException)2 MainApplet (applet.MainApplet)1 CardManager (cardTools.CardManager)1 RunConfig (cardTools.RunConfig)1 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 Card (javax.smartcardio.Card)1 CardChannel (javax.smartcardio.CardChannel)1 CardTerminal (javax.smartcardio.CardTerminal)1 CardCommandAPDU (org.openecard.common.apdu.common.CardCommandAPDU)1 CardResponseAPDU (org.openecard.common.apdu.common.CardResponseAPDU)1 SCIOException (org.openecard.common.ifd.scio.SCIOException)1 Test (org.testng.annotations.Test)1