44 virtual const std::vector<std::uint8_t>&
getApdu()
const = 0;
49 virtual void setApdu(
const std::vector<std::uint8_t>& apdu) = 0;
68 virtual const std::string&
getInfo()
const = 0;
75 const std::vector<uint8_t>& apdu = ars.
getApdu();
78 std::stringstream ssApdu;
79 for (
const auto val : apdu) {
80 ssApdu << std::uppercase << std::hex << std::setfill(
'0')
81 << std::setw(2) <<
static_cast<int>(val);
84 std::stringstream ssSw;
85 for (
auto it = std::begin(sw); it != std::end(sw); ++it) {
86 ssSw << std::uppercase << std::hex << std::setfill(
'0')
87 << std::setw(4) <<
static_cast<int>(*it);
88 if (it != sw.end() - 1) {
93 os <<
"APDU_REQUEST_SPI: {"
94 <<
"APDU: " << ssApdu.str() <<
", "
95 <<
"SUCCESSFUL_STATUS_WORD: " << ssSw.str() <<
", "
96 <<
"INFO: " << ars.
getInfo() <<
"}";
105 operator<<(std::ostream& os,
const std::shared_ptr<ApduRequestSpi> ars) {
117 const std::vector<std::shared_ptr<ApduRequestSpi>>& arss) {
118 os <<
"APDU_REQUEST_SPIS: {";
120 for (
auto it = std::begin(arss); it != std::end(arss); ++it) {
122 if (it != arss.end() - 1) {
Data to build a single APDU command to be sent to a card.
virtual ~ApduRequestSpi()=default
Virtual destructor.
virtual const std::string & getInfo() const =0
Gets the information about this APDU request (e.g.
virtual const std::vector< int > & getSuccessfulStatusWords() const =0
Gets the list of status words that must be considered successful for the APDU.
virtual void setApdu(const std::vector< std::uint8_t > &apdu)=0
C++.
friend std::ostream & operator<<(std::ostream &os, const ApduRequestSpi &ars)
virtual const std::vector< std::uint8_t > & getApdu() const =0
Gets the APDU bytes to be sent to the card.