SslAuthentication Class

Represents an SSL/TLS authentication result.

Description

The SslAuthentication class provides information about the result of an SSL/TLS authentication process. It is typically used within the context of establishing secure network connections, such as those using HTTPS. This class encapsulates details like whether the authentication succeeded, any errors encountered, and the certificate used during the authentication.

When a client connects to a server using SSL/TLS, a handshake process occurs. During this handshake, the server presents its certificate to the client for validation. The SslAuthentication class helps represent the outcome of this validation, allowing applications to make decisions based on the security of the connection.

Syntax

public sealed class SslAuthentication

Inheritance Hierarchy

System.Object
System.Net.Security.SslAuthentication

Remarks

This class is immutable and its properties are populated during the SSL/TLS handshake. It is not intended for direct instantiation by the user. Instead, instances of SslAuthentication are returned by methods that perform SSL/TLS operations, such as asynchronous certificate validation callbacks.

Understanding the properties of SslAuthentication is crucial for implementing robust security in network applications. For example, you can check the IsValid property to determine if the authentication was successful and examine the SslPolicyErrors property for specific reasons for failure.

Note: The use of SSL/TLS is fundamental to securing network communications against eavesdropping and tampering. Always ensure your applications correctly handle and validate SSL/TLS certificates.

Constructors

This class has no public constructors.

Properties

Name Description
ClientCertificate Gets the X509Certificate2 object that represents the client certificate used for authentication. Returns null if no client certificate was provided or used.
IsMutuallyAuthenticated Gets a value indicating whether mutual authentication (both client and server authenticated each other) occurred.
IsValid Gets a value indicating whether the SSL/TLS authentication was successful.
RemoteCertificate Gets the X509Certificate2 object that represents the remote server's certificate.
SslPolicyErrors Gets a bitwise combination of SslPolicyErrors values that indicate the reasons for authentication failure.

Methods

Name Description
Equals(object obj) Determines whether the specified object is equal to the current object. (Inherited from System.Object)
GetHashCode() Serves as the default hash function. (Inherited from System.Object)
GetType() Gets the type of the current instance. (Inherited from System.Object)
ToString() Returns a string that represents the current object. (Inherited from System.Object)

See Also