AusweisApp
 
Lade ...
Suche ...
Keine Treffer
ChipAuthenticationInfo.h
gehe zur Dokumentation dieser Datei
1
4
5#pragma once
6
7
8#include "SecurityInfo.h"
9
10
11namespace governikus
12{
13
26{
27 ASN1_OBJECT* mProtocol;
28 ASN1_INTEGER* mVersion;
29 ASN1_INTEGER* mKeyId;
30};
31DECLARE_ASN1_FUNCTIONS(chipauthenticationinfo_st)
33
34
35/*
36 * Wrapper for structure chipauthenticationinfo_st.
37 */
38class ChipAuthenticationInfo
39 : public SecurityInfo
40{
41 friend class QSharedPointer<const ChipAuthenticationInfo>;
42
43 private:
44 const QSharedPointer<const chipauthenticationinfo_st> mDelegate;
45
46 explicit ChipAuthenticationInfo(const QSharedPointer<const chipauthenticationinfo_st>& pDelegate);
47 [[nodiscard]] ASN1_OBJECT* getProtocolObjectIdentifier() const override;
48 static bool acceptsProtocol(const ASN1_OBJECT* pObjectIdentifier);
49
50 public:
51 static QSharedPointer<const ChipAuthenticationInfo> decode(const QByteArray& pBytes);
52 [[nodiscard]] QByteArray encode() const;
53
54 [[nodiscard]] int getVersion() const;
55 [[nodiscard]] bool hasKeyId() const;
56 [[nodiscard]] int getKeyId() const;
57};
58
59
60inline QDebug operator<<(QDebug pDbg, const QSharedPointer<const ChipAuthenticationInfo>& pChipAuthenticationInfo)
61{
62 QDebugStateSaver saver(pDbg);
63 if (pChipAuthenticationInfo->hasKeyId())
64 {
65 pDbg.nospace().noquote() << pChipAuthenticationInfo->getOid()
66 << ", version: " << pChipAuthenticationInfo->getVersion()
67 << ", keyId: " << pChipAuthenticationInfo->getKeyId();
68 }
69 else
70 {
71 pDbg.nospace().noquote() << pChipAuthenticationInfo->getOid()
72 << ", version: " << pChipAuthenticationInfo->getVersion();
73 }
74 return pDbg;
75}
76
77
78} // namespace governikus
#define DECLARE_ASN1_OBJECT(name)
Definition ASN1TemplateUtil.h:175
QByteArray encode() const
Definition ChipAuthenticationInfo.cpp:73
bool hasKeyId() const
Definition ChipAuthenticationInfo.cpp:85
static QSharedPointer< const ChipAuthenticationInfo > decode(const QByteArray &pBytes)
Definition ChipAuthenticationInfo.cpp:58
int getKeyId() const
Definition ChipAuthenticationInfo.cpp:91
int getVersion() const
Definition ChipAuthenticationInfo.cpp:79
Defines the AccessRight and AccessRole enum.
Definition CommandApdu.h:17
QDebug operator<<(QDebug pDbg, const CommandApdu &pCommandApdu)
Definition CommandApdu.h:96
Definition ChipAuthenticationInfo.h:26
ASN1_OBJECT * mProtocol
Definition ChipAuthenticationInfo.h:27
ASN1_INTEGER * mKeyId
Definition ChipAuthenticationInfo.h:29
ASN1_INTEGER * mVersion
Definition ChipAuthenticationInfo.h:28