Trait Verifier

Source
pub trait Verifier<T: Sync + Send + DIDResolver> {
    // Required methods
    fn verifiable_timestamp<'life0, 'life1, 'async_trait>(
        &'life0 self,
        did: &'life1 str,
        expected_timestamp: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn VerifiableTimestamp>, VerifierError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn did_commitment<'life0, 'life1, 'async_trait>(
        &'life0 self,
        did: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DIDCommitment>, VerifierError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_pow_hash(&self, hash: &str) -> Result<(), VerifierError>;
    fn resolver(&self) -> &dyn TrustchainResolver;

    // Provided method
    fn verify<'life0, 'life1, 'async_trait>(
        &'life0 self,
        did: &'life1 str,
        root_timestamp: Timestamp,
    ) -> Pin<Box<dyn Future<Output = Result<DIDChain, VerifierError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

A verifier of root and downstream DIDs.

Required Methods§

Source

fn verifiable_timestamp<'life0, 'life1, 'async_trait>( &'life0 self, did: &'life1 str, expected_timestamp: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn VerifiableTimestamp>, VerifierError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Constructs a verifiable timestamp for the given DID, including an expected value for the timestamp retrieved from a local PoW network node.

Source

fn did_commitment<'life0, 'life1, 'async_trait>( &'life0 self, did: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DIDCommitment>, VerifierError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets a block hash (PoW) Commitment for the given DID.

Source

fn validate_pow_hash(&self, hash: &str) -> Result<(), VerifierError>

Queries a local PoW node to get the expected timestamp for a given PoW hash.

Source

fn resolver(&self) -> &dyn TrustchainResolver

Gets the resolver used for DID verification.

Provided Methods§

Source

fn verify<'life0, 'life1, 'async_trait>( &'life0 self, did: &'life1 str, root_timestamp: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<DIDChain, VerifierError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Verifies a downstream DID by tracing its chain back to the root.

Implementors§