AusweisApp2
Lade ...
Suche ...
Keine Treffer
ResponseApdu.h
gehe zur Dokumentation dieser Datei
1
5#pragma once
6
7#include "Apdu.h"
8#include "CardReturnCode.h"
9#include "EnumHelper.h"
10
11
12namespace governikus
13{
14defineTypedEnumType(StatusCode, quint16,
15 EMPTY = 0x0000,
16 INVALID = 0x0001,
17 SUCCESS = 0x9000,
18 NO_PKCS15_APP = 0x6200,
19 END_OF_FILE = 0x6282,
20 PIN_DEACTIVATED = 0x6283,
21 FCI_NO_ISO7816_4 = 0x6284,
22 VERIFICATION_FAILED = 0x6300,
23 INPUT_TIMEOUT = 0x6400,
24 INPUT_CANCELLED = 0x6401,
25 PASSWORDS_DIFFER = 0x6402,
26 PASSWORD_OUTOF_RANGE = 0x6403,
27 CARD_EJECTED_AND_REINSERTED = 0x64a2,
28 EEPROM_CELL_DEFECT = 0x6581,
29 SECURITY_ENVIRONMENT = 0x6600,
30 WRONG_LENGTH = 0x6700,
31 NO_BINARY_FILE = 0x6981,
32 LAST_CHAIN_CMD_EXPECTED = 0x6883,
33 ACCESS_DENIED = 0x6982,
34 PASSWORD_COUNTER_EXPIRED = 0x6983,
35 DIRECTORY_OR_PASSWORD_LOCKED_OR_NOT_ALLOWED = 0x6984,
36 NO_PARENT_FILE = 0x6985,
37 NOT_YET_INITIALIZED = 0x6985,
38 NO_CURRENT_DIRECTORY_SELECTED = 0x6986,
39 DATAFIELD_EXPECTED = 0x6987,
40 INVALID_SM_OBJECTS = 0x6988,
41 COMMAND_NOT_ALLOWED = 0x69f0,
42 INVALID_DATAFIELD = 0x6a80,
43 ALGORITHM_ID = 0x6a81,
44 FILE_NOT_FOUND = 0x6a82,
45 RECORD_NOT_FOUND = 0x6a83,
46 INVALID_PARAMETER = 0x6a86,
47 LC_INCONSISTANT = 0x6a87,
48 PASSWORD_NOT_FOUND = 0x6a88,
49 ILLEGAL_OFFSET = 0x6b00,
50 UNSUPPORTED_CLA = 0x6e00,
51 CANT_DISPLAY = 0x6410,
52 INVALID_P1P2 = 0x6a00,
53 UNSUPPORTED_INS = 0x6d00,
54 PIN_BLOCKED = 0x63c0, // retries left: 0
55 PIN_SUSPENDED = 0x63c1, // retries left: 1
56 PIN_RETRY_COUNT_2 = 0x63c2, // retries left: 2
57 )
58
59/*
60 * As defined in ISO-7816-4 Table-5
61 */
63 INVALID = 0x00,
79 SUCCESS = 0x90,
80 )
81
83 : public Apdu
84{
85 private:
86 static const int RETURN_CODE_LENGTH = 2;
87
88 protected:
89 virtual void setBuffer(const QByteArray& pBuffer);
90
91 public:
92 explicit ResponseApdu(StatusCode pStatusCode);
93 explicit ResponseApdu(const QByteArray& pBuffer = QByteArray());
94 virtual ~ResponseApdu() = default;
95
96 [[nodiscard]] QByteArray getData() const;
97 [[nodiscard]] int getDataLength() const;
98 [[nodiscard]] StatusCode getReturnCode() const;
99 [[nodiscard]] QByteArray getReturnCodeAsHex() const;
100 [[nodiscard]] int getRetryCounter() const;
101 [[nodiscard]] SW1 getSW1() const;
102 [[nodiscard]] char getSW2() const;
103 [[nodiscard]] CardReturnCode getCardReturnCode() const;
104};
105
107{
108 CardReturnCode mReturnCode = CardReturnCode::UNDEFINED;
110};
111
112#ifndef QT_NO_DEBUG
113inline bool operator ==(const ResponseApduResult& pLeft, const ResponseApduResult& pRight)
114{
115 return pLeft.mReturnCode == pRight.mReturnCode && pLeft.mResponseApdu.getBuffer() == pRight.mResponseApdu.getBuffer();
116}
117
118
119#endif
120
121} // namespace governikus
#define defineTypedEnumType(enumName, enumType,...)
Definition: EnumHelper.h:64
Definition: Apdu.h:13
const QByteArray & getBuffer() const
Definition: Apdu.cpp:31
Definition: ResponseApdu.h:84
virtual ~ResponseApdu()=default
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
quint8
Definition: ResponseApdu.h:62
WRONG_PARAMETERS_P1_P2_NO_INFO
Definition: ResponseApdu.h:74
WRONG_LENGTH
Definition: ResponseApdu.h:70
MORE_DATA_AVAILABLE
Definition: ResponseApdu.h:64
WRONG_PARAMETERS_P1_P2
Definition: ResponseApdu.h:73
FUNCTIONS_IN_CLASS_NOT_SUPPORTED
Definition: ResponseApdu.h:71
NONVOLATILE_MEMORY_CHANGED_2
Definition: ResponseApdu.h:68
SECURITY_ISSUE
Definition: ResponseApdu.h:69
bool operator==(const CVCertificate &pLeft, const CVCertificate &pRight)
Definition: CVCertificate.h:72
WRONG_LE_FIELD
Definition: ResponseApdu.h:75
NONVOLATILE_MEMORY_UNCHANGED_1
Definition: ResponseApdu.h:65
ERROR_COMMAND_NOT_ALLOWED
Definition: ResponseApdu.h:72
INVALID
Definition: ResponseApdu.h:63
INSTRUCTION_CODE_INVALID
Definition: ResponseApdu.h:76
NO_PRECISE_DIAGNOSIS
Definition: ResponseApdu.h:78
NONVOLATILE_MEMORY_UNCHANGED_2
Definition: ResponseApdu.h:67
NONVOLATILE_MEMORY_CHANGED_1
Definition: ResponseApdu.h:66
CLASS_NOT_SUPPORTED
Definition: ResponseApdu.h:77
SUCCESS
Definition: ResponseApdu.h:79
Definition: ResponseApdu.h:107
CardReturnCode mReturnCode
Definition: ResponseApdu.h:108
ResponseApdu mResponseApdu
Definition: ResponseApdu.h:109