AusweisApp2
ChipAuthenticationInfo.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 
10 #include "SecurityInfo.h"
11 
12 
13 namespace governikus
14 {
15 
28 {
29  ASN1_OBJECT* mProtocol;
30  ASN1_INTEGER* mVersion;
31  ASN1_INTEGER* mKeyId;
32 };
33 DECLARE_ASN1_FUNCTIONS(chipauthenticationinfo_st)
34 
35 
36 /*
37  * Wrapper for structure chipauthenticationinfo_st.
38  */
40  : public SecurityInfo
41 {
42  friend class QSharedPointer<ChipAuthenticationInfo>;
43 
44  const QSharedPointer<const chipauthenticationinfo_st> mDelegate;
45 
46  ChipAuthenticationInfo(const QSharedPointer<const chipauthenticationinfo_st>& pDelegate);
47  ASN1_OBJECT* getProtocolObjectIdentifier() const override;
48  static bool acceptsProtocol(const ASN1_OBJECT* pObjectIdentifier);
49 
50  public:
51  static QSharedPointer<ChipAuthenticationInfo> decode(const QByteArray& pBytes)
52  {
53  if (const auto& delegate = decodeObject<chipauthenticationinfo_st>(pBytes, false))
54  {
55  if (ChipAuthenticationInfo::acceptsProtocol(delegate->mProtocol))
56  {
57  return QSharedPointer<ChipAuthenticationInfo>::create(delegate);
58  }
59  }
60  return QSharedPointer<ChipAuthenticationInfo>();
61  }
62 
63 
64  QByteArray getVersion() const;
65  QByteArray getKeyId() const;
66 };
67 
68 
69 template<>
71 
72 
73 template<>
75 
76 
77 } // namespace governikus
governikus::KnownOIDs
Definition: KnownOIDs.h:13
governikus::ChipAuthenticationInfo::decode
static QSharedPointer< ChipAuthenticationInfo > decode(const QByteArray &pBytes)
Definition: ChipAuthenticationInfo.h:51
ChipAuthenticationInfo.h
governikus::SecurityInfo
Definition: SecurityInfo.h:46
KnownOIDs.h
governikus::chipauthenticationinfo_st
Definition: ChipAuthenticationInfo.h:28
governikus::freeAsn1Object< chipauthenticationinfo_st >
void freeAsn1Object< chipauthenticationinfo_st >(chipauthenticationinfo_st *pObject)
ASN1Util.h
governikus::ChipAuthenticationInfo::getVersion
QByteArray getVersion() const
Definition: ChipAuthenticationInfo.cpp:76
governikus::chipauthenticationinfo_st::mKeyId
ASN1_INTEGER * mKeyId
Definition: ChipAuthenticationInfo.h:31
governikus::KnownOIDs::id_ca::DH
@ DH
governikus::decodeAsn1Object< chipauthenticationinfo_st >
chipauthenticationinfo_st * decodeAsn1Object< chipauthenticationinfo_st >(chipauthenticationinfo_st **pObject, const unsigned char **pData, long pDataLen)
governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
governikus::chipauthenticationinfo_st::mProtocol
ASN1_OBJECT * mProtocol
Definition: ChipAuthenticationInfo.h:29
governikus::Asn1IntegerUtil::getValue
static QByteArray getValue(const ASN1_INTEGER *pInteger)
Definition: ASN1Util.cpp:125
SecurityInfo.h
governikus::ChipAuthenticationInfo
Definition: ChipAuthenticationInfo.h:41
governikus::chipauthenticationinfo_st::mVersion
ASN1_INTEGER * mVersion
Definition: ChipAuthenticationInfo.h:30
ASN1TemplateUtil.h
governikus::Asn1ObjectUtil::convertTo
static QByteArray convertTo(const ASN1_OBJECT *pAsn1Object)
Definition: ASN1Util.cpp:24
governikus::ChipAuthenticationInfo::getKeyId
QByteArray getKeyId() const
Definition: ChipAuthenticationInfo.cpp:82