DataProtectionUnprotect Method

Decrypts the data in a specified byte array and returns a byte array that contains the decrypted data.

Definition

Namespace: Gemstone.Security.Cryptography
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.150 -- Release Build+64e3b411e1abfbd2d4d8a81e850c3909a0ce8731
public static byte[] Unprotect(
	byte[] encryptedData,
	byte[]? optionalEntropy = null,
	bool protectToLocalMachine = true,
	string settingsCategory = "CryptographyServices"
)

Parameters

encryptedData  Byte
A byte array containing data encrypted using the Protect(Byte, Byte, Boolean, String) method.
optionalEntropy  Byte  (Optional)
An optional additional byte array that was used to encrypt the data, or null if the additional byte array was not used.
protectToLocalMachine  Boolean  (Optional)
Set to true to protect data to the local machine; otherwise, set to false to protect data to the current user.
settingsCategory  String  (Optional)
The config file settings category under which the settings are defined.

Return Value

Byte
A byte array representing the decrypted data.

Exceptions

ArgumentNullExceptionThe encryptedData parameter is null.
CryptographicExceptionThe decryption failed.

See Also