SqlClientEncryptionAlgorithm.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. //------------------------------------------------------------------------------
  2. // <copyright file="SqlException.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. // <owner current="true" primary="true">balnee</owner>
  6. // <owner current="true" primary="false">krishnib</owner>
  7. //------------------------------------------------------------------------------
  8. namespace System.Data.SqlClient
  9. {
  10. using System;
  11. /// <summary>
  12. /// Abstract base class for all TCE encryption algorithms. It exposes two functions
  13. /// 1. Encrypt - This function is used by SqlClient under the covers to transparently encrypt TCE enabled column data.
  14. /// 2. Decrypt - This function is used by SqlClient under the covers to transparently decrypt TCE enabled column data.
  15. /// </summary>
  16. internal abstract class SqlClientEncryptionAlgorithm
  17. {
  18. /// <summary>
  19. /// Encrypts the plainText with a column encryption key
  20. /// </summary>
  21. /// <param name="plainText">Plain text value to be encrypted</param>
  22. /// <returns></returns>
  23. internal abstract byte[] EncryptData(byte[] plainText);
  24. /// <summary>
  25. /// Decrypts the cipherText with a column encryption key
  26. /// </summary>
  27. /// <param name="cipherText">Ciphertext value to be decrypted</param>
  28. /// <returns></returns>
  29. internal abstract byte[] DecryptData(byte[] cipherText);
  30. }
  31. }