BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
CryptoConfig.h
1 #pragma once
2 
3 #include <string>
4 
5 #include <Poco/Crypto/CipherKey.h>
6 
7 #include "util/Loggable.h"
8 
9 namespace BeeeOn {
10 
11 class CryptoParams;
12 
13 class CryptoConfig : public Loggable {
14 public:
15  static const std::string DEFAULT_ALGORITHM;
16 
23  CryptoConfig();
24 
25  void setAlgorithm(const std::string &name);
26  void setPassphrase(const std::string &passphrase);
27  void setIterationCount(const int count);
28 
33  Poco::Crypto::CipherKey createKey(const CryptoParams &params) const;
34 
39  CryptoParams deriveParams(const std::string &salt = "") const;
40 
41 private:
42  std::string m_algorithm;
43  std::string m_passphrase;
44  int m_iterationCount;
45 };
46 
47 }
Definition: CryptoConfig.h:13
CryptoParams deriveParams(const std::string &salt="") const
Definition: CryptoConfig.cpp:73
Definition: CryptoParams.h:7
CryptoConfig()
Definition: CryptoConfig.cpp:21
Poco::Crypto::CipherKey createKey(const CryptoParams &params) const
Definition: CryptoConfig.cpp:59
Definition: Loggable.h:19