Package org.eclipse.keyple.card.generic
Interface CardTransactionManager
public interface CardTransactionManager
Provides basic methods to prepare and process APDU exchange with a card.
-
Method Summary
Modifier and TypeMethodDescriptionprepareApdu
(byte[] apduCommand) Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays(ChannelControl)
is invoked.prepareApdu
(byte cla, byte ins, byte p1, byte p2, byte[] dataIn, Byte le) Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays(ChannelControl)
is invoked.prepareApdu
(String apduCommand) Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays(ChannelControl)
is invoked.List<byte[]>
processApdusToByteArrays
(ChannelControl channelControl) 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.processApdusToHexStrings
(ChannelControl channelControl) 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.
-
Method Details
-
prepareApdu
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays(ChannelControl)
is invoked.- Parameters:
apduCommand
- A not empty hexadecimal string containing a raw APDU command.- Returns:
- This instance.
- Since:
- 2.0.0
-
prepareApdu
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays(ChannelControl)
is invoked.- Parameters:
apduCommand
- A not empty byte arrays containing raw APDU commands.- Returns:
- This instance.
- Since:
- 2.0.0
-
prepareApdu
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays(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
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
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.
-