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);
}