Keypop Card C++ API 2.0.0
Reference Card API for C++
Public Member Functions | List of all members
keypop::card::ProxyReaderApi Class Referenceabstract

#include <ProxyReaderApi.hpp>

Public Member Functions

virtual ~ProxyReaderApi ()=default
 
virtual const std::shared_ptr< CardResponseApitransmitCardRequest (const std::shared_ptr< CardRequestSpi > cardRequest, const ChannelControl channelControl)=0
 
virtual void releaseChannel ()=0
 

Detailed Description

Reader able to transmit card requests and having control over the physical channel.

Backside of the keypop::reader::CardReader interface present in the Terminal 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

Definition at line 33 of file ProxyReaderApi.hpp.

Constructor & Destructor Documentation

◆ ~ProxyReaderApi()

virtual keypop::card::ProxyReaderApi::~ProxyReaderApi ( )
virtualdefault

Member Function Documentation

◆ releaseChannel()

virtual void keypop::card::ProxyReaderApi::releaseChannel ( )
pure virtual

Releases the communication channel previously established with the card.

Exceptions
ReaderBrokenCommunicationExceptionIf the communication with the reader has failed.
Since
1.0.0

◆ transmitCardRequest()

virtual const std::shared_ptr< CardResponseApi > keypop::card::ProxyReaderApi::transmitCardRequest ( const std::shared_ptr< CardRequestSpi >  cardRequest,
const ChannelControl  channelControl 
)
pure virtual

Transmits a keypop::card::CardRequestSpi, applies the provided keypop::card::ChannelControl policy and returns a keypop::card::CardResponseApi.

The APDUs (keypop::card::spi::ApduRequestSpi) contained in the keypop::card::CardRequestSpi are sent to the card, their responses (keypop::card::ApduResponseApi) are added to a new list (keypop::card::CardResponseApi).

Note: in case of an error when sending an APDU (communication error, unexpected status word), an keypop::card::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 the keypop::card::CardRequestSpi or to have strict control over the APDUs sent to the card (see keypop::card::CardRequestSpi::stopOnUnsuccessfulStatusWord()).

Parameters
cardRequestThe card request.
channelControlThe channel control policy to apply.
Returns
A not null reference.
Exceptions
IllegalArgumentExceptionIf one of the provided parameters is null.
ReaderBrokenCommunicationExceptionIf the communication with the reader has failed.
CardBrokenCommunicationExceptionIf the communication with the card has failed.
UnexpectedStatusWordExceptionIf any of the APDUs returned an unexpected status word and the card request specified the need to check them.
Since
1.0.0

The documentation for this class was generated from the following file: