CreDB  0.1.0
Public Member Functions | Static Public Attributes | Friends | List of all members
Witness Class Reference

Witnesses hold a record about event(s) on the datastore's timeline. More...

#include <Witness.h>

Public Member Functions

 Witness ()=default
 
 Witness (const Witness &other)
 
 Witness (Witness &&other)
 
Witnessoperator= (const Witness &other)
 
bool valid (const sgx_ec256_public_t &public_key) const
 Verify the witness against a signature.
 
json::Document digest () const
 Returns the data in JSON form.
 
const bitstream & data () const
 Returns the raw underlying data.
 
void set_data (bitstream &&data)
 Set the witness data.
 
const sgx_ec256_signature_t & signature () const
 
transaction_bounds_t get_boundaries () const
 Get the extends of the witness on the datastore's timeline.
 
bool is_valid (const std::string &public_key_base64) const
 Validate the witness against a sever's public key.
 
std::string armor () const
 Returns a base 64 encoded representation of the witness.
 
 Witness (const std::string &base64)
 
std::string pretty_print_content (int indent) const
 Create a human-readable textual representation of the witness.
 

Static Public Attributes

static constexpr const char * OP_FIELD_NAME = "operations"
 Name of the JSON-field that holds the operations.
 
static constexpr const char * SHARD_FIELD_NAME = "shard"
 Name of the JSON-field that holds the shard number.
 
static constexpr const char * BLOCK_FIELD_NAME = "block"
 Name of the JSON-field that holds the block number.
 
static constexpr const char * INDEX_FIELD_NAME = "index"
 Name of the JSON-field holding the block offset.
 

Friends

bitstream & operator>> (bitstream &bs, Witness &witness)
 
bitstream & operator<< (bitstream &bs, Witness &witness)
 
std::istream & operator>> (std::istream &in, Witness &witness)
 

Detailed Description

Witnesses hold a record about event(s) on the datastore's timeline.

Constructor & Destructor Documentation

◆ Witness() [1/4]

Witness ( )
default

Default constructor

◆ Witness() [2/4]

Witness ( const Witness other)
inline

Copy constructor

◆ Witness() [3/4]

Witness ( Witness &&  other)
inline

Move constructor

◆ Witness() [4/4]

Witness ( const std::string &  base64)
inlineexplicit

Explicitly construct the witness from a string representation

Member Function Documentation

◆ operator=()

Witness& operator= ( const Witness other)
inline

Copy using assignment

◆ signature()

const sgx_ec256_signature_t& signature ( ) const
inline

Get the signature (ensuring authenticity) of the witness

Friends And Related Function Documentation

◆ operator<<

bitstream& operator<< ( bitstream &  bs,
Witness witness 
)
friend

Write a witness to a bitstream

◆ operator>> [1/2]

bitstream& operator>> ( bitstream &  bs,
Witness witness 
)
friend

Read a witness from a bitstream

◆ operator>> [2/2]

std::istream& operator>> ( std::istream &  in,
Witness witness 
)
friend

Load a witness from a string


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