22 EXTERNAL_AUTHENTICATE = 0x82,
24 GENERAL_AUTHENTICATE = 0x86,
27 RESET_RETRY_COUNTER = 0x2C,
51 CHIP_AUTHENTICATION = 0x41,
53 AUTHENTICATION_TEMPLATE = 0xA4,
54 DIGITAL_SIGNATURE_TEMPLATE = 0xB6,
55 SELF_DESCRIPTIVE = 0xBE,
59 static const int NO_LE = 0;
60 static const int SHORT_MAX_LC = 0xFF;
61 static const int SHORT_MAX_LE = 0x0100;
62 static const int EXTENDED_MAX_LC = 0x00FFFF;
63 static const int EXTENDED_MAX_LE = 0x010000;
65 [[nodiscard]]
static bool isExtendedLength(
const QByteArray& pData,
int pLe);
67 explicit CommandApdu(
const QByteArray& pBuffer = QByteArray());
68 explicit CommandApdu(
const QByteArray& pHeader,
const QByteArray& pData,
int pLe = NO_LE);
69 explicit CommandApdu(Ins pIns, uchar pP1, uchar pP2,
const QByteArray& pData = QByteArray(),
int pLe = NO_LE);
70 virtual ~CommandApdu();
72 void enableCommandChaining();
73 [[nodiscard]]
bool isCommandChaining()
const;
75 void setSecureMessaging(
bool pEnabled);
76 [[nodiscard]]
bool isSecureMessaging()
const;
78 [[nodiscard]]
bool isEmpty()
const;
79 [[nodiscard]] Ins getINS()
const;
80 [[nodiscard]] uchar getP1()
const;
81 [[nodiscard]] uchar getP2()
const;
82 [[nodiscard]] QByteArray getHeaderBytes()
const;
83 [[nodiscard]]
const QByteArray& getData()
const;
84 [[nodiscard]]
int getLe()
const;
85 [[nodiscard]]
bool isExtendedLength()
const;
87 operator QByteArray()
const;
91inline QDebug
operator<<(QDebug pDbg,
const CommandApdu& pCommandApdu)
93 QDebugStateSaver saver(pDbg);
94 pDbg << QByteArray(pCommandApdu).toHex();
99char*
toString(
const CommandApdu& pCommandApdu);
102inline bool operator==(
const CommandApdu& pLeft,
const CommandApdu& pRight)
104 return QByteArray(pLeft) == QByteArray(pRight);
#define defineTypedEnumType(enumName, enumType,...)
Definition: EnumHelper.h:65
A simple template renderer.
Definition: ActivationContext.h:15
UNKNOWN
Definition: ResponseApdu.h:63
char * toString(const CommandApdu &pCommandApdu)
QDebug operator<<(QDebug pDbg, const CommandApdu &pCommandApdu)
Definition: CommandApdu.h:91
bool operator==(const CommandApdu &pLeft, const CommandApdu &pRight)
Definition: CommandApdu.h:102