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
valuebyte[]Byte array of the server signature.
ServerSignatureAttribute(string)
Initializes a new instance of the ServerSignatureAttribute class.
public ServerSignatureAttribute(string value)
Parameters
valuestringString 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
otherbyte[]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
objobjectThe object to compare with the current instance.
Returns
- bool
trueif 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
otherServerSignatureAttributeThe ServerSignatureAttribute to compare with the current instance.
Returns
- bool
trueif 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
leftServerSignatureAttributeThe ServerSignatureAttribute instance to compare.
rightstringThe 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
trueif theleftinstance's value matches the base64-decoded value ofright; 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
leftServerSignatureAttributeThe ServerSignatureAttribute instance to compare.
rightstringThe string representation of a server signature to compare against.
Returns
- bool
trueif theleftinstance's value does not match the base64-decoded value ofright; otherwise,false.