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<>
70 chipauthenticationinfo_st* decodeAsn1Object<chipauthenticationinfo_st>(chipauthenticationinfo_st** pObject, const unsigned char** pData, long pDataLen);
71 
72 
73 template<>
74 void freeAsn1Object<chipauthenticationinfo_st>(chipauthenticationinfo_st* pObject);
75 
76 
77 } // namespace governikus
Definition: ChipAuthenticationInfo.h:27
Definition: SecurityInfo.h:45
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
static QSharedPointer< ChipAuthenticationInfo > decode(const QByteArray &pBytes)
Definition: ChipAuthenticationInfo.h:51
ASN1_INTEGER * mKeyId
Definition: ChipAuthenticationInfo.h:31
void freeAsn1Object< chipauthenticationinfo_st >(chipauthenticationinfo_st *pObject)
ASN1_OBJECT * mProtocol
Definition: ChipAuthenticationInfo.h:29
chipauthenticationinfo_st * decodeAsn1Object< chipauthenticationinfo_st >(chipauthenticationinfo_st **pObject, const unsigned char **pData, long pDataLen)
ASN1_INTEGER * mVersion
Definition: ChipAuthenticationInfo.h:30
Definition: ChipAuthenticationInfo.h:39