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;
94inline QDebug
operator<<(QDebug pDbg,
const CommandApdu& pCommandApdu)
96 QDebugStateSaver saver(pDbg);
97 pDbg << QByteArray(pCommandApdu).toHex();
105inline bool operator==(
const CommandApdu& pLeft,
const CommandApdu& pRight)
107 return QByteArray(pLeft) == QByteArray(pRight);
#define defineTypedEnumType(enumName, enumType,...)
Definition: EnumHelper.h:59
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16
UNKNOWN
Definition: ResponseApdu.h:63
char * toString(const CommandApdu &pCommandApdu)
QDebug operator<<(QDebug pDbg, const CommandApdu &pCommandApdu)
Definition: CommandApdu.h:94
bool operator==(const CommandApdu &pLeft, const CommandApdu &pRight)
Definition: CommandApdu.h:105