40 virtual const std::vector<uint8_t>&
getApdu()
const = 0;
45 virtual void setApdu(
const std::vector<std::uint8_t>& apdu) = 0;
69 const std::vector<uint8_t>& apdu = ara.
getApdu();
70 const std::vector<uint8_t> dataOut = ara.
getDataOut();
72 std::stringstream ssApdu;
73 for (
const auto val : apdu) {
74 ssApdu << std::uppercase << std::hex << std::setfill(
'0')
75 << std::setw(2) <<
static_cast<int>(val);
78 std::stringstream ssDataOut;
79 for (
const auto val : dataOut) {
80 ssDataOut << std::uppercase << std::hex << std::setfill(
'0')
81 << std::setw(2) <<
static_cast<int>(val);
84 std::stringstream ssSw;
85 ssSw << std::uppercase << std::hex << std::setfill(
'0') << std::setw(4)
88 os <<
"APDU_RESPONSE_API: {"
89 <<
"APDU: " << ssApdu.str() <<
", "
90 <<
"DATA_OUT: " << ssDataOut.str() <<
", "
91 <<
"STATUS_WORD: " << ssSw.str() <<
"}";
100 operator<<(std::ostream& os,
const std::shared_ptr<ApduResponseApi> ara) {
112 const std::vector<std::shared_ptr<ApduResponseApi>>& aras) {
113 os <<
"APDU_RESPONSE_APIS: {";
115 for (
auto it = std::begin(aras); it != std::end(aras); ++it) {
117 if (it != aras.end() - 1) {
Data received in response to an APDU command.
virtual void setApdu(const std::vector< std::uint8_t > &apdu)=0
C++.
virtual const std::vector< uint8_t > & getApdu() const =0
Gets the raw data received from the card (including the status word).
virtual std::vector< uint8_t > getDataOut() const =0
Gets the data part of the response received from the card (excluding the status word).
friend std::ostream & operator<<(std::ostream &os, const ApduResponseApi &ara)
virtual int getStatusWord() const =0
Gets the status word of the APDU as an int.