Unprotect() 공개 정적인 메소드

public static Unprotect ( byte encryptedData, byte optionalEntropy, DataProtectionScope scope ) : byte[]
encryptedData byte
optionalEntropy byte
scope DataProtectionScope
리턴 byte[]
예제 #1
0
 /// <summary>
 ///     Unprotects the specified encrypted data by applying an decryption algorthim specified by the
 ///     <see cref="DataProtectionScope" />.
 /// </summary>
 /// <param name="encryptedData">The encrypted data.</param>
 /// <param name="optionalEntropy">The optional entropy.</param>
 /// <param name="scope">The scope.</param>
 /// <returns>
 ///     The unencrypted byte array, otherwise the original encrypted byte array.
 /// </returns>
 /// <exception cref="ArgumentNullException">The encryptedData parameter is null.</exception>
 /// <exception cref="CryptographicException">The cryptographic protection failed.</exception>
 /// <exception cref="PlatformNotSupportedException">The operating system does not support this method.</exception>
 /// <exception cref="OutOfMemoryException">Out of memory.</exception>
 public static byte[] Unprotect(byte[] encryptedData, string optionalEntropy, DataProtectionScope scope)
 {
     byte[] salt = (!string.IsNullOrEmpty(optionalEntropy)) ? Encoding.Unicode.GetBytes(optionalEntropy) : null;
     byte[] data = ProtectedData.Unprotect(encryptedData, salt, scope);
     return(data);
 }
예제 #2
0
 protected override byte[] ProviderUnprotect(byte[] encryptedData)
 {
     // Delegate to ProtectedData
     return(ProtectedData.Unprotect(encryptedData, GetHashedPurpose(), Scope));
 }