MachineKey.Unprotect(Byte[], String[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Unprotects the specified data, which was protected by the Protect(Byte[], String[]) method.
public:
static cli::array <System::Byte> ^ Unprotect(cli::array <System::Byte> ^ protectedData, ... cli::array <System::String ^> ^ purposes);
public static byte[] Unprotect (byte[] protectedData, params string[] purposes);
static member Unprotect : byte[] * string[] -> byte[]
Public Shared Function Unprotect (protectedData As Byte(), ParamArray purposes As String()) As Byte()
Parameters
- protectedData
- Byte[]
The ciphertext data to unprotect.
- purposes
- 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(Byte[], String[]) method when the data was protected.
Returns
The plaintext data.
Exceptions
The protectedData
parameter is null.
The purposes array contains one or more white-space-only entries.
Possible causes include the following:
The protected data was tampered with.
The value of the
purposes
parameter is not the same as the value that was specified when the data was protected.The application is deployed to more than one server and is using auto-generated encryption keys.
Remarks
For information about this method, see the Protect method.