コード例 #1
0
 /// <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);
 }
コード例 #2
0
 public ServerFirstMessage(int iterations, string nonce, byte[] salt)
 {
     Iterations = new IterationsAttribute(iterations);
     Nonce      = new NonceAttribute(nonce);
     Salt       = new SaltAttribute(salt);
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
 private ServerFirstMessage(IterationsAttribute iterations, NonceAttribute nonce, SaltAttribute salt)
 {
     Iterations = iterations;
     Nonce      = nonce;
     Salt       = salt;
 }
コード例 #5
0
        public void When_NonceCreatedWithClientAndServerNonces_ValueShouldBeValid()
        {
            var nonce = new NonceAttribute("client", "server");

            nonce.Value.ShouldBe("clientserver");
        }