Table of Contents

Class ServerFirstMessage

Namespace
Ubiety.Scram.Core.Messages
Assembly
Ubiety.Scram.Core.dll

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

iterations int

Iterations to use when hashing the password.

nonce string

String value of the server nonce.

salt byte[]

Byte array of the password salt.

message string

Message 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

iterations int

Iterations to use when hashing the password.

nonce string

String value of the server nonce.

salt string

String value of the password salt.

message string

Message received from the server.

Properties

Iterations

Gets the number of iterations for the SCRAM authentication process.

public IterationsAttribute? Iterations { get; }

Property Value

IterationsAttribute

Nonce

Gets the nonce used in the SCRAM authentication process.

public NonceAttribute? Nonce { get; }

Property Value

NonceAttribute

Salt

Gets the salt value used in the SCRAM authentication process.

public SaltAttribute? Salt { get; }

Property Value

SaltAttribute

Methods

Parse(string)

Parses the given SCRAM server first message string and returns a ServerFirstMessage instance.

public static ServerFirstMessage Parse(string message)

Parameters

message string

The 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

message string

The message to parse.

firstMessage ServerFirstMessage

The 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

message byte[]

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

message string

The 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.