Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
wallet.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <fc/real128.hpp>
8
9using namespace std;
10using namespace sysio::chain;
11
12namespace sysio { namespace wallet {
13
15
20
21namespace detail {
22class soft_wallet_impl;
23}
24
29class soft_wallet final : public wallet_api
30{
31 public:
32 soft_wallet( const wallet_data& initial_data );
33
35
36 bool copy_wallet_file( string destination_filename );
37
45 string get_wallet_filename() const;
46
52
56 pair<public_key_type,private_key_type> get_private_key_from_password( string account, string role, string password )const;
57
64 bool is_new()const;
65
72 bool is_locked()const override;
73
77 void lock() override;
78
86 void unlock(string password) override;
87
95 void check_password(string password) override;
96
103 void set_password(string password) override;
104
111 map<public_key_type, private_key_type> list_keys() override;
112
116 flat_set<public_key_type> list_public_keys() override;
117
131 bool load_wallet_file(string wallet_filename = "");
132
143 void save_wallet_file(string wallet_filename = "");
144
152 void set_wallet_filename(string wallet_filename);
153
160 bool import_key( string wif_key ) override;
161
168 bool remove_key( string key ) override;
169
176 string create_key( string key_type ) override;
177
178 /* Attempts to sign a digest via the given public_key
179 */
180 std::optional<signature_type> try_sign_digest( const digest_type digest, const public_key_type public_key ) override;
181
182 std::shared_ptr<detail::soft_wallet_impl> my;
183 void encrypt_keys();
184};
185
188 map<public_key_type,private_key_type> keys;
189};
190
191} }
192
194
195FC_REFLECT( sysio::wallet::plain_keys, (checksum)(keys) )
contains only the public point of an elliptic curve key.
void set_wallet_filename(string wallet_filename)
Definition wallet.cpp:411
void unlock(string password) override
Definition wallet.cpp:351
bool is_locked() const override
Definition wallet.cpp:325
map< public_key_type, private_key_type > list_keys() override
Definition wallet.cpp:381
private_key_type get_private_key(public_key_type pubkey) const override
Definition wallet.cpp:394
std::shared_ptr< detail::soft_wallet_impl > my
Definition wallet.hpp:182
string get_wallet_filename() const
Definition wallet.cpp:277
bool load_wallet_file(string wallet_filename="")
Definition wallet.cpp:315
soft_wallet(const wallet_data &initial_data)
Definition wallet.cpp:266
void check_password(string password) override
Definition wallet.cpp:363
string create_key(string key_type) override
Definition wallet.cpp:306
pair< public_key_type, private_key_type > get_private_key_from_password(string account, string role, string password) const
Definition wallet.cpp:403
void lock() override
Definition wallet.cpp:340
void set_password(string password) override
Definition wallet.cpp:373
flat_set< public_key_type > list_public_keys() override
Definition wallet.cpp:387
bool import_key(string wif_key) override
Definition wallet.cpp:282
bool copy_wallet_file(string destination_filename)
Definition wallet.cpp:272
std::optional< signature_type > try_sign_digest(const digest_type digest, const public_key_type public_key) override
Definition wallet.cpp:399
void save_wallet_file(string wallet_filename="")
Definition wallet.cpp:320
bool remove_key(string key) override
Definition wallet.cpp:294
fc::sha256 digest(const T &value)
Definition digest.hpp:9
Definition name.hpp:106
uint16_t transaction_handle_type
Definition wallet.hpp:14
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
unsigned short uint16_t
Definition stdint.h:125
map< public_key_type, private_key_type > keys
Definition wallet.hpp:188
vector< char > cipher_keys
Definition wallet.hpp:18
CK_BYTE_PTR pubkey
struct @108 key_type