pub struct VerifyClientIdentity { /* private fields */ }Expand description
The client’s presented identity must be verified.
The caller has three choices:
-
Call
Self::with_config(). This callsClientVerifier::verify_identity()synchronously. -
Call
Self::presented_identity()to obtain the peer’s presented identity, verify that outside the library (perhaps asynchronously), and then continue the handshake withSelf::continue_with().If the verification fails, the error can be passed into
Self::continue_with()to follow a uniform error handling path. -
Abandon the handshake by discarding this object.
The returned object is a further ServerHandshake. Commonly this will be a
ServerHandshake::NeedsInput which will accept and process further data.
Implementations§
Source§impl VerifyClientIdentity
impl VerifyClientIdentity
Sourcepub fn with_config(self) -> Result<ServerHandshake, Error>
pub fn with_config(self) -> Result<ServerHandshake, Error>
Progress the handshake by calling the pre-configured certificate verification trait.
Sourcepub fn continue_with(
self,
verification_result: Result<VerifiedIdentity<'static>, Error>,
) -> Result<ServerHandshake, Error>
pub fn continue_with( self, verification_result: Result<VerifiedIdentity<'static>, Error>, ) -> Result<ServerHandshake, Error>
Progress the handshake by incorporating the result of an external verification.
If verification_result is an error, this error is returned and the handshake terminates.
Sourcepub fn presented_identity(&self) -> Result<ClientIdentity<'static, '_>, Error>
pub fn presented_identity(&self) -> Result<ClientIdentity<'static, '_>, Error>
Inspect the identity that the client has provided.