BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
GatewayInfo.h
1 #pragma once
2 
3 #include <string>
4 
5 #include <Poco/Crypto/RSAKey.h>
6 #include <Poco/Net/X509Certificate.h>
7 #include <Poco/Nullable.h>
8 #include <Poco/SharedPtr.h>
9 
10 #include "model/GatewayID.h"
11 #include "util/Loggable.h"
12 
13 namespace BeeeOn {
14 
18 class GatewayInfo : public Loggable {
19 public:
20  typedef Poco::SharedPtr<GatewayInfo> Ptr;
21 
25  GatewayInfo();
26 
30  void setGatewayID(const std::string &gatewayID);
31  GatewayID gatewayID() const;
32 
33  static std::string version();
34  Poco::SharedPtr<Poco::Net::X509Certificate> certificate() const;
35 
36  void setCertPath(const std::string &path);
37  void setKeyPath(const std::string &path);
38 
39  void initialize();
40 
41 protected:
46  void loadCertificate();
47 
51  void loadPrivateKey();
52 
53 private:
54  Poco::Nullable<GatewayID> m_gatewayID;
55  Poco::SharedPtr<Poco::Net::X509Certificate> m_certificate;
56  Poco::SharedPtr<Poco::Crypto::RSAKey> m_privateKey;
57 
58  std::string m_certPath;
59  std::string m_keyPath;
60 
61 };
62 
63 }
void setGatewayID(const std::string &gatewayID)
Definition: GatewayInfo.cpp:40
void loadCertificate()
Definition: GatewayInfo.cpp:76
GatewayInfo()
Definition: GatewayInfo.cpp:26
Definition: Loggable.h:19
Class for storing basic information about gateway.
Definition: GatewayInfo.h:18
void loadPrivateKey()
Definition: GatewayInfo.cpp:100
Definition: GatewayID.h:14