System.Web.Util.MachineKeySectionUtils.GetDecryptionAlgorithm C# (CSharp) Method

GetDecryptionAlgorithm() public static method

public static GetDecryptionAlgorithm ( string name ) : SymmetricAlgorithm
name string
return System.Security.Cryptography.SymmetricAlgorithm
		public static SymmetricAlgorithm GetDecryptionAlgorithm (string name)
		{
			SymmetricAlgorithm sa = null;
			switch (name) {
			case "AES":
			case "Auto":
				sa = Rijndael.Create ();
				break;
			case "DES":
				sa = DES.Create ();
				break;
			case "3DES":
				sa = TripleDES.Create ();
				break;
			default:
#if NET_4_0
				if (name.StartsWith ("alg:"))
					sa = SymmetricAlgorithm.Create (name.Substring (4));
				else
#endif
				{
#if NET_2_0
					throw new ConfigurationErrorsException ();
#else
					throw new HttpException ("Unknown encryption algorithm name.");
#endif
				}
#if NET_4_0
				break;
#endif
			}
			return sa;
		}