Table of Contents

Class RestPkiCertificateAuthenticator

Namespace
NuvTools.Security.Certificate.Lacuna
Assembly
NuvTools.Security.Certificate.Lacuna.dll

Authenticates a certificate through Lacuna REST PKI. The client signs the challenge in the browser with Web PKI (signWithRestPki); the service validates possession of the private key and the trust chain, and the subject is read from the certificate it validated.

public sealed class RestPkiCertificateAuthenticator : ICertificateAuthenticator
Inheritance
RestPkiCertificateAuthenticator
Implements
Inherited Members

Constructors

RestPkiCertificateAuthenticator(IOptions<RestPkiOptions>, ILogger<RestPkiCertificateAuthenticator>)

Authenticates a certificate through Lacuna REST PKI. The client signs the challenge in the browser with Web PKI (signWithRestPki); the service validates possession of the private key and the trust chain, and the subject is read from the certificate it validated.

public RestPkiCertificateAuthenticator(IOptions<RestPkiOptions> options, ILogger<RestPkiCertificateAuthenticator> logger)

Parameters

options IOptions<RestPkiOptions>

REST PKI configuration.

logger ILogger<RestPkiCertificateAuthenticator>

Logger for diagnostics.

Methods

CompleteAsync(string?, CancellationToken)

Validates the signed challenge and reads the certificate's subject.

public Task<CertificateAuthentication> CompleteAsync(string? token, CancellationToken cancellationToken = default)

Parameters

token string

The token of the challenge the client signed.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<CertificateAuthentication>

The authentication result. An empty token, a failed validation or a communication failure yields Valid = false (fail-closed).

StartAsync(CancellationToken)

Opens an authentication on the provider.

public Task<CertificateChallenge> StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<CertificateChallenge>

The challenge the client signs and sends back.

Exceptions

Exception

The provider could not be reached or refused the request.