AusweisApp2
StateCheckRefreshAddress.h
gehe zur Dokumentation dieser Datei
1 
8 #pragma once
9 
10 #include "AbstractState.h"
11 #include "context/AuthContext.h"
13 
14 #include <QNetworkReply>
15 #include <QSharedPointer>
16 #include <QSslCertificate>
17 #include <QSslError>
18 #include <QSslSocket>
19 
20 class test_StateCheckRefreshAddress;
21 
22 namespace governikus
23 {
24 
26  : public AbstractState
27  , public GenericContextContainer<AuthContext>
28 {
29  Q_OBJECT
30  friend class StateBuilder;
31  friend class ::test_StateCheckRefreshAddress;
32 
33  private:
34  QSharedPointer<QNetworkReply> mReply;
35  QUrl mUrl;
36  QUrl mSubjectUrl;
37  bool mCertificateFetched;
38  QVector<QUrl> mVerifiedRefreshUrlHosts;
39 
40  explicit StateCheckRefreshAddress(const QSharedPointer<WorkflowContext>& pContext);
41 
42  bool isMatchingSameOriginPolicyInDevMode() const;
43  virtual void run() override;
44 
45  QUrl determineSubjectUrl();
46 
47  void sendGetRequest();
48  void fetchServerCertificate();
49  bool checkSslConnectionAndSaveCertificate(const QSslConfiguration& pSslConfiguration);
50  void doneSuccess();
51  void reportCommunicationError(const GlobalStatus& pStatus);
52 
53  private Q_SLOTS:
54  void onSslHandshakeDone();
55  void onNetworkReply();
56  void onSslErrors(const QList<QSslError>& errors);
57  void onSslHandshakeDoneFetchingServerCertificate();
58  void onNetworkErrorFetchingServerCertificate(QNetworkReply::NetworkError pError);
59 
60  public:
61  void onEntry(QEvent* pEvent) override;
62 };
63 
64 } // namespace governikus
Definition: GlobalStatus.h:19
Definition: AbstractState.h:18
void onEntry(QEvent *pEvent) override
Definition: StateCheckRefreshAddress.cpp:427
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
Definition: GenericContextContainer.h:19
Definition: StateCheckRefreshAddress.h:25
Definition: StateBuilder.h:17