Table of Contents

Class Gs2Attribute

Namespace
Ubiety.Scram.Core.Attributes
Assembly
Ubiety.Scram.Core.dll

Represents the GS2 attribute used in the SCRAM (Salted Challenge Response Authentication Mechanism) protocol to indicate the channel binding status.

public class Gs2Attribute : ScramAttribute
Inheritance
Gs2Attribute
Inherited Members

Constructors

Gs2Attribute()

Initializes a new instance of the Gs2Attribute class.

public Gs2Attribute()

Gs2Attribute(string)

Initializes a new instance of the Gs2Attribute class.

public Gs2Attribute(string header)

Parameters

header string

The gs2-cbind-flag as it appeared on the wire: "n", "y", or "p=<cb-name>", without the trailing separators.

Exceptions

FormatException

Thrown when the flag is empty, is not one RFC 5802 defines, or names a channel binding type this library does not implement.

Gs2Attribute(ChannelBindingStatus, TlsVersion)

Initializes a new instance of the Gs2Attribute class.

public Gs2Attribute(ChannelBindingStatus bindingStatus, TlsVersion version)

Parameters

bindingStatus ChannelBindingStatus

Channel binding status.

version TlsVersion

TLS version of the socket.

Exceptions

ArgumentOutOfRangeException

Thrown when either value is not one the enum defines. Rejecting it here keeps the header this attribute renders honest, rather than falling back to a flag the caller did not ask for.

Properties

ChannelBindingStatus

Gets the channel binding status in the SCRAM (Salted Challenge Response Authentication Mechanism) protocol.

public ChannelBindingStatus ChannelBindingStatus { get; }

Property Value

ChannelBindingStatus

Version

Gets the TLS version of the socket.

public TlsVersion Version { get; }

Property Value

TlsVersion

Methods

ToString()

Returns the string representation of the Gs2Attribute object based on its current channel binding status.

public override string ToString()

Returns

string

A string that corresponds to the ChannelBindingStatus value of the object.

Operators

implicit operator string(Gs2Attribute)

Converts the specified Gs2Attribute instance to its string representation.

public static implicit operator string(Gs2Attribute attribute)

Parameters

attribute Gs2Attribute

The GS2 attribute to be converted into a string.

Returns

string

A string representation of the GS2 attribute.