Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Member Functions | Public Attributes | Friends | List of all members
keyple::plugin::stub::StubSecureElement Class Referenceabstract

#include <StubSecureElement.h>

Public Member Functions

virtual ~StubSecureElement ()
 
virtual const std::vector< uint8_t > & getATR ()=0
 
virtual bool isPhysicalChannelOpen ()
 
virtual void openPhysicalChannel ()
 
virtual void closePhysicalChannel ()
 
virtual std::string getSeProcotol ()=0
 
virtual void addHexCommand (const std::string &command, const std::string &response)
 
virtual void removeHexCommand (const std::string &command)
 
virtual std::vector< uint8_t > processApdu (const std::vector< uint8_t > &apduIn)
 

Public Attributes

bool mIsPhysicalChannelOpen = false
 
std::unordered_map< std::string, std::string > mHexCommands
 

Friends

std::ostream & operator<< (std::ostream &os, const StubSecureElement &s)
 
std::ostream & operator<< (std::ostream &os, const std::shared_ptr< StubSecureElement > &s)
 

Constructor & Destructor Documentation

◆ ~StubSecureElement()

virtual keyple::plugin::stub::StubSecureElement::~StubSecureElement ( )
inlinevirtual

Member Function Documentation

◆ addHexCommand()

void keyple::plugin::stub::StubSecureElement::addHexCommand ( const std::string &  command,
const std::string &  response 
)
virtual

Add more simulated commands to the Stub SE

Parameters
command: hexadecimal command to react to
response: hexadecimal response to be sent in reaction to command

◆ closePhysicalChannel()

void keyple::plugin::stub::StubSecureElement::closePhysicalChannel ( )
virtual

◆ getATR()

virtual const std::vector<uint8_t>& keyple::plugin::stub::StubSecureElement::getATR ( )
pure virtual

Getter for ATR

Returns
Secured Element ATR

◆ getSeProcotol()

virtual std::string keyple::plugin::stub::StubSecureElement::getSeProcotol ( )
pure virtual
Returns
SE protocol supported by the SE

◆ isPhysicalChannelOpen()

bool keyple::plugin::stub::StubSecureElement::isPhysicalChannelOpen ( )
virtual

◆ openPhysicalChannel()

void keyple::plugin::stub::StubSecureElement::openPhysicalChannel ( )
virtual

◆ processApdu()

std::vector< uint8_t > keyple::plugin::stub::StubSecureElement::processApdu ( const std::vector< uint8_t > &  apduIn)
virtual

Return APDU Response to APDU Request

Parameters
apduIn: commands to be processed
Returns
APDU response
Exceptions
KeypleReaderIOExceptionif the communication with the reader or the SE has failed

◆ removeHexCommand()

void keyple::plugin::stub::StubSecureElement::removeHexCommand ( const std::string &  command)
virtual

Remove simulated commands from the Stub SE

Parameters
command: hexadecimal command to be removed

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  os,
const std::shared_ptr< StubSecureElement > &  s 
)
friend

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  os,
const StubSecureElement s 
)
friend

Member Data Documentation

◆ mHexCommands

std::unordered_map<std::string, std::string> keyple::plugin::stub::StubSecureElement::mHexCommands

◆ mIsPhysicalChannelOpen

bool keyple::plugin::stub::StubSecureElement::mIsPhysicalChannelOpen = false

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