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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CardTransactionManager
prepareApdu(byte[] apduCommand)
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays()
is invoked.CardTransactionManager
prepareApdu(byte cla, byte ins, byte p1, byte p2, byte[] dataIn, java.lang.Byte le)
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays()
is invoked.CardTransactionManager
prepareApdu(java.lang.String apduCommand)
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays()
is invoked.CardTransactionManager
prepareReleaseChannel()
Requests the closing of the physical channel after the next transmission of APDUs.java.util.List<byte[]>
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.java.util.List<java.lang.String>
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.
-
-
-
Method Detail
-
prepareApdu
CardTransactionManager prepareApdu(java.lang.String apduCommand)
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays()
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 timeprocessApdusToByteArrays()
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, java.lang.Byte le)
Prepares an APDU to be transmitted the next timeprocessApdusToByteArrays()
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
-
prepareReleaseChannel
CardTransactionManager prepareReleaseChannel()
Requests the closing of the physical channel after the next transmission of APDUs.- Returns:
- This instance.
- Since:
- 2.0.0
-
processApdusToByteArrays
java.util.List<byte[]> processApdusToByteArrays() 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.
- 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() 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.
- Returns:
- A not null reference.
- Throws:
TransactionException
- If the communication with the card or the reader has failed.
-
-