|
SE050 Driver
API reference
|
Classes | |
| struct | StatusWords |
| Parsed status words from a response APDU. More... | |
Functions | |
| Error | BuildCaseShort (std::uint8_t cla, std::uint8_t ins, std::uint8_t p1, std::uint8_t p2, const std::uint8_t *data, std::uint8_t data_len, bool le_present, std::uint8_t le, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept |
Build a CASE 3/4 short command when data_len ≤ 255 and a 1-byte Le is enough. | |
| Error | BuildCase4Extended (std::uint8_t cla, std::uint8_t ins, std::uint8_t p1, std::uint8_t p2, const std::uint8_t *data, std::size_t data_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len) noexcept |
| Build a CASE 4 command APDU with extended length encoding. | |
| Error | ParseResponse (const std::uint8_t *rsp, std::size_t rsp_len, const std::uint8_t **data_out, std::size_t *data_len_out, StatusWords *sw_out) noexcept |
Parse a simple R-APDU: optional response data followed by SW1 SW2. | |
| bool | IsSuccess (const StatusWords &sw) noexcept |
Return true when SW1 == 0x90 and SW2 == 0x00. | |
| bool | IsMoreData (const StatusWords &sw) noexcept |
SW1 == 0x61 — more data available via GET RESPONSE (common GlobalPlatform pattern). | |
|
inlinenoexcept |
Build a CASE 4 command APDU with extended length encoding.
Layout: CLA INS P1 P2 00 Lc_hi Lc_lo [data...] Le_hi Le_lo (ISO/IEC 7816-4 section 5.1, case 4E). With an extended Lc present, Le is two bytes; 00 00 asks for up to 65536 bytes. (The three-byte 00 Le_hi Le_lo form is only for case 2E, which has no Lc.)
| cla | INS class byte. |
| ins | Instruction byte. |
| p1 | First parameter. |
| p2 | Second parameter. |
| data | Command data field (may be nullptr if data_len == 0). |
| data_len | Length of data (0 … kMaxApduCommandBytes - 9). |
| out | Serialized APDU. |
| out_cap | Capacity of out. |
| out_len | Written length on success. |
|
inlinenoexcept |
Build a CASE 3/4 short command when data_len ≤ 255 and a 1-byte Le is enough.
Layout: CLA INS P1 P2 Lc [data...] [Le]. If le_present is false, the Le byte is omitted (CASE 3). If le_present is true, le is appended (CASE 4 short).
|
inlinenoexcept |
SW1 == 0x61 — more data available via GET RESPONSE (common GlobalPlatform pattern).
|
inlinenoexcept |
Return true when SW1 == 0x90 and SW2 == 0x00.
|
inlinenoexcept |
Parse a simple R-APDU: optional response data followed by SW1 SW2.
| rsp | Full response INF from the T=1 layer (typically T1Session::ExchangeInformation). |
| rsp_len | Length of rsp (must be ≥ 2). |
| data_out | Optional pointer into rsp where payload starts (may equal rsp). |
| data_len_out | Length of payload excluding status bytes. |
| sw_out | Status words. |