AusweisApp
Lade ...
Suche ...
Keine Treffer
ReaderInfo.h
gehe zur Dokumentation dieser Datei
1
5#pragma once
6
7#include "CardInfo.h"
11
12#include <QString>
13#include <QVariant>
14
15namespace governikus
16{
18{
19 friend class Reader;
20
21 private:
22 ReaderManagerPluginType mPluginType;
23 QString mName;
24 bool mBasicReader;
25 CardInfo mCardInfo;
26 int mMaxApduLength;
27 CardType mShelvedCard;
28
29 public:
30 explicit ReaderInfo(const QString& pName = QString(),
31 ReaderManagerPluginType pPluginType = ReaderManagerPluginType::UNKNOWN,
32 const CardInfo& pCardInfo = CardInfo(CardType::NONE));
33
35
36
38 {
39 return mPluginType;
40 }
41
42
43 [[nodiscard]] bool isValid() const
44 {
45 return mPluginType != ReaderManagerPluginType::UNKNOWN;
46 }
47
48
50 {
51 mPluginType = ReaderManagerPluginType::UNKNOWN;
52 mCardInfo = CardInfo(CardType::NONE);
53 }
54
55
57 {
58 return mCardInfo;
59 }
60
61
62 [[nodiscard]] const CardInfo& getCardInfo() const
63 {
64 return mCardInfo;
65 }
66
67
69 {
70 return mCardInfo.getCardType();
71 }
72
73
74 [[nodiscard]] QString getCardTypeString() const
75 {
76 return mCardInfo.getCardTypeString();
77 }
78
79
80 [[nodiscard]] bool hasCard() const
81 {
82 return mCardInfo.getCardType() != CardType::NONE;
83 }
84
85
86 [[nodiscard]] bool hasEid() const
87 {
88 return QList<CardType>({CardType::EID_CARD, CardType::SMART_EID}).contains(mCardInfo.getCardType());
89 }
90
91
92 [[nodiscard]] int getRetryCounter() const
93 {
94 return mCardInfo.getRetryCounter();
95 }
96
97
99 {
100 return mCardInfo.isRetryCounterDetermined();
101 }
102
103
105 {
106 return mCardInfo.isPinDeactivated();
107 }
108
109
111 {
112 return mCardInfo.isPukInoperative();
113 }
114
115
117 {
118 return mCardInfo.getMobileEidType() == MobileEidType::HW_KEYSTORE;
119 }
120
121
122 [[nodiscard]] bool wasShelved() const
123 {
124 return mShelvedCard != CardType::NONE;
125 }
126
127
129 {
130 mShelvedCard = mCardInfo.getCardType();
131 mCardInfo.setCardType(CardType::NONE);
132 }
133
134
135 [[nodiscard]] bool isInsertable() const;
136
137
139 {
140 mCardInfo.setCardType(mShelvedCard);
141 }
142
143
145 {
146 mCardInfo = pCardInfo;
147 }
148
149
150 [[nodiscard]] const QString& getName() const
151 {
152 return mName;
153 }
154
155
157 {
158 mBasicReader = pIsBasicReader;
159 }
160
161
162 [[nodiscard]] bool isBasicReader() const
163 {
164 return mBasicReader;
165 }
166
167
169 {
170 mMaxApduLength = pMaxApduLength;
171 }
172
173
175 {
176 return mMaxApduLength;
177 }
178
179
181 {
182 return mMaxApduLength >= 0 && mMaxApduLength < 500;
183 }
184
185
186};
187
188} // namespace governikus
Holds smart card information.
Definition CardInfo.h:26
void setCardType(CardType pCardType)
Definition CardInfo.cpp:40
MobileEidType getMobileEidType() const
Definition CardInfo.cpp:143
QString getCardTypeString() const
Definition CardInfo.cpp:52
bool isPukInoperative() const
The PUK is inoperative.
Definition CardInfo.cpp:107
bool isPinDeactivated() const
The eID function has not been activated by the competent authority.
Definition CardInfo.cpp:101
int getRetryCounter() const
Definition CardInfo.cpp:83
CardType getCardType() const
Definition CardInfo.cpp:46
bool isRetryCounterDetermined() const
Definition CardInfo.cpp:95
Definition ReaderConfigurationInfo.h:21
Definition ReaderInfo.h:18
void insertCard()
Definition ReaderInfo.h:138
void setCardInfo(const CardInfo &pCardInfo)
Definition ReaderInfo.h:144
bool isBasicReader() const
Definition ReaderInfo.h:162
void setMaxApduLength(int pMaxApduLength)
Definition ReaderInfo.h:168
bool wasShelved() const
Definition ReaderInfo.h:122
CardInfo & getCardInfo()
Definition ReaderInfo.h:56
ReaderManagerPluginType getPluginType() const
Definition ReaderInfo.h:37
bool insufficientApduLength() const
Definition ReaderInfo.h:180
const CardInfo & getCardInfo() const
Definition ReaderInfo.h:62
bool isRetryCounterDetermined() const
Definition ReaderInfo.h:98
bool hasEid() const
Definition ReaderInfo.h:86
bool isInsertable() const
Definition ReaderInfo.cpp:50
void shelveCard()
Definition ReaderInfo.h:128
ReaderConfigurationInfo getReaderConfigurationInfo() const
Definition ReaderInfo.cpp:38
CardType getCardType() const
Definition ReaderInfo.h:68
ReaderInfo(const QString &pName=QString(), ReaderManagerPluginType pPluginType=ReaderManagerPluginType::UNKNOWN, const CardInfo &pCardInfo=CardInfo(CardType::NONE))
int getMaxApduLength() const
Definition ReaderInfo.h:174
bool isPinDeactivated() const
Definition ReaderInfo.h:104
bool isValid() const
Definition ReaderInfo.h:43
const QString & getName() const
Definition ReaderInfo.h:150
void invalidate()
Definition ReaderInfo.h:49
int getRetryCounter() const
Definition ReaderInfo.h:92
bool isPukInoperative() const
Definition ReaderInfo.h:110
bool hasCard() const
Definition ReaderInfo.h:80
bool isSoftwareSmartEid() const
Definition ReaderInfo.h:116
QString getCardTypeString() const
Definition ReaderInfo.h:74
void setBasicReader(bool pIsBasicReader)
Definition ReaderInfo.h:156
Definition Reader.h:20
Implementation of GeneralAuthenticate response APDUs.
Definition CommandApdu.h:17
QSharedPointer< T > decodeObject(const QByteArray &pData, bool pLogging=true)
Template function for decoding an OpenSSL type from DER encoded QByteArray.
Definition ASN1TemplateUtil.h:114