The Labs \ Source Viewer \ SSCLI \ System.Security.Cryptography \ ICryptoTransform

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*
  16. *
  17. * ICryptoTransform.cs
  18. *
  19. * Author: bal
  20. *
  21. */
  22. namespace System.Security.Cryptography
  23. {
  24.     using System;
  25.     using System.IO;
  26.    
  27.     [System.Runtime.InteropServices.ComVisible(true)]
  28.     public interface ICryptoTransform : IDisposable
  29.     {
  30.        
  31.         int InputBlockSize {
  32.             get;
  33.         }
  34.        
  35.         int OutputBlockSize {
  36.             get;
  37.         }
  38.        
  39.         // CanTransformMultipleBlocks == true implies that TransformBlock() can accept any number
  40.         // of whole blocks, not just a single block. If CanTransformMultipleBlocks is false, you have
  41.         // to feed blocks one at a time.
  42.         bool CanTransformMultipleBlocks {
  43.             get;
  44.         }
  45.        
  46.         // If CanReuseTransform is true, then after a call to TransformFinalBlock() the transform
  47.         // resets its internal state to its initial configuration (with Key and IV loaded) and can
  48.         // be used to perform another encryption/decryption.
  49.         bool CanReuseTransform {
  50.             get;
  51.         }
  52.        
  53.         // The return value of TransformBlock is the number of bytes returned to outputBuffer and is
  54.         // always <= OutputBlockSize. If CanTransformMultipleBlocks is true, then inputCount may be
  55.         // any positive multiple of InputBlockSize
  56.         int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
  57.        
  58.         // Special function for transforming the last block or partial block in the stream. The
  59.         // return value is an array containting the remaining transformed bytes.
  60.         // We return a new array here because the amount of information we send back at the end could
  61.         // be larger than a single block once padding is accounted for.
  62.         byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount);
  63.     }
  64. }

Developer Fusion