summary para Decrypt the given data para summary param name cipherText

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
/// <summary>
/// <para>Decrypt the given data.</para>
/// </summary>
/// <param name="cipherText"><para>The cipher text that will be decrypted.</para></param>
/// <param name="entropy"><para>The entropy that was used to salt the phrase.</para></param>
/// <returns><para>The resulting plain text.</para></returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="cipherText"/> is null.</exception>
/// <exception cref="ArgumentException">Thrown when <paramref name="cipherText"/> is empty.</exception>
/// <exception cref="InvalidOperationException">Thrown when attempt is made to DPAPI-decrypt data
/// using LocalMachine scope and null entropy.</exception>
public byte[] Decrypt(byte[] cipherText, byte[] entropy)
{
if (cipherText == null) throw new ArgumentNullException("cipherText");
if (cipherText.Length == 0) throw new ArgumentException(Resources.ExceptionByteArrayValueMustBeGreaterThanZeroBytes, "cipherText");
return ProtectedData.Unprotect(cipherText, entropy, storeScope);
}