Namespace: System.Net.Security
Assembly: System.Net.Primitives (in System.Net.Primitives.dll)
Inheritance: Object > MarshalByRefObject > ChannelBinding
Implements: IDisposable
The ChannelBinding class provides an abstract base class that represents a channel binding token (CBT). CBTs are used in Transport Layer Security (TLS) to bind security credentials to the transport channel. This helps to prevent man-in-the-middle attacks by ensuring that the client and server are communicating with each other and not an imposter.
Implementations of this abstract class are provided for specific TLS binding scenarios, such as when using TLS with Transport Layer Security (TLS) over HTTP. The ChannelBinding class itself cannot be instantiated directly; you must use one of its derived classes, such as TlsClientChannelBinding or TlsServerChannelBinding.
| Name | Description |
|---|---|
Size |
Gets the size, in bytes, of the channel binding token. |
| Name | Description |
|---|---|
Dispose() |
Releases all resources used by the current instance of the ChannelBinding class. |
GetBufferPointer() |
Gets a pointer to the buffer containing the channel binding token data. This is an unsafe operation and should be used with caution. |
| Name | Description |
|---|---|
Dispose(Boolean disposing) |
Releases the unmanaged resources used by the ChannelBinding and optionally releases the managed resources. |
The ChannelBinding class is a fundamental component for enabling enhanced security in network communications. By associating a token with the underlying transport, it provides an additional layer of assurance against spoofing and man-in-the-middle attacks, especially in scenarios where authentication relies on external trust mechanisms or when dealing with proxy servers.
The primary use case for ChannelBinding is within the context of TLS/SSL. It allows applications to verify that the TLS session established is indeed with the intended peer by comparing the channel binding token generated on both sides.
Important: The GetBufferPointer() method is an unsafe operation. It returns a raw pointer to the internal buffer. Direct manipulation of this memory can lead to security vulnerabilities and crashes if not handled correctly. Use this method only when absolutely necessary and with proper unmanaged code safety practices.
While ChannelBinding is abstract, here's a conceptual illustration of how you might interact with its derived classes:
Related Topics: