pub type SecureShareBlock = SecureShare<Block, BlockId>;
Expand description

Block with assosciated meta-data and interfaces allowing trust of data in untrusted network

Aliased Type§

struct SecureShareBlock {
    pub content: Block,
    pub serialized_data: Vec<u8, Global>,
    pub signature: Signature,
    pub content_creator_pub_key: PublicKey,
    pub content_creator_address: Address,
    pub id: BlockId,
}

Fields§

§content: Block

Reference contents. Not required for the the security protocols.

Use the Lightweight equivilant structures when you need verifiable serialized data, but do not need to read the values directly (such as when sending)

§serialized_data: Vec<u8, Global>

Content in sharable, deserializable form. Is used in the secure verification protocols.

§signature: Signature

A cryptographically generated value using serialized_data and a public key.

§content_creator_pub_key: PublicKey

The public-key component used in the generation of the signature

§content_creator_address: Address

Derived from the same public key used to generate the signature

§id: BlockId

A secure hash of the data. See also massa_hash::Hash

Implementations§

source§

impl SecureShareBlock

source

pub fn bytes_count(&self) -> u64

size in bytes of the whole block

source

pub fn contains_operation(&self, op: SecureShareOperation) -> bool

true if given operation is included in the block

source

pub fn get_fitness(&self) -> u64

returns the fitness of the block

source§

impl<T, ID> SecureShare<T, ID>where T: Display + SecureShareContent, ID: Id,

source

pub fn sign( keypair: &KeyPair, content_hash: &Hash, _content: &T ) -> Result<Signature, ModelsError>

Sign the SecureShare given the content

source

pub fn verify_signature(&self) -> Result<(), ModelsError>

check if self has been signed by public key

source

pub fn compute_signed_hash(&self) -> Hash

Compute the signed hash

source

pub fn serialized_size(&self) -> usize

get full serialized size

Trait Implementations§

source§

impl<T, ID> Clone for SecureShare<T, ID>where T: Display + SecureShareContent + Clone, ID: Id + Clone,

source§

fn clone(&self) -> SecureShare<T, ID>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, ID> Debug for SecureShare<T, ID>where T: Display + SecureShareContent + Debug, ID: Id + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, T, ID> Deserialize<'de> for SecureShare<T, ID>where T: Display + SecureShareContent + Deserialize<'de>, ID: Id + Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T, ID> Display for SecureShare<T, ID>where T: Display + SecureShareContent, ID: Id,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, ID> PartialEq<SecureShare<T, ID>> for SecureShare<T, ID>where T: Display + SecureShareContent + PartialEq, ID: Id + PartialEq,

source§

fn eq(&self, other: &SecureShare<T, ID>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, ID> Serialize for SecureShare<T, ID>where T: Display + SecureShareContent + Serialize, ID: Id + Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T, ID> Eq for SecureShare<T, ID>where T: Display + SecureShareContent + Eq, ID: Id + Eq,

source§

impl<T, ID> StructuralEq for SecureShare<T, ID>where T: Display + SecureShareContent, ID: Id,

source§

impl<T, ID> StructuralPartialEq for SecureShare<T, ID>where T: Display + SecureShareContent, ID: Id,