AusweisApp2
KeyDerivationFunction.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include <QByteArray>
10 #include <QCryptographicHash>
11 
12 namespace governikus
13 {
14 
16 {
17  private:
18  QCryptographicHash::Algorithm mHashAlgorithm;
19  int mKeySize;
20  [[nodiscard]] QByteArray deriveKey(const QByteArray& pK, const QByteArray& pNonce, quint32 pC) const;
21 
22  public:
28  explicit KeyDerivationFunction(const QByteArray& pPaceAlgorithm);
30 
34  [[nodiscard]] bool isInitialized() const;
35 
41  QByteArray enc(const QByteArray& pSecret);
42 
48  QByteArray mac(const QByteArray& pSecret);
49 
55  QByteArray pi(const QByteArray& pSecret);
56 
57 };
58 
59 } // namespace governikus
KnownOIDs.h
governikus::KeyDerivationFunction
Definition: KeyDerivationFunction.h:16
governikus::KnownOIDs::id_PACE::DH::GM
@ GM
KeyDerivationFunction.h
governikus::KeyDerivationFunction::~KeyDerivationFunction
~KeyDerivationFunction()=default
governikus::KeyDerivationFunction::enc
QByteArray enc(const QByteArray &pSecret)
Derive the encryption key.
Definition: KeyDerivationFunction.cpp:60
governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
governikus::KeyDerivationFunction::KeyDerivationFunction
KeyDerivationFunction(const QByteArray &pPaceAlgorithm)
Creates a new instance with derivation function algorithm determined by parameter.
Definition: KeyDerivationFunction.cpp:18
governikus::KeyDerivationFunction::pi
QByteArray pi(const QByteArray &pSecret)
Derive the password key.
Definition: KeyDerivationFunction.cpp:72
governikus::KeyDerivationFunction::isInitialized
bool isInitialized() const
Returns true, if initialization succeeded, i.e.
Definition: KeyDerivationFunction.cpp:54
governikus::KnownOIDs::id_PACE::ECDH::GM
@ GM
governikus::KeyDerivationFunction::mac
QByteArray mac(const QByteArray &pSecret)
Derive the MAC key.
Definition: KeyDerivationFunction.cpp:66