Interface CardTransactionManager

All Superinterfaces:
org.eclipse.keypop.reader.transaction.spi.CardTransactionManager<CardTransactionManager>

public interface CardTransactionManager extends org.eclipse.keypop.reader.transaction.spi.CardTransactionManager<CardTransactionManager>
Provides basic methods to prepare and process APDU exchange with a card.
  • Method Details

    • prepareApdu

      CardTransactionManager prepareApdu(String apduCommand)
      Prepares an APDU to be transmitted the next time processApdusToByteArrays(ChannelControl) is invoked.
      Parameters:
      apduCommand - A not empty hexadecimal string containing a raw APDU command.
      Returns:
      This instance.
      Since:
      2.0.0
    • prepareApdu

      CardTransactionManager prepareApdu(byte[] apduCommand)
      Prepares an APDU to be transmitted the next time processApdusToByteArrays(ChannelControl) is invoked.
      Parameters:
      apduCommand - A not empty byte arrays containing raw APDU commands.
      Returns:
      This instance.
      Since:
      2.0.0
    • prepareApdu

      CardTransactionManager prepareApdu(byte cla, byte ins, byte p1, byte p2, byte[] dataIn, Byte le)
      Prepares an APDU to be transmitted the next time processApdusToByteArrays(ChannelControl) is invoked.
      Parameters:
      cla - The class byte.
      ins - The instruction byte.
      p1 - The P1 parameter.
      p2 - The P2 parameter.
      dataIn - The APDU data, null if there is no data.
      le - The expected output length, 0 if the output length is unspecified, null if no output data is expected.
      Returns:
      This instance.
      Since:
      2.0.0
    • processApdusToByteArrays

      @Deprecated List<byte[]> processApdusToByteArrays(ChannelControl channelControl) throws TransactionException
      Deprecated.
      Use CardTransactionManager.processCommands(org.eclipse.keypop.reader.ChannelControl) and getResponsesAsByteArrays() instead.
      Transmits all prepared APDUs, closes the physical channel if required, and returns a list of responses to the APDUs in the form of list of of byte arrays.

      If the prepared APDU list is empty an empty list is returned.

      The prepared APDU list is cleared after this method has been invoked.

      Parameters:
      channelControl - Policy for managing the physical channel after executing commands to the card.
      Returns:
      A not null reference.
      Throws:
      TransactionException - If the communication with the card or the reader has failed.
      Since:
      2.0.0
    • processApdusToHexStrings

      @Deprecated List<String> processApdusToHexStrings(ChannelControl channelControl) throws TransactionException
      Deprecated.
      Use CardTransactionManager.processCommands(org.eclipse.keypop.reader.ChannelControl) and getResponsesAsHexStrings() instead.
      Transmits all prepared APDUs, closes the physical channel if required, and returns a list of responses to the APDUs in the form of list of hexadecimal strings.

      If the prepared APDU list is empty an empty list is returned.

      The prepared APDU list is cleared after this method has been invoked.

      Parameters:
      channelControl - Policy for managing the physical channel after executing commands to the card.
      Returns:
      A not null reference.
      Throws:
      TransactionException - If the communication with the card or the reader has failed.
      Since:
      2.0.0
    • getResponsesAsByteArrays

      List<byte[]> getResponsesAsByteArrays()
      Returns the list of responses corresponding to the commands executed by the last call to CardTransactionManager.processCommands(org.eclipse.keypop.reader.ChannelControl), represented as byte arrays.

      Each element in the returned list represents the response of one command, in the same order as the commands were prepared. The returned list is never null.
      This method does not alter the internal state of the manager: the list of responses remains available for later calls until CardTransactionManager.processCommands(org.eclipse.keypop.reader.ChannelControl) is invoked again, at which point it is replaced by the new set of responses.

      Returns:
      A not null list of byte arrays representing the command responses, in the same order as the commands were sent.
      Since:
      3.2.0
    • getResponsesAsHexStrings

      List<String> getResponsesAsHexStrings()
      Returns the list of responses corresponding to the commands executed by the last call to CardTransactionManager.processCommands(org.eclipse.keypop.reader.ChannelControl), represented as hexadecimal strings.

      Each element in the returned list represents the response of one command, in the same order as the commands were prepared. The returned list is never null.
      This method does not alter the internal state of the manager: the list of responses remains available for later calls until CardTransactionManager.processCommands(org.eclipse.keypop.reader.ChannelControl) is invoked again, at which point it is replaced by the new set of responses.

      Returns:
      A not null list of hexadecimal strings representing the command responses, in the same order as the commands were sent.
      Since:
      3.2.0