Type Alias massa_models::endorsement::SecureShareEndorsement
source · pub type SecureShareEndorsement = SecureShare<Endorsement, EndorsementId>;
Expand description
Wrapped endorsement
Aliased Type§
struct SecureShareEndorsement {
pub content: Endorsement,
pub serialized_data: Vec<u8, Global>,
pub signature: Signature,
pub content_creator_pub_key: PublicKey,
pub content_creator_address: Address,
pub id: EndorsementId,
}
Fields§
§content: Endorsement
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: EndorsementId
A secure hash of the data. See also massa_hash::Hash
Implementations§
sourcepub fn sign(
keypair: &KeyPair,
content_hash: &Hash,
_content: &T
) -> Result<Signature, ModelsError>
pub fn sign( keypair: &KeyPair, content_hash: &Hash, _content: &T ) -> Result<Signature, ModelsError>
Sign the SecureShare given the content
sourcepub fn verify_signature(&self) -> Result<(), ModelsError>
pub fn verify_signature(&self) -> Result<(), ModelsError>
check if self has been signed by public key
sourcepub fn compute_signed_hash(&self) -> Hash
pub fn compute_signed_hash(&self) -> Hash
Compute the signed hash
sourcepub fn serialized_size(&self) -> usize
pub fn serialized_size(&self) -> usize
get full serialized size
Trait Implementations§
source§fn clone(&self) -> SecureShare<T, ID>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§fn eq(&self, other: &SecureShare<T, ID>) -> bool
fn eq(&self, other: &SecureShare<T, ID>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.