Scorum
Functions
Key

Wallet Key API. More...

Functions

bool scorum::wallet::wallet_api::import_key (const std::string &wif_key)
 
brain_key_info scorum::wallet::wallet_api::suggest_brain_key () const
 
std::map< public_key_type, std::string > scorum::wallet::wallet_api::list_keys ()
 
std::string scorum::wallet::wallet_api::get_private_key (const public_key_type &pubkey) const
 
std::pair< public_key_type, std::string > scorum::wallet::wallet_api::get_private_key_from_password (const std::string &account, const std::string &role, const std::string &password) const
 
std::string scorum::wallet::wallet_api::normalize_brain_key (const std::string &s) const
 

Detailed Description

Wallet Key API.

Function Documentation

◆ get_private_key()

std::string scorum::wallet::wallet_api::get_private_key ( const public_key_type pubkey) const

Get the WIF private key corresponding to a public key. The private key must already be in the wallet.

Definition at line 1362 of file wallet.cpp.

◆ get_private_key_from_password()

std::pair< public_key_type, std::string > scorum::wallet::wallet_api::get_private_key_from_password ( const std::string &  account,
const std::string &  role,
const std::string &  password 
) const

Get private key from password

Parameters
account
roleactive | owner | posting | memo
password

Definition at line 1367 of file wallet.cpp.

◆ import_key()

bool scorum::wallet::wallet_api::import_key ( const std::string &  wif_key)

Imports a WIF Private Key into the wallet to be used to sign transactions by an account.

example: import_key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

Parameters
wif_keythe WIF Private Key to import

Definition at line 1169 of file wallet.cpp.

◆ list_keys()

std::map< public_key_type, std::string > scorum::wallet::wallet_api::list_keys ( )

Dumps all private keys owned by the wallet.

The keys are printed in WIF format. You can import these keys into another wallet using import_key()

Returns
a map containing the private keys, indexed by their public key

Definition at line 1356 of file wallet.cpp.

◆ normalize_brain_key()

std::string scorum::wallet::wallet_api::normalize_brain_key ( const std::string &  s) const

Transforms a brain key to reduce the chance of errors when re-entering the key from memory.

This takes a user-supplied brain key and normalizes it into the form used for generating private keys. In particular, this upper-cases all ASCII characters and collapses multiple spaces into one.

Parameters
sthe brain key as supplied by the user
Returns
the brain key in its normalized form

Definition at line 1188 of file wallet.cpp.

◆ suggest_brain_key()

brain_key_info scorum::wallet::wallet_api::suggest_brain_key ( ) const

Suggests a safe brain key to use for creating your account.

create_account_with_brain_key() requires you to specify a 'brain key', a long passphrase that provides enough entropy to generate cyrptographic keys. This function will suggest a suitably random string that should be easy to write down (and, with effort, memorize).

Returns
a suggested brain_key

Definition at line 1225 of file wallet.cpp.