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