Pular para o conteúdo principal

PKCertificateAuthentication

Namespace: Lacuna.Pki
Assembly: Lacuna.Pki
Class

Helper class to implement public-key certificate authentication.

public class PKCertificateAuthentication

Hierarquia: objectPKCertificateAuthentication

Construtores

PKCertificateAuthentication(IAsyncNonceStore)

public PKCertificateAuthentication(IAsyncNonceStore asyncStore)

Parâmetros

NomeTipoDescrição
asyncStoreIAsyncNonceStore

PKCertificateAuthentication(INonceStore)

public PKCertificateAuthentication(INonceStore store)

Parâmetros

NomeTipoDescrição
storeINonceStore

Campos

DigestAlgorithm

The signature algorithm that the client must use to sign the nonce.

public static readonly DigestAlgorithm DigestAlgorithm

Retorno

DigestAlgorithm


Métodos

Complete(byte[], byte[], byte[], CertificateValidationOptions, out PKCertificate)

Completes an authentication.

public ValidationResults Complete(byte[] nonce, byte[] encodedCertificate, byte[] signature, CertificateValidationOptions certificateValidationOptions, out PKCertificate certificate)

Parâmetros

NomeTipoDescrição
noncebyte[]The nonce signed by the client.
encodedCertificatebyte[]The client's certificate binary encoding.
signaturebyte[]The signature of the nonce.
certificateValidationOptionsCertificateValidationOptionsCertificate validation options to use during the client's certificate validation.
certificatePKCertificateThe client's decoded certificate. If the authentication succeeds, this parameter is garanteed to be assigned to. If it fails, it may or may not be assigned to, depending on the stage on which the authentication failed.

Retorno

ValidationResults — Whether the authentication succeeded or not, that is, if the client's certificate can be trusted according to the certificate validation options passed.


Complete(byte[], byte[], byte[], ITrustArbitrator, out PKCertificate)

Completes an authentication.

public ValidationResults Complete(byte[] nonce, byte[] encodedCertificate, byte[] signature, ITrustArbitrator trustArbitrator, out PKCertificate certificate)

Parâmetros

NomeTipoDescrição
noncebyte[]The nonce signed by the client.
encodedCertificatebyte[]The client's certificate binary encoding.
signaturebyte[]The signature of the nonce.
trustArbitratorITrustArbitratorA trust arbitrator to determine if the certificate can be trusted.
certificatePKCertificateThe client's decoded certificate. If the authentication succeeds, this parameter is garanteed to be assigned to. If it fails, it may or may not be assigned to, depending on the stage on which the authentication failed.

Retorno

ValidationResults — Whether the authentication succeeded or not, that is, if the client's certificate can be trusted according to the trust arbitrator chosen.


CompleteAsync(byte[], byte[], byte[], CertificateValidationOptions, CancellationToken)

public Task<PKCertificateAuthenticationResult> CompleteAsync(byte[] nonce, byte[] encodedCertificate, byte[] signature, CertificateValidationOptions certificateValidationOptions, CancellationToken cancellationToken = default)

Parâmetros

NomeTipoDescrição
noncebyte[]
encodedCertificatebyte[]
signaturebyte[]
certificateValidationOptionsCertificateValidationOptions
cancellationTokenCancellationToken

Retorno

Task<PKCertificateAuthenticationResult>


CompleteAsync(byte[], byte[], byte[], ITrustArbitrator, CancellationToken)

public Task<PKCertificateAuthenticationResult> CompleteAsync(byte[] nonce, byte[] encodedCertificate, byte[] signature, ITrustArbitrator trustArbitrator, CancellationToken cancellationToken = default)

Parâmetros

NomeTipoDescrição
noncebyte[]
encodedCertificatebyte[]
signaturebyte[]
trustArbitratorITrustArbitrator
cancellationTokenCancellationToken

Retorno

Task<PKCertificateAuthenticationResult>


Start()

Starts an authentication, generating and storing a new cryptographic nonce.

public byte[] Start()

Retorno

byte[] — The nonce (16-byte byte array) that the client must digitally sign.


StartAsync(CancellationToken)

public Task<byte[]> StartAsync(CancellationToken cancellationToken = default)

Parâmetros

NomeTipoDescrição
cancellationTokenCancellationToken

Retorno

Task<byte[]>


Membros herdados

ToString(), Equals(object), Equals(object, object), ReferenceEquals(object, object), GetHashCode(), GetType(), MemberwiseClone()