AusweisApp
Lade ...
Suche ...
Keine Treffer
IfdCard.h
gehe zur Dokumentation dieser Datei
1
9#pragma once
10
11#include "Card.h"
12#include "IfdDispatcherClient.h"
13#include "messages/IfdMessage.h"
14
15#include <QMutex>
16#include <QSharedPointer>
17#include <QString>
18#include <QWaitCondition>
19
20
21namespace governikus
22{
23
25 : public Card
26{
27 Q_OBJECT
28
29 private:
30 bool mWaitingForAnswer;
31 QWaitCondition mWaitCondition;
32 QMutex mResponseAvailable;
33 QMutex mProcessResponse;
34
35 IfdMessageType mExpectedAnswerType;
36 QJsonObject mResponse;
37 const QSharedPointer<IfdDispatcherClient> mDispatcher;
38 QString mReaderName;
39 QString mSlotHandle;
40 bool mConnected;
41 QString mProgressMessage;
42
43 bool sendMessage(const QSharedPointer<const IfdMessage>& pMessage, IfdMessageType pExpectedAnswer, unsigned long pTimeout);
44
45 private Q_SLOTS:
46 void onMessageReceived(IfdMessageType pMessageTpe, const QJsonObject& pJsonObject);
47 void onDispatcherClosed(GlobalStatus::Code pCloseCode, const QString& pId);
48
49 Q_SIGNALS:
51
52 public:
53 IfdCard(const QSharedPointer<IfdDispatcherClient>& pDispatcher, const QString& pReaderName);
54 ~IfdCard() override;
55
56 CardReturnCode establishConnection() override;
57 CardReturnCode releaseConnection() override;
58 bool isConnected() const override;
59 void setProgressMessage(const QString& pMessage, int pProgress = -1) override;
60
61 ResponseApduResult transmit(const CommandApdu& pCmd) override;
62
63 EstablishPaceChannelOutput establishPaceChannel(PacePasswordId pPasswordId, int pPreferredPinLength, const QByteArray& pChat, const QByteArray& pCertificateDescription, quint8 pTimeoutSeconds = 60) override;
64
65 ResponseApduResult setEidPin(quint8 pTimeoutSeconds) override;
66};
67
68} // namespace governikus
Definition Card.h:47
Definition EstablishPaceChannelOutput.h:48
Code
Definition GlobalStatus.h:28
Definition IfdCard.h:26
EstablishPaceChannelOutput establishPaceChannel(PacePasswordId pPasswordId, int pPreferredPinLength, const QByteArray &pChat, const QByteArray &pCertificateDescription, quint8 pTimeoutSeconds=60) override
Establishes a PACE channel, i.e.
Definition IfdCard.cpp:210
ResponseApduResult setEidPin(quint8 pTimeoutSeconds) override
Sets a new eID PIN, i.e.
Definition IfdCard.cpp:245
ResponseApduResult transmit(const CommandApdu &pCmd) override
Performs a transmit to the smart card.
Definition IfdCard.cpp:183
bool isConnected() const override
Is the smart card connected, i.e.
Definition IfdCard.cpp:171
void setProgressMessage(const QString &pMessage, int pProgress=-1) override
Sets the current workflow progress message.
Definition IfdCard.cpp:177
CardReturnCode establishConnection() override
Establish a connection to the smart card.
Definition IfdCard.cpp:124
~IfdCard() override
Definition IfdCard.cpp:118
CardReturnCode releaseConnection() override
Destroys the previously established connection to the smart card.
Definition IfdCard.cpp:148
Implementation of GeneralAuthenticate response APDUs.
Definition CommandApdu.h:16
quint8
Definition ResponseApdu.h:62
Definition ResponseApdu.h:115