本文整理汇总了C++中fc::ecc::private_key::sign_compact方法的典型用法代码示例。如果您正苦于以下问题:C++ private_key::sign_compact方法的具体用法?C++ private_key::sign_compact怎么用?C++ private_key::sign_compact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fc::ecc::private_key
的用法示例。
在下文中一共展示了private_key::sign_compact方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sign
void signed_block_header::sign( const fc::ecc::private_key& signer, digest_type chain_id )
{ try {
fc::sha256::encoder enc;
fc::raw::pack( enc, *this );
fc::raw::pack( enc, chain_id );
delegate_signature = signer.sign_compact( digest() );
} FC_RETHROW_EXCEPTIONS( warn, "" ) }
示例2: start
void start(const fc::ip::endpoint& endpoint_to_probe,
const fc::ecc::private_key& my_node_id,
const bts::blockchain::digest_type& chain_id)
{
fc::future<void> connect_task = fc::async([=](){ _connection->connect_to(endpoint_to_probe); }, "connect_task");
try
{
connect_task.wait(fc::seconds(10));
}
catch (const fc::timeout_exception&)
{
ilog("timeout connecting to node ${endpoint}", ("endpoint", endpoint_to_probe));
connect_task.cancel();
throw;
}
fc::sha256::encoder shared_secret_encoder;
fc::sha512 shared_secret = _connection->get_shared_secret();
shared_secret_encoder.write(shared_secret.data(), sizeof(shared_secret));
fc::ecc::compact_signature signature = my_node_id.sign_compact(shared_secret_encoder.result());
bts::net::hello_message hello("map_bts_network",
BTS_NET_PROTOCOL_VERSION,
fc::ip::address(), 0, 0,
my_node_id.get_public_key(),
signature,
chain_id,
fc::variant_object());
_connection->send_message(hello);
}
示例3: start
void start(const fc::ip::endpoint& endpoint_to_probe,
const fc::ecc::private_key& my_node_id,
const graphene::chain::chain_id_type& chain_id)
{
_remote = endpoint_to_probe;
fc::future<void> connect_task = fc::async([this](){ _connection->connect_to(_remote); }, "connect_task");
try
{
connect_task.wait(fc::seconds(10));
}
catch (const fc::timeout_exception&)
{
ilog("timeout connecting to node ${endpoint}", ("endpoint", endpoint_to_probe));
connect_task.cancel(__FUNCTION__);
throw;
}
fc::sha256::encoder shared_secret_encoder;
fc::sha512 shared_secret = _connection->get_shared_secret();
shared_secret_encoder.write(shared_secret.data(), sizeof(shared_secret));
fc::ecc::compact_signature signature = my_node_id.sign_compact(shared_secret_encoder.result());
graphene::net::hello_message hello("network_mapper",
GRAPHENE_NET_PROTOCOL_VERSION,
fc::ip::address(), 0, 0,
my_node_id.get_public_key(),
signature,
chain_id,
fc::variant_object());
_connection->send_message(hello);
}
示例4: digest
void signed_transaction::sign( const fc::ecc::private_key& k )
{
try {
sigs.insert( k.sign_compact( digest() ) );
}
FC_RETHROW_EXCEPTIONS( warn, "error signing transaction", ("trx", *this ) );
}
示例5: create
void pow::create( const fc::ecc::private_key& w, const digest_type& i ) {
input = i;
signature = w.sign_compact(input,false);
auto sig_hash = fc::sha256::hash( signature );
public_key_type recover = fc::ecc::public_key( signature, sig_hash, false );
work = fc::sha256::hash(recover);
}
示例6: sign
void signed_transaction::sign( const fc::ecc::private_key& signer, const digest_type& chain_id )
{
signatures.push_back( signer.sign_compact( digest( chain_id ) ) );
}
示例7: digest
void subscribe_message::sign( const fc::ecc::private_key& k )
{
sig = k.sign_compact( digest() );
}
示例8: signin
void peer_connection::signin( const fc::ecc::private_key& key )
{
auto sig = key.sign_compact( fc::sha256::hash( (char*)&_shared_secret, sizeof(_shared_secret) ) );
auto self = shared_from_this();
fc::async( [=](){ self->send_message( signin_request( sig ) ); } );
}
示例9: sign
void signed_block::sign( const fc::ecc::private_key& trustee_priv_key )
{
trustee_signature = trustee_priv_key.sign_compact( id() );
}
示例10: sign
void signed_block_header::sign( const fc::ecc::private_key& signer )
{ try {
delegate_signature = signer.sign_compact( digest() );
} FC_RETHROW_EXCEPTIONS( warn, "" ) }
示例11: sign
void signed_transaction::sign( const fc::ecc::private_key& signer )
{
signatures.push_back( signer.sign_compact( digest() ) );
}
示例12: sign
void signed_block_header::sign( const fc::ecc::private_key& signer )
{
witness_signature = signer.sign_compact( digest() );
}