BinSignable

Trait BinSignable 

Source
pub trait BinSignable<'de>: Serialize + Deserialize<'de> {
    type SerdeError: Error;

    // Required methods
    fn issuer_pubkey(&self) -> PubKeyEnum;
    fn signature(&self) -> Option<Sig>;
    fn set_signature(&mut self, _signature: Sig);
    fn get_bin_without_sig(&self) -> Result<Vec<u8>, Self::SerdeError>;
    fn add_sig_to_bin_datas(
        &self,
        bin_datas: &mut Vec<u8>,
    ) -> Result<(), Self::SerdeError>;

    // Provided methods
    fn sign(&mut self, signator: &SignatorEnum) -> Result<Vec<u8>, SignError> { ... }
    fn verify(&self) -> Result<(), SigError> { ... }
}
Expand description

Signatureable in binary format

Required Associated Types§

Source

type SerdeError: Error

Error when serialize self into binary

Required Methods§

Source

fn issuer_pubkey(&self) -> PubKeyEnum

Return entity issuer pubkey

Source

fn signature(&self) -> Option<Sig>

Return signature

Source

fn set_signature(&mut self, _signature: Sig)

Change signature

Source

fn get_bin_without_sig(&self) -> Result<Vec<u8>, Self::SerdeError>

Get binary datas without signature

Source

fn add_sig_to_bin_datas( &self, bin_datas: &mut Vec<u8>, ) -> Result<(), Self::SerdeError>

Add signature to bin datas

Provided Methods§

Source

fn sign(&mut self, signator: &SignatorEnum) -> Result<Vec<u8>, SignError>

Sign entity with a signator

Source

fn verify(&self) -> Result<(), SigError>

Check signature of entity

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§