BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
CryptoParams.h
1 #pragma once
2 
3 #include <Poco/Crypto/CipherKey.h>
4 
5 namespace BeeeOn {
6 
7 class CryptoParams {
8 public:
9  CryptoParams();
10 
11  void setAlgorithm(const std::string &name);
12  std::string algorithm() const;
13 
14  void setSalt(const std::string &salt);
15  std::string salt() const;
16 
17  void setIterationCount(const int count);
18  int iterationCount() const;
19 
20  Poco::Crypto::CipherKey createKey(
21  const std::string &passphrase) const;
22  Poco::Crypto::CipherKey randomKey(const unsigned int length = 256) const;
23 
24  std::string toString() const;
25  bool empty() const;
26 
27  static CryptoParams parse(const std::string &input);
28  static CryptoParams create(const std::string &algorithm);
29  static CryptoParams createEmpty();
30 
36  static std::string randomString(const unsigned int length);
37 
38 private:
39  int m_iterationCount;
40  std::string m_salt;
41  std::string m_algorithm;
42 };
43 
44 }
static std::string randomString(const unsigned int length)
Definition: CryptoParams.cpp:136
Definition: CryptoParams.h:7