Class CertificateAuthentication
- Namespace
- NuvTools.Security.Certificate
- Assembly
- NuvTools.Security.dll
Result of validating a signed certificate challenge.
public sealed record CertificateAuthentication : IEquatable<CertificateAuthentication>
- Inheritance
-
CertificateAuthentication
- Implements
- Inherited Members
Constructors
CertificateAuthentication(bool, CertificateSubject?, CertificateFailureType)
Result of validating a signed certificate challenge.
public CertificateAuthentication(bool Valid, CertificateSubject? Subject, CertificateFailureType Failure)
Parameters
ValidboolWhether the provider confirmed possession of the private key and the certificate's trust chain.
SubjectCertificateSubjectWho the certificate was issued to. Set only when
Validistrue.FailureCertificateFailureTypeWhy the authentication failed, or None.
Properties
Failure
Why the authentication failed, or None.
public CertificateFailureType Failure { get; init; }
Property Value
Subject
Who the certificate was issued to. Set only when Valid is true.
public CertificateSubject? Subject { get; init; }
Property Value
Valid
Whether the provider confirmed possession of the private key and the certificate's trust chain.
public bool Valid { get; init; }
Property Value
Methods
Failed(CertificateFailureType)
Creates the result of an authentication that did not go through.
public static CertificateAuthentication Failed(CertificateFailureType failure)
Parameters
failureCertificateFailureTypeWhy it failed.
Returns
Succeeded(CertificateSubject)
Creates the result of an authentication the provider accepted.
public static CertificateAuthentication Succeeded(CertificateSubject subject)
Parameters
subjectCertificateSubjectWho the certificate was issued to.