AusweisApp
Lade ...
Suche ...
Keine Treffer
SecurityInfo.h
gehe zur Dokumentation dieser Datei
1
9#pragma once
10
11#include "ASN1TemplateUtil.h"
12#include "SecurityProtocol.h"
13
14#include <QSharedPointer>
15#include <openssl/asn1.h>
16
17
18namespace governikus
19{
20
36
40
41/*
42 * Because OpenSSL's template macro system does not support inheritance,
43 * we wrap the securityinfo_st in class SecurityInfo and use this for inheritance.
44 */
46{
48 friend class QSharedPointer<const SecurityInfo>;
49
50 private:
52
54
55 /*
56 * Sub classes must override this method to allow the base class to access
57 * the protocol's ASN1_OBJECT pointer.
58 */
59 [[nodiscard]] virtual ASN1_OBJECT* getProtocolObjectIdentifier() const;
60
61 protected:
63
64 public:
65 static QSharedPointer<const SecurityInfo> decode(const QByteArray& pBytes);
66
67 virtual ~SecurityInfo() = default;
68
72 [[nodiscard]] Oid getOid() const;
73
77 [[nodiscard]] SecurityProtocol getProtocol() const;
78};
79
80
81inline QDebug operator<<(QDebug pDbg, const QSharedPointer<const SecurityInfo>& pSecurityInfo)
82{
84 pDbg.nospace().noquote() << pSecurityInfo->getOid();
85 return pDbg;
86}
87
88
89} // namespace governikus
#define DECLARE_ASN1_OBJECT(name)
Definition ASN1TemplateUtil.h:177
Definition SecurityInfo.h:46
virtual ~SecurityInfo()=default
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 SecurityInfo.h:31
ASN1_TYPE * mOptionalData
Definition SecurityInfo.h:34
ASN1_OBJECT * mProtocol
Definition SecurityInfo.h:32
ASN1_TYPE * mRequiredData
Definition SecurityInfo.h:33