From a7ca09dfc3c4d5210674f61055fbb206d567a3d9 Mon Sep 17 00:00:00 2001 From: PBSA Github Manager Date: Fri, 26 May 2017 22:04:49 -0300 Subject: [PATCH] Add get_private_key_from_password from steem commit --- libraries/wallet/wallet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 456536c6..9791f3d0 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -3378,6 +3378,14 @@ brain_key_info wallet_api::suggest_brain_key()const result.pub_key = priv_key.get_public_key(); return result; } + +pair wallet_api::get_private_key_from_password( string account, string role, string password )const { + auto seed = account + role + password; + FC_ASSERT( seed.size() ); + auto secret = fc::sha256::hash( seed.c_str(), seed.size() ); + auto priv = fc::ecc::private_key::regenerate( secret ); + return std::make_pair( public_key_type( priv.get_public_key() ), key_to_wif( priv ) ); +} string wallet_api::serialize_transaction( signed_transaction tx )const {