hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
keys_manager_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_KEYS_MANAGER_IMPL_HPP
7 #define IROHA_KEYS_MANAGER_IMPL_HPP
8 
10 
11 #include <boost/filesystem.hpp>
12 #include <boost/optional.hpp>
13 #include "cryptography/keypair.hpp"
14 #include "logger/logger_fwd.hpp"
15 
16 namespace iroha {
17 
18  class KeysManagerImpl : public KeysManager {
19  public:
27  KeysManagerImpl(const std::string &account_id,
28  const boost::filesystem::path &path_to_keypair,
29  logger::LoggerPtr log);
30 
36  KeysManagerImpl(const std::string account_id, logger::LoggerPtr log);
37 
38  bool createKeys(const boost::optional<std::string> &pass_phrase) override;
39 
41  loadKeys(const boost::optional<std::string> &pass_phrase) override;
42 
43  static const std::string kPublicKeyExtension;
44  static const std::string kPrivateKeyExtension;
45 
46  private:
53  bool store(std::string_view pub, std::string_view priv);
54 
55  boost::filesystem::path path_to_keypair_;
56  std::string account_id_;
57  logger::LoggerPtr log_;
58  };
59 } // namespace iroha
60 #endif // IROHA_KEYS_MANAGER_IMPL_HPP
bool createKeys(const boost::optional< std::string > &pass_phrase) override
Definition: keys_manager_impl.cpp:108
Definition: keys_manager.hpp:19
iroha::expected::Result< shared_model::crypto::Keypair, std::string > loadKeys(const boost::optional< std::string > &pass_phrase) override
Definition: keys_manager_impl.cpp:80
Definition: result_fwd.hpp:27
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: keys_manager_impl.hpp:18
static const std::string kPublicKeyExtension
Definition: keys_manager_impl.hpp:43
KeysManagerImpl(const std::string &account_id, const boost::filesystem::path &path_to_keypair, logger::LoggerPtr log)
Definition: keys_manager_impl.cpp:63
Definition: block_query.hpp:15
static const std::string kPrivateKeyExtension
Definition: keys_manager_impl.hpp:44