System.Web.Security.FormsAuthentication.Decrypt2 C# (CSharp) Method

Decrypt2() static private method

static private Decrypt2 ( byte bytes ) : System.Web.Security.FormsAuthenticationTicket
bytes byte
return System.Web.Security.FormsAuthenticationTicket
		static FormsAuthenticationTicket Decrypt2 (byte [] bytes)
		{
			if (protection == FormsProtectionEnum.None)
				return FormsAuthenticationTicket.FromByteArray (bytes);

			MachineKeySection config = (MachineKeySection) WebConfigurationManager.GetWebApplicationSection (machineKeyConfigPath);
			byte [] result = null;
			if (protection == FormsProtectionEnum.All) {
				result = MachineKeySectionUtils.VerifyDecrypt (config, bytes);
			} else if (protection == FormsProtectionEnum.Encryption) {
				result = MachineKeySectionUtils.Decrypt (config, bytes);
			} else if (protection == FormsProtectionEnum.Validation) {
				result = MachineKeySectionUtils.Verify (config, bytes);
			}

			return FormsAuthenticationTicket.FromByteArray (result);
		}