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
37
38
39/*
40 * Wrapper for structure chipauthenticationinfo_st.
41 */
44{
46
47 private:
49
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{
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:177
Definition ChipAuthenticationInfo.h:44
Definition SecurityInfo.h:46
Implementation of GeneralAuthenticate response APDUs.
Definition CommandApdu.h:17
QSharedPointer< T > decodeObject(const QByteArray &pData, bool pLogging=true)
Template function for decoding an OpenSSL type from DER encoded QByteArray.
Definition ASN1TemplateUtil.h:114
QDebug operator<<(QDebug pDbg, const CommandApdu &pCommandApdu)
Definition CommandApdu.h:96
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