24ApduUtil::ApduUtil() {}
30 const std::vector<uint8_t>& dataIn,
33 std::vector<uint8_t> apduCommand;
45 if (dataIn.size() != 0) {
47 apduCommand[4] =
static_cast<uint8_t
>(dataIn.size());
49 apduCommand[apduCommand.size() - 1] = le;
62 const std::vector<uint8_t>& dataIn)
64 std::vector<uint8_t> apduCommand;
76 if (dataIn.size() != 0) {
78 apduCommand[4] =
static_cast<uint8_t
>(dataIn.size());
83 apduCommand[4] = 0x00;
94 std::vector<uint8_t> apduCommand;
100 apduCommand[0] = cla;
101 apduCommand[1] = ins;
117 std::vector<uint8_t> apduCommand;
123 apduCommand[0] = cla;
124 apduCommand[1] = ins;
130 apduCommand[4] = 0x00;
141 length +=
static_cast<int>(data.size() + 1);
144 return std::vector<uint8_t>(length);
151 length +=
static_cast<int>(data.size() + 1);
153 return std::vector<uint8_t>(length);
164 return std::vector<uint8_t>(length);
174 return std::vector<uint8_t>(length);
179 if (apduCommand.size() > 4) {
180 return apduCommand[4] == apduCommand.size() - 6;
static bool isCase4(const std::vector< uint8_t > &apduCommand)
static std::vector< uint8_t > allocateBuffer()
static const std::vector< uint8_t > build(const uint8_t cla, const uint8_t ins, const uint8_t p1, const uint8_t p2, const std::vector< uint8_t > &dataIn, const uint8_t le)
static void arraycopy(const std::vector< char > &src, size_t srcPos, std::vector< char > &dest, size_t destPos, size_t length)