Interface CardTransactionManager


  • public interface CardTransactionManager
    Provides basic methods to prepare and process APDU exchange with a card.
    • Method Detail

      • prepareApdu

        CardTransactionManager prepareApdu​(java.lang.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 cla,
                                           byte ins,
                                           byte p1,
                                           byte p2,
                                           byte[] dataIn,
                                           java.lang.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

        java.util.List<byte[]> processApdusToByteArrays​(ChannelControl channelControl)
                                                 throws TransactionException
        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.
      • processApdusToHexStrings

        java.util.List<java.lang.String> processApdusToHexStrings​(ChannelControl channelControl)
                                                           throws TransactionException
        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.