35 #include <QSharedPointer>
36 #include <QSslCertificate>
39 class test_StateRedirectBrowser;
40 class test_StatePreVerification;
41 class test_StateProcessCertificatesFromEac2;
42 class test_StateCertificateDescriptionCheck;
53 friend class ::test_StatePrepareChat;
54 friend class ::test_StateRedirectBrowser;
55 friend class ::test_StatePreVerification;
56 friend class ::test_StateProcessCertificatesFromEac2;
57 friend class ::test_StateCertificateDescriptionCheck;
59 bool mTcTokenNotFound;
60 bool mErrorReportedToServer;
62 QSharedPointer<ActivationContext> mActivationContext;
64 QSharedPointer<TcToken> mTcToken;
66 QSharedPointer<MessageIdHandler> mMessageIdHandler;
67 QSharedPointer<StartPaos> mStartPaos;
68 QSharedPointer<InitializeFramework> mInitializeFramework;
69 QSharedPointer<InitializeFrameworkResponse> mInitializeFrameworkResponse;
70 QSharedPointer<DIDList> mDIDList;
71 QSharedPointer<DIDListResponse> mDIDListResponse;
72 QSharedPointer<DIDAuthenticateEAC1> mDIDAuthenticateEAC1;
73 QSharedPointer<DIDAuthenticateResponseEAC1> mDIDAuthenticateResponseEAC1;
74 QSharedPointer<DIDAuthenticateEAC2> mDIDAuthenticateEAC2;
75 QSharedPointer<DIDAuthenticateResponseEAC2> mDIDAuthenticateResponseEACAdditionalInputType;
76 QSharedPointer<DIDAuthenticateEACAdditional> mDIDAuthenticateEACAdditionalInputType;
77 QSharedPointer<DIDAuthenticateResponseEAC2> mDIDAuthenticateResponseEAC2;
78 QVector<QSharedPointer<Transmit> > mTransmits;
79 QVector<QSharedPointer<TransmitResponse> > mTransmitResponses;
80 bool mTransmitResponseFailed;
81 QSharedPointer<Disconnect> mDisconnect;
82 QSharedPointer<DisconnectResponse> mDisconnectResponse;
83 QSharedPointer<StartPaosResponse> mStartPaosResponse;
84 QSet<AccessRight> mEffectiveAccessRights;
85 QSet<AccessRight> mRequiredAccessRights;
86 QSet<AccessRight> mOptionalAccessRights;
87 QMultiMap<QUrl, QSslCertificate> mCertificates;
88 QSharedPointer<const CVCertificate> mTerminalCvc, mDvCvc;
90 QByteArray mSslSession;
92 void initializeChat();
93 bool removeForbiddenAccessRights(QSet<AccessRight>& pSet);
101 AuthContext(
const QSharedPointer<ActivationContext>& pActivationContext);
107 return mErrorReportedToServer;
113 mErrorReportedToServer = pErrorReportedToServer;
119 return mTcTokenNotFound;
125 mTcTokenNotFound = pTcTokenNotFound;
131 return mCertificates.values();
144 qDebug() <<
"Adding certificate CN=" << pCert.subjectInfo(QSslCertificate::CommonName) <<
"SN=" << pCert.serialNumber() <<
"for URL origin" << originUrl;
145 mCertificates.insertMulti(originUrl, pCert);
151 return mActivationContext.data();
163 mTcTokenUrl = pTcTokenUrl;
181 return mMessageIdHandler;
193 mRefreshUrl = pRefreshUrl;
199 return mDIDAuthenticateEAC1;
205 mDIDAuthenticateEAC1 = pDIDAuthenticateEAC1;
212 return mDIDAuthenticateEAC2;
218 mDIDAuthenticateEAC2 = pDidAuthenticateEac2;
224 return mDIDAuthenticateResponseEAC1;
230 mDIDAuthenticateResponseEAC1 = pDidAuthenticateResponseEac1;
236 return mDIDAuthenticateResponseEACAdditionalInputType;
242 mDIDAuthenticateResponseEACAdditionalInputType = pDidAuthenticateResponseEacAdditionalInputType;
248 return mDIDAuthenticateEACAdditionalInputType;
254 mDIDAuthenticateEACAdditionalInputType = pDidAuthenticateEacAdditionalInputType;
260 return mDIDAuthenticateResponseEAC2;
266 mDIDAuthenticateResponseEAC2 = pDidAuthenticateResponseEac2;
284 return mDIDListResponse;
290 mDIDListResponse = pDidListResponse;
296 return mInitializeFramework;
302 mInitializeFramework = pInitializeFramework;
308 return mInitializeFrameworkResponse;
314 mInitializeFrameworkResponse = pInitializeFrameworkResponse;
326 mDisconnect = pDisconnect;
332 return mDisconnectResponse;
338 mDisconnectResponse = pDisconnectResponse;
344 return mStartPaosResponse;
350 mStartPaosResponse = pStartPaosResponse;
356 return mTransmitResponses;
362 Q_ASSERT(!pTransmitResponse.isNull());
363 mTransmitResponses += pTransmitResponse;
369 return mTransmitResponseFailed;
375 mTransmitResponseFailed = pFailed;
387 Q_ASSERT(!pTransmit.isNull());
388 mTransmits += pTransmit;
396 return mOptionalAccessRights;
402 return mRequiredAccessRights;
408 return mEffectiveAccessRights;
442 mStartPaos = pStartPaos;
455 void initCvcChainBuilder(
const QVector<QSharedPointer<const CVCertificate> >& pAdditionalCertificates = QVector<QSharedPointer<const CVCertificate> >());
458 const QSharedPointer<const CVCertificate>&
getDvCvc()
const
464 void setDvCvc(
const QSharedPointer<const CVCertificate>& dvCvc)
476 void setTerminalCvc(
const QSharedPointer<const CVCertificate>& pTerminalCvc);
const QSharedPointer< DisconnectResponse > & getDisconnectResponse()
Definition: AuthContext.h:330
void setDidList(const QSharedPointer< DIDList > &pDidList)
Definition: AuthContext.h:276
Definition: AuthContext.h:47
bool hasChainForCertificationAuthority(const EstablishPACEChannelOutput &pPaceOutput) const
Definition: AuthContext.cpp:266
const QSharedPointer< const CVCertificate > & getDvCvc() const
Definition: AuthContext.h:458
const QUrl & getRefreshUrl() const
Definition: AuthContext.h:185
const QSharedPointer< const CVCertificate > & getTerminalCvc() const
Definition: AuthContext.h:470
void setStartPaos(const QSharedPointer< StartPaos > &pStartPaos)
Definition: AuthContext.h:440
QString getRequiredAge() const
Definition: AuthContext.cpp:299
const QVector< QSharedPointer< Transmit > > & getTransmits()
Definition: AuthContext.h:379
void setDisconnectResponse(const QSharedPointer< DisconnectResponse > &pDisconnectResponse)
Definition: AuthContext.h:336
Definition: CVCertificateChainBuilder.h:19
bool addEffectiveAccessRight(AccessRight pAccessRight)
Definition: AuthContext.cpp:151
const QSharedPointer< DIDAuthenticateEAC2 > & getDidAuthenticateEac2() const
Definition: AuthContext.h:210
void addTransmit(const QSharedPointer< Transmit > &pTransmit)
Definition: AuthContext.h:385
const QSharedPointer< DIDListResponse > & getDidListResponse()
Definition: AuthContext.h:282
void setDidAuthenticateEac2(const QSharedPointer< DIDAuthenticateEAC2 > &pDidAuthenticateEac2)
Definition: AuthContext.h:216
const QSharedPointer< DIDAuthenticateEAC1 > & getDidAuthenticateEac1() const
Definition: AuthContext.h:197
const QSharedPointer< Disconnect > & getDisconnect() const
Definition: AuthContext.h:318
bool containsCertificateFor(const QUrl &pUrl) const
Definition: AuthContext.h:135
QList< QSslCertificate > getCertificateList() const
Definition: AuthContext.h:129
const QSet< AccessRight > & getOptionalAccessRights() const
Definition: AuthContext.h:394
void fireAuthenticationDataChanged()
AuthContext(const QSharedPointer< ActivationContext > &pActivationContext)
Definition: AuthContext.cpp:17
void setDvCvc(const QSharedPointer< const CVCertificate > &dvCvc)
Definition: AuthContext.h:464
const QSharedPointer< InitializeFramework > & getInitializeFramework() const
Definition: AuthContext.h:294
void setInitializeFrameworkResponse(const QSharedPointer< InitializeFrameworkResponse > &pInitializeFrameworkResponse)
Definition: AuthContext.h:312
const QSharedPointer< InitializeFrameworkResponse > & getInitializeFrameworkResponse() const
Definition: AuthContext.h:306
void setTcTokenUrl(const QUrl &pTcTokenUrl)
Definition: AuthContext.h:161
void setStartPaosResponse(const QSharedPointer< StartPaosResponse > &pStartPaosResponse)
Definition: AuthContext.h:348
Definition: CVCertificateChain.h:21
void setRefreshUrl(const QUrl &pRefreshUrl)
Definition: AuthContext.h:191
void addCertificateData(const QUrl &pUrl, const QSslCertificate &pCert)
Definition: AuthContext.h:141
static QUrl getUrlOrigin(const QUrl &pUrl)
Determines the URL origin, i.e.
Definition: UrlUtil.cpp:19
bool getTransmitResponseFailed() const
Definition: AuthContext.h:367
void setSslSession(const QByteArray &pSession)
Definition: AuthContext.cpp:229
CVCertificateChain getChainStartingWith(const QSharedPointer< const CVCertificate > &pChainRoot) const
Definition: AuthContext.cpp:254
void setDidAuthenticateResponseEacAdditionalInputType(const QSharedPointer< DIDAuthenticateResponseEAC2 > &pDidAuthenticateResponseEacAdditionalInputType)
Definition: AuthContext.h:240
void fireDidAuthenticateEac1Changed()
const QUrl & getTcTokenUrl() const
Definition: AuthContext.h:155
void setDidAuthenticateEac1(const QSharedPointer< DIDAuthenticateEAC1 > &pDIDAuthenticateEAC1)
Definition: AuthContext.h:203
Definition: WorkflowContext.h:19
void setDidListResponse(const QSharedPointer< DIDListResponse > &pDidListResponse)
Definition: AuthContext.h:288
void setErrorReportedToServer(bool pErrorReportedToServer)
Definition: AuthContext.h:111
bool isErrorReportedToServer() const
Definition: AuthContext.h:105
const QSet< AccessRight > & getRequiredAccessRights() const
Definition: AuthContext.h:400
void setTerminalCvc(const QSharedPointer< const CVCertificate > &pTerminalCvc)
Definition: AuthContext.cpp:210
const QSharedPointer< DIDAuthenticateEACAdditional > & getDidAuthenticateEacAdditional() const
Definition: AuthContext.h:246
bool removeEffectiveAccessRight(AccessRight pAccessRight)
Definition: AuthContext.cpp:169
void setDidAuthenticateResponseEac2(const QSharedPointer< DIDAuthenticateResponseEAC2 > &pDidAuthenticateResponseEac2)
Definition: AuthContext.h:264
Definition: EstablishPACEChannel.h:98
void setDidAuthenticateResponseEac1(const QSharedPointer< DIDAuthenticateResponseEAC1 > &pDidAuthenticateResponseEac1)
Definition: AuthContext.h:228
QByteArray encodeEffectiveChat()
Definition: AuthContext.cpp:235
const QVector< QSharedPointer< TransmitResponse > > & getTransmitResponses()
Definition: AuthContext.h:354
const QSharedPointer< TcToken > & getTcToken() const
Definition: AuthContext.h:167
ActivationContext * getActivationContext() const
Definition: AuthContext.h:149
void setInitializeFramework(const QSharedPointer< InitializeFramework > &pInitializeFramework)
Definition: AuthContext.h:300
const QSharedPointer< DIDAuthenticateResponseEAC2 > & getDidAuthenticateResponseEacAdditionalInputType() const
Definition: AuthContext.h:234
const QSharedPointer< DIDAuthenticateResponseEAC2 > & getDidAuthenticateResponseEac2() const
Definition: AuthContext.h:258
void setTcToken(const QSharedPointer< TcToken > &pTcToken)
Definition: AuthContext.h:173
const QSharedPointer< DIDList > & getDidList() const
Definition: AuthContext.h:270
const QByteArray & getSslSession() const
Definition: AuthContext.cpp:223
const QSharedPointer< MessageIdHandler > & getMessageIdHandler() const
Definition: AuthContext.h:179
const QSet< AccessRight > getEffectiveAccessRights() const
Definition: AuthContext.h:406
void setDisconnect(const QSharedPointer< Disconnect > &pDisconnect)
Definition: AuthContext.h:324
const QSharedPointer< DIDAuthenticateResponseEAC1 > & getDidAuthenticateResponseEac1() const
Definition: AuthContext.h:222
const QSharedPointer< StartPaosResponse > & getStartPaosResponse() const
Definition: AuthContext.h:342
void setTransmitResponseFailed(bool pFailed)
Definition: AuthContext.h:373
virtual ~AuthContext()
Definition: AuthContext.cpp:55
void setTcTokenNotFound(bool pTcTokenNotFound)
Definition: AuthContext.h:123
void fireEffectiveChatChanged()
bool isTcTokenNotFound() const
Definition: AuthContext.h:117
void addTransmitResponse(const QSharedPointer< TransmitResponse > &pTransmitResponse)
Definition: AuthContext.h:360
CVCertificateChain getChainForCertificationAuthority(const EstablishPACEChannelOutput &pPaceOutput) const
Definition: AuthContext.cpp:272
void initCvcChainBuilder(const QVector< QSharedPointer< const CVCertificate > > &pAdditionalCertificates=QVector< QSharedPointer< const CVCertificate > >())
Definition: AuthContext.cpp:284
Definition: ActivationContext.h:18
const QSharedPointer< StartPaos > & getStartPaos() const
Definition: AuthContext.h:434
void setDidAuthenticateEacAdditional(const QSharedPointer< DIDAuthenticateEACAdditional > &pDidAuthenticateEacAdditionalInputType)
Definition: AuthContext.h:252
bool setEffectiveAccessRights(const QSet< AccessRight > &pAccessRights)
Definition: AuthContext.cpp:186