23 #include <boost/test/unit_test.hpp> 44 h256 passHash(
"0x2a");
45 string accountName =
"myAccount";
46 KeyInfo ki(passHash, accountName);
64 string password =
"hardPassword";
72 km.
setKeysFile(tmpDir.path() +
"/notExistingDir/keysFile.json");
87 string password =
"hardPassword";
105 string password =
"hardPassword";
114 for (
auto a: km.accounts())
120 string password =
"hardPassword";
122 KeyPair kp = KeyPair::create();
136 km.kill(addresses[0]);
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
#define BOOST_CHECK_THROW(stmt, excMatch)
void notePassword(std::string const &_pass)
Simple class that represents a "key pair".
std::vector< h128 > keys() const
Returns the uuids of all stored keys.
std::string const & keysFile() const
std::hash for asio::adress
std::string getDataDir(std::string _prefix="ethereum")
Secret const & secret() const
std::string accountName
Name of the key, or JSON key info if begins with '{'.
void setKeysFile(std::string const &_keysFile)
High-level manager of password-encrypted keys for Ethereum.
void create(std::string const &_pass)
void kill(h128 const &_id)
static std::string defaultPath()
h160s Addresses
A vector of Ethereum addresses.
void save(std::string const &_pass) const
Address const & address() const
Retrieve the associated address of the public key.
h256 passHash
Hash of the password or h256() / UnknownPassword if unknown.
#define BOOST_FIXTURE_TEST_SUITE(a, b)
std::string const & path() const
#define BOOST_CHECK_EQUAL(v1, v2)
bool load(std::string const &_pass)
#define BOOST_AUTO_TEST_SUITE_END()
Manages encrypted keys stored in a certain directory on disk.
#define BOOST_CHECK_NO_THROW(stmt)
bool haveHint(std::string const &_pass) const
Addresses accounts() const
temporary directory implementation It creates temporary directory in the given path.
BOOST_AUTO_TEST_CASE(KeyInfoDefaultConstructor)
Helper functions to work with json::spirit and test files.
#define BOOST_CHECK(expr)