Table of Contents

Class ServerSignatureAttribute

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

Represents a server signature attribute in the SCRAM (Salted Challenge Response Authentication Mechanism) authentication process.

public sealed class ServerSignatureAttribute : ScramAttribute<byte[]>, IEquatable<ServerSignatureAttribute>
Inheritance
ServerSignatureAttribute
Implements
Inherited Members

Remarks

This attribute is used to store the server's computed signature and ensures the integrity of the SCRAM handshake. It is identified by the character 'v' as per the SCRAM specification.

Constructors

ServerSignatureAttribute(byte[])

Initializes a new instance of the ServerSignatureAttribute class.

public ServerSignatureAttribute(byte[] value)

Parameters

value byte[]

Byte array of the server signature.

ServerSignatureAttribute(string)

Initializes a new instance of the ServerSignatureAttribute class.

public ServerSignatureAttribute(string value)

Parameters

value string

String value of the server signature.

Methods

Equals(byte[]?)

Determines whether the current instance is equal to the specified byte array.

public bool Equals(byte[]? other)

Parameters

other byte[]

A byte array to compare with the current instance.

Returns

bool

True if the current instance is equal to the provided byte array; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current ServerSignatureAttribute instance.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if the specified object is equal to the current instance; otherwise, false.

Equals(ServerSignatureAttribute?)

Determines whether the specified ServerSignatureAttribute is equal to the current instance.

public bool Equals(ServerSignatureAttribute? other)

Parameters

other ServerSignatureAttribute

The ServerSignatureAttribute to compare with the current instance.

Returns

bool

true if the specified ServerSignatureAttribute is equal to the current instance; otherwise, false.

GetHashCode()

Generates the hash code for the current ServerSignatureAttribute instance.

public override int GetHashCode()

Returns

int

An integer representing the hash code of the ServerSignatureAttribute instance, which is derived from the signature value.

ToString()

Converts the attribute to its string representation.

public override string ToString()

Returns

string

The string representation of the attribute, including its name and value.

Operators

operator ==(ServerSignatureAttribute?, string?)

Compares a ServerSignatureAttribute instance with a string representation of a server signature.

public static bool operator ==(ServerSignatureAttribute? left, string? right)

Parameters

left ServerSignatureAttribute

The ServerSignatureAttribute instance to compare.

right string

The string representation of a server signature to compare against. A null or undecodable value is never equal, so a server that omitted the signature fails the comparison rather than throwing.

Returns

bool

true if the left instance's value matches the base64-decoded value of right; otherwise, false.

operator !=(ServerSignatureAttribute?, string?)

Compares a ServerSignatureAttribute instance with a string representation of a server signature for inequality.

public static bool operator !=(ServerSignatureAttribute? left, string? right)

Parameters

left ServerSignatureAttribute

The ServerSignatureAttribute instance to compare.

right string

The string representation of a server signature to compare against.

Returns

bool

true if the left instance's value does not match the base64-decoded value of right; otherwise, false.