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 KeyWithZeroLEngthDoesNotPassValidation() { KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5)); Assert.IsFalse(keyCreator.KeyIsValid(new byte[0])); }
public void NullKeyDoesNotPassValidation() { KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5)); Assert.IsFalse(keyCreator.KeyIsValid(null)); }
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); }
public void KeyWithZeroLEngthDoesNotPassValidation() { KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5)); Assert.IsFalse(keyCreator.KeyIsValid(new byte[0])); }
public void NullKeyDoesNotPassValidation() { KeyedHashAlgorithmKeyCreator keyCreator = new KeyedHashAlgorithmKeyCreator(typeof(HMACMD5)); Assert.IsFalse(keyCreator.KeyIsValid(null)); }
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); }