ChallengeHandler

Trait ChallengeHandler 

Source
pub trait ChallengeHandler: Send + Sync {
    // Required methods
    fn challenge_type(&self) -> &'static str;
    fn begin<'a>(
        &'a self,
        req: &'a CertRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ChallengeState, CertError>> + Send + 'a>>;
    fn verify<'a>(
        &'a self,
        state: &'a ChallengeState,
        parameters: &'a Map<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<ChallengeOutcome, CertError>> + Send + 'a>>;
}
Expand description

A pluggable challenge handler for the NDNCERT CA.

Required Methods§

Source

fn challenge_type(&self) -> &'static str

The challenge type identifier (e.g. "possession", "token", "pin", "email").

Source

fn begin<'a>( &'a self, req: &'a CertRequest, ) -> Pin<Box<dyn Future<Output = Result<ChallengeState, CertError>> + Send + 'a>>

Prepare initial challenge state for a new enrollment request.

Called on the first CHALLENGE request for a given enrollment. The returned ChallengeState is stored and passed back to verify.

Source

fn verify<'a>( &'a self, state: &'a ChallengeState, parameters: &'a Map<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<ChallengeOutcome, CertError>> + Send + 'a>>

Verify the client’s challenge response.

May return ChallengeOutcome::Pending to indicate another round is needed (e.g. the email was sent and the client must submit the code). The CA will store next_state and call verify again on the next CHALLENGE request.

Implementors§