AusweisApp
Lade ...
Suche ...
Keine Treffer
SecurityProtocol.h
gehe zur Dokumentation dieser Datei
1
5#pragma once
6
7#include "EnumHelper.h"
8#include "asn1/Oid.h"
9
10#include <QByteArray>
11#include <QCryptographicHash>
12#include <QMap>
13#include <openssl/evp.h>
14
15#include <optional>
16
17
18namespace governikus
19{
20
26
28{
29 private:
37
38 const Oid mOid;
39
40 ProtocolType mProtocol;
41 KeyAgreementType mKeyAgreement;
42 MappingType mMapping;
43 CipherType mCipher;
44 SignatureType mSignature;
45 std::optional<QCryptographicHash::Algorithm> mHashAlgorithm;
46
47 void logCritical(const QLatin1String& pTopic) const;
48
49 public:
50 explicit SecurityProtocol(const Oid& pOid);
51
52 [[nodiscard]] const Oid& getOid() const;
53 [[nodiscard]] ProtocolType getProtocol() const;
56 [[nodiscard]] const EVP_CIPHER* getCipher() const;
57 [[nodiscard]] const char* getCipherString() const;
58 [[nodiscard]] int getKeySize() const;
59 [[nodiscard]] SignatureType getSignature() const;
60 [[nodiscard]] QCryptographicHash::Algorithm getHashAlgorithm() const;
61
62 bool operator==(const SecurityProtocol& pOther) const;
63};
64
65
67{
69 pDbg.nospace() << QByteArray(pProtocol.getOid());
70 return pDbg.space();
71}
72
73
74} // namespace governikus
#define defineEnumType(enumName,...)
Definition EnumHelper.h:85
Implementation of GeneralAuthenticate response APDUs.
Definition CommandApdu.h:17
UNDEFINED
Definition SecurityProtocol.h:22
ECDH AES_128_CBC
Definition SecurityProtocol.h:24
ECDH DES3_CBC
Definition SecurityProtocol.h:24
DH
Definition SecurityProtocol.h:22
ECDH AES_192_CBC
Definition SecurityProtocol.h:24
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
bool operator==(const CommandApdu &pLeft, const CommandApdu &pRight)
Definition CommandApdu.h:105