Wire Sysio Wire Sysion 1.0.0
|
#include <yubihsm_wallet.hpp>
Public Member Functions | |
yubihsm_wallet (const string &connector, const uint16_t authkey) | |
~yubihsm_wallet () | |
private_key_type | get_private_key (public_key_type pubkey) const override |
bool | is_locked () const override |
void | lock () override |
void | unlock (string password) override |
void | check_password (string password) override |
void | set_password (string password) override |
map< public_key_type, private_key_type > | list_keys () override |
flat_set< public_key_type > | list_public_keys () override |
bool | import_key (string wif_key) override |
string | create_key (string key_type) override |
bool | remove_key (string key) override |
std::optional< signature_type > | try_sign_digest (const digest_type digest, const public_key_type public_key) override |
Public Member Functions inherited from sysio::wallet::wallet_api | |
virtual | ~wallet_api () |
Definition at line 15 of file yubihsm_wallet.hpp.
Definition at line 212 of file yubihsm_wallet.cpp.
sysio::wallet::yubihsm_wallet::~yubihsm_wallet | ( | ) |
Definition at line 215 of file yubihsm_wallet.cpp.
|
overridevirtual |
Checks the password of the wallet
Validates the password on a wallet even if the wallet is already unlocked, throws if bad password given.
password | the password previously set with set_password() |
Implements sysio::wallet::wallet_api.
Definition at line 233 of file yubihsm_wallet.cpp.
Creates a key within the wallet to be used to sign transactions by an account.
example: create_key K1
key_type | the key type to create. May be empty to allow wallet to pick appropriate/"best" key type |
Implements sysio::wallet::wallet_api.
Definition at line 253 of file yubihsm_wallet.cpp.
|
overridevirtual |
Get the private key corresponding to a public key. The private key must already be in the wallet.
Implements sysio::wallet::wallet_api.
Definition at line 218 of file yubihsm_wallet.cpp.
|
overridevirtual |
Imports a WIF Private Key into the wallet to be used to sign transactions by an account.
example: import_key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
wif_key | the WIF Private Key to import |
Implements sysio::wallet::wallet_api.
Definition at line 249 of file yubihsm_wallet.cpp.
|
overridevirtual |
Checks whether the wallet is locked (is unable to use its private keys).
This state can be changed by calling lock()
or unlock()
.
Implements sysio::wallet::wallet_api.
Definition at line 222 of file yubihsm_wallet.cpp.
|
overridevirtual |
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()
Implements sysio::wallet::wallet_api.
Definition at line 240 of file yubihsm_wallet.cpp.
|
overridevirtual |
Dumps all public keys owned by the wallet.
Implements sysio::wallet::wallet_api.
Definition at line 243 of file yubihsm_wallet.cpp.
|
overridevirtual |
Locks the wallet immediately
Implements sysio::wallet::wallet_api.
Definition at line 225 of file yubihsm_wallet.cpp.
|
overridevirtual |
Removes a key from the wallet.
example: remove_key SYS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
key | the Public Key to remove |
Implements sysio::wallet::wallet_api.
Definition at line 258 of file yubihsm_wallet.cpp.
|
overridevirtual |
Sets a new password on the wallet.
The wallet must be either 'new' or 'unlocked' to execute this command.
Implements sysio::wallet::wallet_api.
Definition at line 236 of file yubihsm_wallet.cpp.
|
overridevirtual |
Returns a signature given the digest and public_key, if this wallet can sign via that public key
Implements sysio::wallet::wallet_api.
Definition at line 264 of file yubihsm_wallet.cpp.
|
overridevirtual |
Unlocks the wallet.
The wallet remain unlocked until the lock
is called or the program exits.
password | the password previously set with set_password() |
Implements sysio::wallet::wallet_api.
Definition at line 230 of file yubihsm_wallet.cpp.