Amazon.Util.CryptoUtilFactory.CryptoUtil.CreateKeyedHashAlgorithm C# (CSharp) Метод

CreateKeyedHashAlgorithm() приватный Метод

private CreateKeyedHashAlgorithm ( SigningAlgorithm algorithmName ) : KeyedHashAlgorithm
algorithmName SigningAlgorithm
Результат KeyedHashAlgorithm
            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;
            }