Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::crypto::signature Class Reference

#include <signature.hpp>

Public Types

using storage_type = std::variant<ecc::signature_shim, r1::signature_shim, webauthn::signature, em::signature_shim>
 

Public Member Functions

 signature ()=default
 
 signature (signature &&)=default
 
 signature (const signature &)=default
 
signatureoperator= (const signature &)=default
 
 signature (const string &base58str)
 
std::string to_string (const fc::yield_function_t &yield=fc::yield_function_t()) const
 
size_t which () const
 
size_t variable_size () const
 

Friends

struct reflector< signature >
 
class private_key
 
class public_key
 
bool operator== (const signature &p1, const signature &p2)
 
bool operator!= (const signature &p1, const signature &p2)
 
bool operator< (const signature &p1, const signature &p2)
 
std::size_t hash_value (const signature &b)
 

Detailed Description

Definition at line 21 of file signature.hpp.

Member Typedef Documentation

◆ storage_type

using fc::crypto::signature::storage_type = std::variant<ecc::signature_shim, r1::signature_shim, webauthn::signature, em::signature_shim>

Definition at line 24 of file signature.hpp.

Constructor & Destructor Documentation

◆ signature() [1/4]

fc::crypto::signature::signature ( )
default

◆ signature() [2/4]

fc::crypto::signature::signature ( signature && )
default

◆ signature() [3/4]

fc::crypto::signature::signature ( const signature & )
default

◆ signature() [4/4]

fc::crypto::signature::signature ( const string & base58str)
explicit

Definition at line 34 of file signature.cpp.

35 :_storage(sig_parse_base58(base58str))
36 {}

Member Function Documentation

◆ operator=()

signature & fc::crypto::signature::operator= ( const signature & )
default

◆ to_string()

std::string fc::crypto::signature::to_string ( const fc::yield_function_t & yield = fc::yield_function_t()) const

Definition at line 56 of file signature.cpp.

57 {
58 auto data_str = std::visit(base58str_visitor<storage_type, config::signature_prefix>(yield), _storage);
59 yield();
60 return std::string(config::signature_base_prefix) + "_" + data_str;
61 }
thread_local yield_t yield
Definition yield.hpp:52
Here is the caller graph for this function:

◆ variable_size()

size_t fc::crypto::signature::variable_size ( ) const

Definition at line 45 of file signature.cpp.

45 {
46 return std::visit(overloaded {
47 [&](const auto& k1r1) {
48 return static_cast<size_t>(0);
49 },
50 [&](const webauthn::signature& wa) {
51 return static_cast<size_t>(wa.variable_size());
52 }
53 }, _storage);
54 }
wasm_allocator wa
Definition main.cpp:10
overloaded(Ts...) -> overloaded< Ts... >

◆ which()

size_t fc::crypto::signature::which ( ) const

Definition at line 38 of file signature.cpp.

38 {
39 return _storage.index();
40 }

Friends And Related Symbol Documentation

◆ hash_value

std::size_t hash_value ( const signature & b)
friend

Definition at line 81 of file signature.cpp.

81 {
82 return std::visit(hash_visitor(), b._storage);
83 }

◆ operator!=

bool operator!= ( const signature & p1,
const signature & p2 )
friend

Definition at line 72 of file signature.cpp.

72 {
73 return !eq_comparator<signature::storage_type>::apply(p1._storage, p2._storage);
74 }
static bool apply(const T &a, const T &b)
Definition common.hpp:119

◆ operator<

bool operator< ( const signature & p1,
const signature & p2 )
friend

Definition at line 76 of file signature.cpp.

77 {
78 return less_comparator<signature::storage_type>::apply(p1._storage, p2._storage);
79 }
static bool apply(const T &a, const T &b)
Definition common.hpp:147

◆ operator==

bool operator== ( const signature & p1,
const signature & p2 )
friend

Definition at line 68 of file signature.cpp.

68 {
69 return eq_comparator<signature::storage_type>::apply(p1._storage, p2._storage);
70 }

◆ private_key

friend class private_key
friend

Definition at line 51 of file signature.hpp.

◆ public_key

friend class public_key
friend

Definition at line 52 of file signature.hpp.

◆ reflector< signature >

friend struct reflector< signature >
friend

Definition at line 49 of file signature.hpp.


The documentation for this class was generated from the following files: