KeyedHashAlgorithm CreateKeyedHashAlgorithm(SigningAlgorithm algorithmName)
{
KeyedHashAlgorithm algorithm;
switch (algorithmName)
{
case SigningAlgorithm.HmacSHA256:
algorithm = new HMACSHA256();
break;
case SigningAlgorithm.HmacSHA1:
algorithm = new HMACSHA1();
break;
default:
throw new Exception(string.Format("KeyedHashAlgorithm {0} was not found.", algorithmName.ToString()));
}
return algorithm;
}