PKCertificateAuthentication
Namespace: Lacuna.Pki
Assembly: Lacuna.Pki
Class
Helper class to implement public-key certificate authentication.
public class PKCertificateAuthentication
Hierarquia: object → PKCertificateAuthentication
Construtores
PKCertificateAuthentication(IAsyncNonceStore)
public PKCertificateAuthentication(IAsyncNonceStore asyncStore)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
asyncStore | IAsyncNonceStore |
PKCertificateAuthentication(INonceStore)
public PKCertificateAuthentication(INonceStore store)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
store | INonceStore |
Campos
DigestAlgorithm
The signature algorithm that the client must use to sign the nonce.
public static readonly DigestAlgorithm DigestAlgorithm
Retorno
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
| Nome | Tipo | Descrição |
|---|---|---|
nonce | byte[] | The nonce signed by the client. |
encodedCertificate | byte[] | The client's certificate binary encoding. |
signature | byte[] | The signature of the nonce. |
certificateValidationOptions | CertificateValidationOptions | Certificate validation options to use during the client's certificate validation. |
certificate | PKCertificate | The 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
| Nome | Tipo | Descrição |
|---|---|---|
nonce | byte[] | The nonce signed by the client. |
encodedCertificate | byte[] | The client's certificate binary encoding. |
signature | byte[] | The signature of the nonce. |
trustArbitrator | ITrustArbitrator | A trust arbitrator to determine if the certificate can be trusted. |
certificate | PKCertificate | The 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
| Nome | Tipo | Descrição |
|---|---|---|
nonce | byte[] | |
encodedCertificate | byte[] | |
signature | byte[] | |
certificateValidationOptions | CertificateValidationOptions | |
cancellationToken | CancellationToken |
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
| Nome | Tipo | Descrição |
|---|---|---|
nonce | byte[] | |
encodedCertificate | byte[] | |
signature | byte[] | |
trustArbitrator | ITrustArbitrator | |
cancellationToken | CancellationToken |
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
| Nome | Tipo | Descrição |
|---|---|---|
cancellationToken | CancellationToken |
Retorno
Membros herdados
ToString(), Equals(object), Equals(object, object), ReferenceEquals(object, object), GetHashCode(), GetType(), MemberwiseClone()