MachineKey.Unprotect Method
Unprotects the specified data, which was protected by the Protect method.
Assembly: System.Web (in System.Web.dll)
Parameters
- protectedData
- Type: System.Byte[]
The ciphertext data to unprotect.
- purposes
- Type: System.String[]
A list of purposes that describe what the data is meant for. This must be the same value that was passed to the Protect method when the data was protected.
| Exception | Condition |
|---|---|
| ArgumentNullException | The protectedData parameter is null. |
| ArgumentException | The purposes array contains one or more whitespace-only entries. |
| CryptographicException | Possible causes include the following:
|
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.