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_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 methods
    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 { ... }
    fn verify_protocol_message(
        &self,
        protocol_message: &ProtocolMessage,
        certificate: &Certificate
    ) -> bool { ... }
}
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_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 Step 1: Check if the hash is valid (i.e. the Certificate has not been tampered by modifying its content) Step 2: Check that the multi signature is valid if it is a Standard Certificate (i.e verification of the Mithril multi signature) Step 3: Check that the aggregate verification key of the Certificate is registered in the previous Certificate in the chain

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 TODO: see if we can borrow the certificate instead.

source

fn verify_protocol_message( &self, protocol_message: &ProtocolMessage, certificate: &Certificate ) -> bool

still a dirty hack to mock the protocol message verify that the protocol message is equal to the signed message of the certificate. TODO: Remove this method.

Implementors§