Exemple #1
0
        public Client(Stream stream, Hash hash, string username, string password) : base(stream, hash)
        {
            _username = username;
            _password = SaslPrep.Run(password);

            _nonce = CreateNonce();
        }
Exemple #2
0
 public void When_PassedInvalidCharacters_ShouldThrowAnException()
 {
     Should.Throw <ProhibitedValueException>(() =>
     {
         var _ = SaslPrep.Run("\u0007");
     });
 }
Exemple #3
0
 public void When_PassedBidiCharacters_ShouldThrowAnException()
 {
     Should.Throw <BidirectionalFormatException>(() =>
     {
         var _ = SaslPrep.Run("\u0627\u0031");
     });
 }
Exemple #4
0
        public void Sign(string password)
        {
            var messageBytes = GetAsBytes(24);

            var saslPassword = SaslPrep.Process(password);

            MessageIntegrity = new MessageIntegrityAttribute
            {
                Value = new HMACSHA1(Encoding.UTF8.GetBytes(saslPassword)).ComputeHash(messageBytes)
            };
        }
Exemple #5
0
        public void When_PassedUnicode_ShouldOutputCharacters(string input, string result)
        {
            var output = SaslPrep.Run(input);

            output.ShouldBe(result);
        }