System.Security.Cryptography.SymmetricAlgorithm.Clear C# (CSharp) Method

Clear() public method

public Clear ( ) : void
return void
        public void Clear()
        {
            (this as IDisposable).Dispose();
        }

Usage Example

Example #1
0
        public byte[] Encrypt(byte[] srcBuffer)
        {
            try
            {
                byte[]       buffer    = srcBuffer;       // srcStream.GetBuffer();
                int          bufferlen = buffer.Length;
                MemoryStream mStream   = new MemoryStream();
                CryptoStream cStream   = new CryptoStream(mStream, encryptor, CryptoStreamMode.Write);

                cStream.Write(buffer, 0, bufferlen);
                cStream.FlushFinalBlock();

                byte[] result = mStream.ToArray();
                cStream.Close();
                des.Clear();
                return(result);
            }
            catch (System.Exception ex)
            {
#if DEBUG
                throw ex;
#else
                log.Error(ex.ToString());
                return(null);
#endif
            }
        }
All Usage Examples Of System.Security.Cryptography.SymmetricAlgorithm::Clear