Table of Contents

Class DatavalidFaceVerifier

Namespace
NuvTools.Security.Biometrics.Serpro
Assembly
NuvTools.Security.Biometrics.Serpro.dll

Verifies a captured face through SERPRO Datavalid, which compares it with the face on government record for the CPF. The credentials and the token never leave the server.

public sealed class DatavalidFaceVerifier : IFaceVerifier
Inheritance
DatavalidFaceVerifier
Implements
Inherited Members

Constructors

DatavalidFaceVerifier(HttpClient, DatavalidAccessTokenProvider, IOptions<DatavalidOptions>, ILogger<DatavalidFaceVerifier>)

Verifies a captured face through SERPRO Datavalid, which compares it with the face on government record for the CPF. The credentials and the token never leave the server.

public DatavalidFaceVerifier(HttpClient httpClient, DatavalidAccessTokenProvider tokenProvider, IOptions<DatavalidOptions> options, ILogger<DatavalidFaceVerifier> logger)

Parameters

httpClient HttpClient

Client used to call the validation endpoint.

tokenProvider DatavalidAccessTokenProvider

Source of the gateway's access token.

options IOptions<DatavalidOptions>

Datavalid configuration.

logger ILogger<DatavalidFaceVerifier>

Logger for diagnostics.

Methods

VerifyAsync(FaceVerificationRequest, CancellationToken)

Compares the captured face with the one on record.

public Task<FaceVerification> VerifyAsync(FaceVerificationRequest request, CancellationToken cancellationToken = default)

Parameters

request FaceVerificationRequest

Whose face it should be, and the capture.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<FaceVerification>

The verification result. An invalid document, an unusable image or a communication failure yields Matched = false (fail-closed).