/// <summary> /// Initializes a new instance of the <see cref="ClientFirstMessage"/> class. /// </summary> /// <param name="username">Username of the user to authenticate.</param> /// <param name="nonce">String value of the client nonce.</param> public ClientFirstMessage(string username, string nonce) { Username = new UserAttribute(username); Nonce = new NonceAttribute(nonce); }
public ServerFirstMessage(int iterations, string nonce, byte[] salt) { Iterations = new IterationsAttribute(iterations); Nonce = new NonceAttribute(nonce); Salt = new SaltAttribute(salt); }
/// <summary> /// Initializes a new instance of the <see cref="ClientFinalMessage"/> class. /// </summary> /// <param name="clientFirstMessage">First client message.</param> /// <param name="serverFirstMessage">First server message.</param> public ClientFinalMessage(ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage) { Channel = new ChannelAttribute(clientFirstMessage.Gs2Header); Nonce = new NonceAttribute(serverFirstMessage.Nonce?.Value); }
private ServerFirstMessage(IterationsAttribute iterations, NonceAttribute nonce, SaltAttribute salt) { Iterations = iterations; Nonce = nonce; Salt = salt; }
public void When_NonceCreatedWithClientAndServerNonces_ValueShouldBeValid() { var nonce = new NonceAttribute("client", "server"); nonce.Value.ShouldBe("clientserver"); }