Ejemplo n.º 1
0
        public void CreateHMACSHA1Key()
        {
            KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACSHA1).AssemblyQualifiedName);

            Assert.AreEqual(64, keyCreator.KeyLength);
            Assert.AreEqual(64, keyCreator.GenerateKey().Length);
            Assert.IsFalse(CryptographyUtility.CompareBytes(keyCreator.GenerateKey(), keyCreator.GenerateKey()));
        }
 public void CreateKeyCreatesValidKey()
 {
     KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5));
     Assert.IsTrue(keyCreator.KeyIsValid(keyCreator.GenerateKey()));
 }
 public void CreateKeyCreatesKeyOfDefaultSize()
 {
     KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5));
     Assert.AreEqual(keyCreator.KeyLength, keyCreator.GenerateKey().Length);
 }
Ejemplo n.º 4
0
 public void CreateKeyCreatesValidKey()
 {
     KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5));
     Assert.IsTrue(keyCreator.KeyIsValid(keyCreator.GenerateKey()));
 }
Ejemplo n.º 5
0
 public void CreateKeyCreatesKeyOfDefaultSize()
 {
     KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5));
     Assert.AreEqual(keyCreator.KeyLength, keyCreator.GenerateKey().Length);
 }