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§
Sourcetype SerdeError: Error
type SerdeError: Error
Error when serialize self into binary
Required Methods§
Sourcefn issuer_pubkey(&self) -> PubKeyEnum
fn issuer_pubkey(&self) -> PubKeyEnum
Return entity issuer pubkey
Sourcefn set_signature(&mut self, _signature: Sig)
fn set_signature(&mut self, _signature: Sig)
Change signature
Sourcefn get_bin_without_sig(&self) -> Result<Vec<u8>, Self::SerdeError>
fn get_bin_without_sig(&self) -> Result<Vec<u8>, Self::SerdeError>
Get binary datas without signature
Sourcefn add_sig_to_bin_datas(
&self,
bin_datas: &mut Vec<u8>,
) -> Result<(), Self::SerdeError>
fn add_sig_to_bin_datas( &self, bin_datas: &mut Vec<u8>, ) -> Result<(), Self::SerdeError>
Add signature to bin datas
Provided Methods§
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.