 |
Ethereum
PoC-8
The C++ Implementation of Ethereum
|
Go to the documentation of this file.
30 #include <boost/filesystem.hpp>
66 void setPath(boost::filesystem::path
const& _path);
71 bytesSec secret(
h128 const& _uuid, std::function<std::string()>
const& _pass,
bool _useCache =
true)
const;
74 static bytesSec secret(std::string
const& _content, std::string
const& _pass);
88 bool recode(
h128 const& _uuid, std::string
const& _newPass, std::function<std::string()>
const& _pass,
KDF _kdf =
KDF::Scrypt);
95 std::vector<h128>
keys()
const {
return keysOf(m_keys); }
107 h128 readKey(boost::filesystem::path
const& _file,
bool _takeFileOwnership);
112 h128 readKeyContent(std::string
const& _content, boost::filesystem::path
const& _file = boost::filesystem::path());
115 void save(boost::filesystem::path
const& _keysPath);
128 void load(boost::filesystem::path
const& _keysPath);
129 void load() { load(m_path); }
133 static bytesSec decrypt(std::string
const& _v, std::string
const& _pass);
135 std::pair<h128 const, EncryptedKey>
const* key(
Address const& _address)
const;
136 std::pair<h128 const, EncryptedKey>* key(
Address const& _address);
138 mutable std::unordered_map<h128, bytesSec> m_cached;
140 std::unordered_map<h128, EncryptedKey> m_keys;
142 boost::filesystem::path m_path;
void save()
Store all keys in the managed directory.
h128 importKey(std::string const &_file)
Imports the (encrypted) key stored in the file _file and copies it to the managed directory.
bool noteAddress(h128 const &_uuid, Address const &_address)
boost::filesystem::path filename
bool recode(Address const &_address, std::string const &_newPass, std::function< std::string()> const &_pass, KDF _kdf=KDF::Scrypt)
Decrypts and re-encrypts the key identified by _address.
std::vector< h128 > keys() const
Returns the uuids of all stored keys.
h128 readKey(boost::filesystem::path const &_file, bool _takeFileOwnership)
static boost::filesystem::path defaultPath()
h128 importKeyContent(std::string const &_content)
vector_ref< byte const > bytesConstRef
h128 importSecret(bytesSec const &_s, std::string const &_pass)
boost::filesystem::path getDataDir(std::string _prefix="ethereum")
bool contains(h128 const &_k) const
secure_vector< byte > bytesSec
void kill(h128 const &_uuid)
Removes the key specified by _uuid from both memory and disk.
std::vector< T > keysOf(std::map< T, U > const &_m)
void save(boost::filesystem::path const &_keysPath)
Store all keys in the directory _keysPath.
void setPath(boost::filesystem::path const &_path)
Set a path for finding secrets.
bytesSec secret(Address const &_address, std::function< std::string()> const &_pass) const
static bytesSec secret(std::string const &_content, std::string const &_pass)
h128 importSecret(bytesConstRef _s, std::string const &_pass)
SecretStore(boost::filesystem::path const &_path)
Construct a new SecretStore and read all keys in the given directory.
h128 readKeyContent(std::string const &_content, boost::filesystem::path const &_file=boost::filesystem::path())
Address address(h128 const &_uuid) const
bool recode(h128 const &_uuid, std::string const &_newPass, std::function< std::string()> const &_pass, KDF _kdf=KDF::Scrypt)
Decrypts and re-encrypts the key identified by _uuid.
bytesSec secret(h128 const &_uuid, std::function< std::string()> const &_pass, bool _useCache=true) const