AusweisApp
Lade ...
Suche ...
Keine Treffer
SelfAuthenticationData.h
gehe zur Dokumentation dieser Datei
1
5#pragma once
6
7#include "EnumHelper.h"
8
9#include <functional>
10
11#include <QCoreApplication>
12#include <QDateTime>
13#include <QJsonObject>
14#include <QJsonValue>
15#include <QList>
16#include <QMap>
17#include <QPair>
18#include <QSharedData>
19#include <QString>
20
21namespace governikus
22{
23
25 UNKNOWN /* used for parser only */,
26 ALLOWED,
29
31 UNKNOWN, /* used for parser only */
48 /* additional fields */
54
55
57{
58 public:
59 using OrderedSelfData = QList<QPair<QString, QString>>;
60
61 private:
62 class SelfData
63 : public QSharedData
64 {
65 Q_DECLARE_TR_FUNCTIONS(governikus::SelfData)
66
67 private:
68 bool parse(const QByteArray& pData);
69 bool parseOperationsAllowedByUser(const QJsonObject& pObject);
70 bool parsePersonalData(const QJsonObject& pObject);
71 void parseStructuredPlace(const QJsonObject& pObjectm, SelfAuthDataPermission pPermission);
72 bool tryToInsertChild(const QJsonValue& pValue, SelfAuthData pAuthData);
73 void add(OrderedSelfData& pSelfData, const QString& pGroupName, const QString& pGroupValue) const;
74 void addAddress(OrderedSelfData& pSelfData) const;
75 static QString formatDate(const QString& pDate);
76
77 public:
78 bool mValid;
79 const QDateTime mDateTime;
80 QMap<SelfAuthData, SelfAuthDataPermission> mOperationsAllowed;
81 QMap<SelfAuthData, QString> mSelfAuthData;
82
83 explicit SelfData(const QByteArray& pData);
84 QString getValue(SelfAuthData pData) const;
85 OrderedSelfData getOrderedSelfInfo() const;
86 };
87
89
90 public:
93
97 [[nodiscard]] bool isValid() const;
98 [[nodiscard]] QString getValue(SelfAuthData pData) const;
99 [[nodiscard]] const QDateTime& getDateTime() const;
100 [[nodiscard]] OrderedSelfData getOrderedSelfData() const;
101};
102
103} // namespace governikus
#define defineEnumType(enumName,...)
Definition EnumHelper.h:81
Definition SelfAuthenticationData.h:57
QList< QPair< QString, QString > > OrderedSelfData
Definition SelfAuthenticationData.h:59
Defines the AccessRight and AccessRole enum.
Definition CommandApdu.h:17
UNKNOWN
Definition ResponseApdu.h:66
DateOfExpiry
Definition SelfAuthenticationData.h:34
RestrictedID
Definition SelfAuthenticationData.h:45
BirthName
Definition AccessRoleAndRight.h:78
GivenNames
Definition AccessRoleAndRight.h:85
IssuingState
Definition SelfAuthenticationData.h:33
PlaceOfResidenceCity
Definition SelfAuthenticationData.h:50
PlaceOfResidence
Definition SelfAuthenticationData.h:42
PlaceOfResidenceCountry
Definition SelfAuthenticationData.h:51
PlaceOfResidenceStreet
Definition SelfAuthenticationData.h:49
DateOfBirth
Definition AccessRoleAndRight.h:81
FamilyNames
Definition SelfAuthenticationData.h:36
ResidencePermitI
Definition AccessRoleAndRight.h:75
AcademicTitle
Definition SelfAuthenticationData.h:38
Nationality
Definition AccessRoleAndRight.h:79
PlaceOfResidenceZipCode
Definition SelfAuthenticationData.h:52
PlaceVerification
Definition SelfAuthenticationData.h:47
DocumentType
Definition AccessRoleAndRight.h:88
QSharedPointer< T > decodeObject(const QByteArray &pData, bool pLogging=true)
Template function for decoding an OpenSSL type from DER encoded QByteArray.
Definition ASN1TemplateUtil.h:112
ArtisticName
Definition AccessRoleAndRight.h:83
AgeVerification
Definition AccessRoleAndRight.h:92
PlaceOfBirth
Definition AccessRoleAndRight.h:80