Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::shared_public_key Struct Reference

#include <authority.hpp>

Public Member Functions

 shared_public_key (shared_public_key_data &&p)
 
 operator public_key_type () const
 
std::string to_string () const
 

Public Attributes

shared_public_key_data pubkey
 

Friends

bool operator== (const shared_public_key &lhs, const shared_public_key &rhs)
 
bool operator== (const shared_public_key &l, const public_key_type &r)
 
bool operator== (const public_key_type &l, const shared_public_key &r)
 

Detailed Description

Definition at line 12 of file authority.hpp.

Constructor & Destructor Documentation

◆ shared_public_key()

sysio::chain::shared_public_key::shared_public_key ( shared_public_key_data && p)
inline

Definition at line 13 of file authority.hpp.

13 :
14 pubkey(std::move(p)) {}
const mie::Vuint & p
Definition bn.cpp:27
shared_public_key_data pubkey
Definition authority.hpp:36

Member Function Documentation

◆ operator public_key_type()

sysio::chain::shared_public_key::operator public_key_type ( ) const
inline

Definition at line 16 of file authority.hpp.

16 {
17 fc::crypto::public_key::storage_type public_key_storage;
18 std::visit(overloaded {
19 [&](const auto& k1r1em) {
20 public_key_storage = k1r1em;
21 },
22 [&](const shared_string& wa) {
23 fc::datastream<const char*> ds(wa.data(), wa.size());
25 fc::raw::unpack(ds, pub);
26 public_key_storage = pub;
27 }
28 }, pubkey);
29 return std::move(public_key_storage);
30 }
wasm_allocator wa
Definition main.cpp:10
std::variant< ecc::public_key_shim, r1::public_key_shim, webauthn::public_key, em::public_key_shim > storage_type
static const Segment ds(Segment::ds)
void unpack(Stream &s, std::deque< T > &value)
Definition raw.hpp:540
chainbase::shared_string shared_string
Definition types.hpp:83
overloaded(Ts...) -> overloaded< Ts... >
bool pub
Here is the call graph for this function:

◆ to_string()

std::string sysio::chain::shared_public_key::to_string ( ) const
inline

Definition at line 32 of file authority.hpp.

32 {
33 return this->operator public_key_type().to_string();
34 }
std::string to_string(const fc::yield_function_t &yield=fc::yield_function_t()) const
fc::crypto::public_key public_key_type
Definition types.hpp:76
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator== [1/3]

bool operator== ( const public_key_type & l,
const shared_public_key & r )
friend

Definition at line 81 of file authority.hpp.

81 {
82 return r == l;
83 }
const mie::Vuint & r
Definition bn.cpp:28
int l

◆ operator== [2/3]

bool operator== ( const shared_public_key & l,
const public_key_type & r )
friend

Definition at line 58 of file authority.hpp.

58 {
59 if(l.pubkey.index() != r._storage.index())
60 return false;
61
62 return std::visit(overloaded {
63 [&](const fc::ecc::public_key_shim& k1) {
64 return k1._data == std::get<fc::ecc::public_key_shim>(r._storage)._data;
65 },
66 [&](const fc::em::public_key_shim& em) {
67 return em._data == std::get<fc::em::public_key_shim>(r._storage)._data;
68 },
69 [&](const fc::crypto::r1::public_key_shim& r1) {
70 return r1._data == std::get<fc::crypto::r1::public_key_shim>(r._storage)._data;
71 },
72 [&](const shared_string& wa) {
73 fc::datastream<const char*> ds(wa.data(), wa.size());
75 fc::raw::unpack(ds, pub);
76 return pub == std::get<fc::crypto::webauthn::public_key>(r._storage);
77 }
78 }, l.pubkey);
79 }
static const Opmask k1(1)

◆ operator== [3/3]

bool operator== ( const shared_public_key & lhs,
const shared_public_key & rhs )
friend

Definition at line 38 of file authority.hpp.

38 {
39 if(lhs.pubkey.index() != rhs.pubkey.index())
40 return false;
41
42 return std::visit(overloaded {
43 [&](const fc::ecc::public_key_shim& k1) {
44 return k1._data == std::get<fc::ecc::public_key_shim>(rhs.pubkey)._data;
45 },
46 [&](const fc::em::public_key_shim& em) { // Added EM handling
47 return em._data == std::get<fc::em::public_key_shim>(rhs.pubkey)._data;
48 },
49 [&](const fc::crypto::r1::public_key_shim& r1) {
50 return r1._data == std::get<fc::crypto::r1::public_key_shim>(rhs.pubkey)._data;
51 },
52 [&](const shared_string& wa) {
53 return wa == std::get<shared_string>(rhs.pubkey);
54 }
55 }, lhs.pubkey);
56 }

Member Data Documentation

◆ pubkey

shared_public_key_data sysio::chain::shared_public_key::pubkey

Definition at line 36 of file authority.hpp.


The documentation for this struct was generated from the following file: