AusweisApp2
ReaderInfo.h
gehe zur Dokumentation dieser Datei
1 
5 #pragma once
6 
7 #include "CardInfo.h"
10 #include "SmartCardDefinitions.h"
11 
12 #include <QString>
13 
14 namespace governikus
15 {
17 {
18  friend class Reader;
19 
20  ReaderManagerPlugInType mPlugInType;
21  QString mName;
22  bool mBasicReader;
23  CardInfo mCardInfo;
24  bool mConnected;
25  int mMaxApduLength;
26 
27  public:
28  ReaderInfo(const QString& pName = QString(),
29  ReaderManagerPlugInType pPlugInType = ReaderManagerPlugInType::UNKNOWN,
30  const CardInfo& pCardInfo = CardInfo(CardType::NONE));
31 
33 
34 
35  ReaderManagerPlugInType getPlugInType() const
36  {
37  return mPlugInType;
38  }
39 
40 
41  const CardInfo& getCardInfo() const
42  {
43  return mCardInfo;
44  }
45 
46 
47  QString getCardTypeString() const
48  {
49  return mCardInfo.getCardTypeString();
50  }
51 
52 
53  bool hasCard() const
54  {
55  return mCardInfo.isAvailable();
56  }
57 
58 
59  bool hasEidCard() const
60  {
61  return mCardInfo.isEid();
62  }
63 
64 
65  bool hasPassport() const
66  {
67  return mCardInfo.isPassport();
68  }
69 
70 
71  int getRetryCounter() const
72  {
73  return mCardInfo.getRetryCounter();
74  }
75 
76 
78  {
79  return mCardInfo.isRetryCounterDetermined();
80  }
81 
82 
83  bool isPinDeactivated() const
84  {
85  return mCardInfo.isPinDeactivated();
86  }
87 
88 
89  bool isPukInoperative() const
90  {
91  return mCardInfo.isPukInoperative();
92  }
93 
94 
95  void setCardInfo(const CardInfo& pCardInfo)
96  {
97  mCardInfo = pCardInfo;
98  }
99 
100 
101  const QString& getName() const
102  {
103  return mName;
104  }
105 
106 
107  void setBasicReader(bool pIsBasicReader)
108  {
109  mBasicReader = pIsBasicReader;
110  }
111 
112 
113  bool isBasicReader() const
114  {
115  return mBasicReader;
116  }
117 
118 
119  bool isConnected() const
120  {
121  return mConnected;
122  }
123 
124 
125  void setConnected(bool pConnected)
126  {
127  mConnected = pConnected;
128  }
129 
130 
131  void setMaxApduLength(int pMaxApduLength)
132  {
133  mMaxApduLength = pMaxApduLength;
134  }
135 
136 
137  int getMaxApduLength() const
138  {
139  return mMaxApduLength;
140  }
141 
142 
143  bool sufficientApduLength() const
144  {
145  if (!hasCard())
146  {
147  return true;
148  }
149  return mMaxApduLength == 0 || mMaxApduLength >= 500;
150  }
151 
152 
153 };
154 
155 } // namespace governikus
Holds smart card informations.
Definition: CardInfo.h:28
bool isPassport() const
Definition: CardInfo.cpp:76
QString getCardTypeString() const
Definition: CardInfo.cpp:38
bool isPukInoperative() const
The PUK is inoperative.
Definition: CardInfo.cpp:106
bool isEid() const
Definition: CardInfo.cpp:70
bool isPinDeactivated() const
The online identification function has not been activated by the competent authority.
Definition: CardInfo.cpp:100
int getRetryCounter() const
Definition: CardInfo.cpp:88
bool isRetryCounterDetermined() const
Definition: CardInfo.cpp:94
bool isAvailable() const
Definition: CardInfo.cpp:64
Definition: ReaderConfigurationInfo.h:19
Definition: ReaderInfo.h:17
void setCardInfo(const CardInfo &pCardInfo)
Definition: ReaderInfo.h:95
bool isBasicReader() const
Definition: ReaderInfo.h:113
ReaderManagerPlugInType getPlugInType() const
Definition: ReaderInfo.h:35
void setMaxApduLength(int pMaxApduLength)
Definition: ReaderInfo.h:131
bool isConnected() const
Definition: ReaderInfo.h:119
bool sufficientApduLength() const
Definition: ReaderInfo.h:143
bool isRetryCounterDetermined() const
Definition: ReaderInfo.h:77
ReaderConfigurationInfo getReaderConfigurationInfo() const
Definition: ReaderInfo.cpp:29
int getMaxApduLength() const
Definition: ReaderInfo.h:137
bool isPinDeactivated() const
Definition: ReaderInfo.h:83
bool hasPassport() const
Definition: ReaderInfo.h:65
int getRetryCounter() const
Definition: ReaderInfo.h:71
bool isPukInoperative() const
Definition: ReaderInfo.h:89
const CardInfo & getCardInfo() const
Definition: ReaderInfo.h:41
bool hasCard() const
Definition: ReaderInfo.h:53
const QString & getName() const
Definition: ReaderInfo.h:101
ReaderInfo(const QString &pName=QString(), ReaderManagerPlugInType pPlugInType=ReaderManagerPlugInType::UNKNOWN, const CardInfo &pCardInfo=CardInfo(CardType::NONE))
Definition: ReaderInfo.cpp:16
QString getCardTypeString() const
Definition: ReaderInfo.h:47
void setBasicReader(bool pIsBasicReader)
Definition: ReaderInfo.h:107
bool hasEidCard() const
Definition: ReaderInfo.h:59
void setConnected(bool pConnected)
Definition: ReaderInfo.h:125
Definition: Reader.h:19
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
UNKNOWN
Definition: SmartCardDefinitions.h:18