Interface ProxyReaderApi
Backside of the org.eclipse.keypop.reader.CardReader interface present in the Keypop Reader API.
An adapter of this interface must also implement CardReader.
To use this API, simply cast a CardReader as a ProxyReaderApi.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Releases the communication channel previously established with the card.transmitCardRequest
(CardRequestSpi cardRequest, ChannelControl channelControl) Transmits aCardRequestSpi
, applies the providedChannelControl
policy and returns aCardResponseApi
.
-
Method Details
-
transmitCardRequest
CardResponseApi transmitCardRequest(CardRequestSpi cardRequest, ChannelControl channelControl) throws ReaderBrokenCommunicationException, CardBrokenCommunicationException, UnexpectedStatusWordException Transmits aCardRequestSpi
, applies the providedChannelControl
policy and returns aCardResponseApi
.The APDUs (
ApduRequestSpi
) contained in theCardRequestSpi
are sent to the card, their responses (ApduResponseApi
) are added to a new list (CardResponseApi
).Note: in case of an error when sending an APDU (communication error, unexpected status word), an
AbstractApduException
exception is thrown. Any responses from previously transmitted APDU commands are attached to this exception.
This allows the calling application to be tolerant to card tearing and to retrieve the partial response to theCardRequestSpi
or to have strict control over the APDUs sent to the card (seeCardRequestSpi.stopOnUnsuccessfulStatusWord()
).- Parameters:
cardRequest
- The card request.channelControl
- The channel control policy to apply.- Returns:
- A non-null reference.
- Throws:
IllegalArgumentException
- If one of the provided parameters is null.ReaderBrokenCommunicationException
- If the communication with the reader has failed.CardBrokenCommunicationException
- If the communication with the card has failed.UnexpectedStatusWordException
- If any of the APDUs returned an unexpected status word and the card request specified the need to check them.- Since:
- 1.0.0
-
releaseChannel
Releases the communication channel previously established with the card.- Throws:
ReaderBrokenCommunicationException
- If the communication with the reader has failed.- Since:
- 1.0.0
-