Windows apps
Collapse the table of content
Expand the table of content

ProtectedData.Unprotect Method (Byte[], Byte[])

.NET Framework (current version)

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

Namespace:  System.Security.Cryptography
Assembly:  mscorlib.Extensions (in mscorlib.Extensions.dll)

public static byte[] Unprotect(
	byte[] encryptedData,
	byte[] optionalEntropy
)

Parameters

encryptedData
Type: System.Byte[]

A byte array containing data encrypted using the Protect method.

optionalEntropy
Type: System.Byte[]

Optional data that was used to encrypt the original byte araay, or null if the additional data was not used.

Return Value

Type: System.Byte[]
A byte array representing the decrypted data.

ExceptionCondition
ArgumentNullException

The encryptedData parameter is null.

CryptographicException

The decryption failed.

NotSupportedException

The operating system does not support this method.

OutOfMemoryException

Out of memory.

Supported in: Windows Phone Silverlight 8
Show:
© 2017 Microsoft