23 EXTERNAL_AUTHENTICATE = 0x82,
25 GENERAL_AUTHENTICATE = 0x86,
28 RESET_RETRY_COUNTER = 0x2C,
52 CHIP_AUTHENTICATION = 0x41,
54 AUTHENTICATION_TEMPLATE = 0xA4,
55 DIGITAL_SIGNATURE_TEMPLATE = 0xB6,
56 SELF_DESCRIPTIVE = 0xBE,
60 static const int NO_LE = 0;
61 static const int SHORT_MAX_LC = 0xFF;
62 static const int SHORT_MAX_LE = 0x0100;
63 static const int EXTENDED_MAX_LC = 0x00FFFF;
64 static const int EXTENDED_MAX_LE = 0x010000;
66 [[nodiscard]]
static bool isExtendedLength(
const QByteArray& pData,
int pLe);
68 explicit CommandApdu(
const QByteArray& pBuffer = QByteArray());
69 explicit CommandApdu(
const QByteArray& pHeader,
const QByteArray& pData,
int pLe = NO_LE);
70 explicit CommandApdu(Ins pIns, uchar pP1, uchar pP2,
const QByteArray& pData = QByteArray(),
int pLe = NO_LE);
71 virtual ~CommandApdu();
73 [[nodiscard]]
bool isProprietary()
const;
75 void enableCommandChaining();
76 [[nodiscard]]
bool isCommandChaining()
const;
78 void setSecureMessaging(
bool pEnabled);
79 [[nodiscard]]
bool isSecureMessaging()
const;
81 [[nodiscard]]
bool isEmpty()
const;
82 [[nodiscard]] Ins getINS()
const;
83 [[nodiscard]] uchar getP1()
const;
84 [[nodiscard]] uchar getP2()
const;
85 [[nodiscard]] QByteArray getHeaderBytes()
const;
86 [[nodiscard]]
const QByteArray& getData()
const;
87 [[nodiscard]]
int getLe()
const;
88 [[nodiscard]]
bool isExtendedLength()
const;
90 operator QByteArray()
const;
94 inline QDebug
operator<<(QDebug pDbg,
const CommandApdu& pCommandApdu)
96 QDebugStateSaver saver(pDbg);
97 pDbg << QByteArray(pCommandApdu).toHex();
105 inline bool operator==(
const CommandApdu& pLeft,
const CommandApdu& pRight)
107 return QByteArray(pLeft) == QByteArray(pRight);
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16
UNKNOWN
Definition: ResponseApdu.h:63
defineTypedEnumType(Ins, uchar, UNKNOWN=0x00, DEACTIVATE=0x04, VERIFY=0x20, MSE_SET=0x22, ACTIVATE=0x44, EXTERNAL_AUTHENTICATE=0x82, GET_CHALLENGE=0x84, GENERAL_AUTHENTICATE=0x86, PSO_VERIFY=0x2A, PSO_COMPUTE=0x2B, RESET_RETRY_COUNTER=0x2C, SELECT=0xA4, READ_BINARY=0xB0, GET_RESPONSE=0xC0, UPDATE_BINARY=0xD6) class CommandApdu
Definition: CommandApdu.h:17
QDebug operator<<(QDebug pDbg, const CommandApdu &pCommandApdu)
Definition: CommandApdu.h:94
char * toString(const CommandApdu &pCommandApdu)
bool operator==(const CommandApdu &pLeft, const CommandApdu &pRight)
Definition: CommandApdu.h:105