Class ServerFirstMessage
Represents the first message sent by the server in the SCRAM (Salted Challenge Response Authentication Mechanism) authentication process.
public class ServerFirstMessage
- Inheritance
-
ServerFirstMessage
- Inherited Members
Constructors
ServerFirstMessage(int, string, byte[], string)
Initializes a new instance of the ServerFirstMessage class.
public ServerFirstMessage(int iterations, string nonce, byte[] salt, string message)
Parameters
iterationsintIterations to use when hashing the password.
noncestringString value of the server nonce.
saltbyte[]Byte array of the password salt.
messagestringMessage received from the server.
ServerFirstMessage(int, string, string, string)
Initializes a new instance of the ServerFirstMessage class.
public ServerFirstMessage(int iterations, string nonce, string salt, string message)
Parameters
iterationsintIterations to use when hashing the password.
noncestringString value of the server nonce.
saltstringString value of the password salt.
messagestringMessage received from the server.
Properties
Iterations
Gets the number of iterations for the SCRAM authentication process.
public IterationsAttribute? Iterations { get; }
Property Value
Nonce
Gets the nonce used in the SCRAM authentication process.
public NonceAttribute? Nonce { get; }
Property Value
Salt
Gets the salt value used in the SCRAM authentication process.
public SaltAttribute? Salt { get; }
Property Value
Methods
Parse(string)
Parses the given SCRAM server first message string and returns a ServerFirstMessage instance.
public static ServerFirstMessage Parse(string message)
Parameters
messagestringThe SCRAM server first message as a string to be parsed.
Returns
- ServerFirstMessage
An instance of ServerFirstMessage created from the parsed message.
Exceptions
- MessageParseException
Thrown when the message cannot be parsed.
TryParse(string, out ServerFirstMessage)
Attempts to parse the specified message into a ServerFirstMessage instance.
[UsedImplicitly]
public static bool TryParse(string message, out ServerFirstMessage firstMessage)
Parameters
messagestringThe message to parse.
firstMessageServerFirstMessageThe resulting ServerFirstMessage instance if parsing is successful.
Returns
- bool
true if the message is successfully parsed; otherwise, false.
Operators
implicit operator ServerFirstMessage(byte[])
Implicitly converts a byte array to a ServerFirstMessage instance by parsing it.
public static implicit operator ServerFirstMessage(byte[] message)
Parameters
messagebyte[]The SCRAM server first message as a byte array to convert.
Returns
- ServerFirstMessage
A new ServerFirstMessage instance parsed from the message.
Exceptions
- MessageParseException
Thrown when the message cannot be parsed.
implicit operator ServerFirstMessage(string)
Implicitly converts a string to a ServerFirstMessage instance by parsing it.
public static implicit operator ServerFirstMessage(string message)
Parameters
messagestringThe SCRAM server first message string to convert.
Returns
- ServerFirstMessage
A new ServerFirstMessage instance parsed from the message.
Exceptions
- MessageParseException
Thrown when the message cannot be parsed.