Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_hmac != null)
                {
                    _hmac.Dispose();
                    _hmac = null !;
                }

                if (_buffer != null)
                {
                    Array.Clear(_buffer, 0, _buffer.Length);
                }
                if (_password != null)
                {
                    Array.Clear(_password, 0, _password.Length);
                }
                if (_salt != null)
                {
                    Array.Clear(_salt, 0, _salt.Length);
                }
            }
            base.Dispose(disposing);
        }
Example #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_hmac != null)
                {
                    _hmac.Dispose();
                    _hmac = null !;
                }

                if (_buffer != null)
                {
                    Array.Clear(_buffer);
                }
                if (_salt != null)
                {
                    Array.Clear(_salt);
                }
            }
            base.Dispose(disposing);
        }