mithril_common::certificate_chain

Trait CertificateVerifier

source
pub trait CertificateVerifier: Send + Sync {
    // Required methods
    fn verify_genesis_certificate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        genesis_certificate: &'life1 Certificate,
        genesis_verification_key: &'life2 ProtocolGenesisVerificationKey,
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn verify_standard_certificate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        certificate: &'life1 Certificate,
        previous_certificate: &'life2 Certificate,
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn verify_certificate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        certificate: &'life1 Certificate,
        genesis_verification_key: &'life2 ProtocolGenesisVerificationKey,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<Certificate>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn verify_certificate_chain<'life0, 'life1, 'async_trait>(
        &'life0 self,
        certificate: Certificate,
        genesis_verification_key: &'life1 ProtocolGenesisVerificationKey,
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

CertificateVerifier is the cryptographic engine in charge of verifying multi signatures and certificates

Required Methods§

source

fn verify_genesis_certificate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, genesis_certificate: &'life1 Certificate, genesis_verification_key: &'life2 ProtocolGenesisVerificationKey, ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Verify Genesis certificate

source

fn verify_standard_certificate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, certificate: &'life1 Certificate, previous_certificate: &'life2 Certificate, ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Verify Standard certificate

source

fn verify_certificate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, certificate: &'life1 Certificate, genesis_verification_key: &'life2 ProtocolGenesisVerificationKey, ) -> Pin<Box<dyn Future<Output = StdResult<Option<Certificate>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Verify if a Certificate is valid and returns the previous Certificate in the chain if exists

Provided Methods§

source

fn verify_certificate_chain<'life0, 'life1, 'async_trait>( &'life0 self, certificate: Certificate, genesis_verification_key: &'life1 ProtocolGenesisVerificationKey, ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Verify that the Certificate Chain associated to a Certificate is valid

Implementors§