/// <summary>Creates a HashAlgorithm used by this SPI.</summary> public HashAlgorithm CreateHashAlgorithm() { HashAlgorithm ha = null; if (Authenticator.Equals("NullHash")) { ha = new NullHash(); } else { ha = HashAlgorithm.Create(Authenticator); if (ha == null) { ha = KeyedHashAlgorithm.Create(Authenticator); } } if (ha == null) { throw new Exception("Unsupported authentication method: " + Authenticator); } return(ha); }
/// <summary>Creates a HashAlgorithm used by this SPI.</summary> public HashAlgorithm CreateHashAlgorithm() { HashAlgorithm ha = null; if(Authenticator.Equals("NullHash")) { ha = new NullHash(); } else { ha = HashAlgorithm.Create(Authenticator); if(ha == null) { ha = KeyedHashAlgorithm.Create(Authenticator); } } if(ha == null) { throw new Exception("Unsupported authentication method: " + Authenticator); } return ha; }