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);
29  ~KeyDerivationFunction() = default;
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
QByteArray mac(const QByteArray &pSecret)
Derive the MAC key.
Definition: KeyDerivationFunction.cpp:66
Definition: KeyDerivationFunction.h:15
QByteArray enc(const QByteArray &pSecret)
Derive the encryption key.
Definition: KeyDerivationFunction.cpp:60
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
KeyDerivationFunction(const QByteArray &pPaceAlgorithm)
Creates a new instance with derivation function algorithm determined by parameter.
Definition: KeyDerivationFunction.cpp:18
bool isInitialized() const
Returns true, if initialization succeeded, i.e.
Definition: KeyDerivationFunction.cpp:54
QByteArray pi(const QByteArray &pSecret)
Derive the password key.
Definition: KeyDerivationFunction.cpp:72