#include <private_key.hpp>
Definition at line 21 of file private_key.hpp.
◆ storage_type
◆ private_key() [1/4]
fc::crypto::private_key::private_key |
( |
| ) |
|
|
default |
◆ private_key() [2/4]
fc::crypto::private_key::private_key |
( |
private_key && | | ) |
|
|
default |
◆ private_key() [3/4]
fc::crypto::private_key::private_key |
( |
const private_key & | | ) |
|
|
default |
◆ private_key() [4/4]
fc::crypto::private_key::private_key |
( |
const string & | base58str | ) |
|
|
explicit |
Definition at line 110 of file private_key.cpp.
111 :_storage(priv_parse_base58(base58str))
112 {}
◆ generate()
template<typename KeyType = ecc::private_key_shim>
static private_key fc::crypto::private_key::generate |
( |
| ) |
|
|
inlinestatic |
Definition at line 36 of file private_key.hpp.
36 {
38 }
std::variant< ecc::private_key_shim, r1::private_key_shim, em::private_key_shim > storage_type
◆ generate_r1()
template<typename KeyType = r1::private_key_shim>
static private_key fc::crypto::private_key::generate_r1 |
( |
| ) |
|
|
inlinestatic |
◆ generate_shared_secret()
sha512 fc::crypto::private_key::generate_shared_secret |
( |
const public_key & | pub | ) |
const |
Definition at line 57 of file private_key.cpp.
58 {
59 return std::visit(generate_shared_secret_visitor(
pub._storage), _storage);
60 }
◆ get_public_key()
public_key fc::crypto::private_key::get_public_key |
( |
| ) |
const |
Definition at line 16 of file private_key.cpp.
17 {
18 return public_key(std::visit(public_key_visitor(), _storage));
19 }
◆ operator=()
◆ regenerate()
template<typename KeyType = ecc::private_key_shim>
static private_key fc::crypto::private_key::regenerate |
( |
const typename KeyType::data_type & | data | ) |
|
|
inlinestatic |
◆ sign()
signature fc::crypto::private_key::sign |
( |
const sha256 & | digest, |
|
|
bool | require_canonical = true ) const |
Definition at line 37 of file private_key.cpp.
38 {
39 return signature(std::visit(sign_visitor(
digest, require_canonical), _storage));
40 }
fc::sha256 digest(const T &value)
◆ to_string()
Definition at line 114 of file private_key.cpp.
115 {
116 auto which = _storage.index();
117
118 if (which == 0) {
119 using default_type = std::variant_alternative_t<0, private_key::storage_type>;
120 return to_wif(std::template get<default_type>(_storage), yield);
121 }
122
123 auto data_str = std::visit(base58str_visitor<storage_type, config::private_key_prefix>(yield), _storage);
124 return std::string(config::private_key_base_prefix) + "_" + data_str;
125 }
string to_wif(const Data &secret, const fc::yield_function_t &yield)
◆ operator!=
◆ operator<
Definition at line 136 of file private_key.cpp.
137 {
139 }
static bool apply(const T &a, const T &b)
◆ operator==
Definition at line 132 of file private_key.cpp.
132 {
134 }
static bool apply(const T &a, const T &b)
◆ reflector< private_key >
The documentation for this class was generated from the following files: