[System.Security.SecuritySafeCritical]  // auto-generated
        protected override void Dispose(bool disposing) {
            base.Dispose(disposing);

            if (disposing && m_ownsHandle) {
                m_safeProvHandle.Dispose();
            }
        }
Beispiel #2
0
        [System.Security.SecurityCritical]  // auto-generated
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                // We need to always zeroize the following fields because they contain sensitive data
                if (_rgbKey != null)
                {
                    Array.Clear(_rgbKey, 0, _rgbKey.Length);
                    _rgbKey = null;
                }
                if (IVValue != null)
                {
                    Array.Clear(IVValue, 0, IVValue.Length);
                    IVValue = null;
                }
                if (_depadBuffer != null)
                {
                    Array.Clear(_depadBuffer, 0, _depadBuffer.Length);
                    _depadBuffer = null;
                }

                if (_safeKeyHandle != null && !_safeKeyHandle.IsClosed)
                {
                    _safeKeyHandle.Dispose();
                }
                if (_safeProvHandle != null && !_safeProvHandle.IsClosed)
                {
                    _safeProvHandle.Dispose();
                }
            }
        }
Beispiel #3
0
        [System.Security.SecuritySafeCritical] // overrides public transparent member
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (_safeKeyHandle != null && !_safeKeyHandle.IsClosed)
            {
                _safeKeyHandle.Dispose();
            }
            if (_safeProvHandle != null && !_safeProvHandle.IsClosed)
            {
                _safeProvHandle.Dispose();
            }
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                SafeCapiKeyHandle hKey = _hKey;
                if (hKey != null)
                {
                    _hKey = null !;
                    hKey.Dispose();
                }

                SafeProvHandle hProvider = _hProvider;
                if (hProvider != null)
                {
                    _hProvider = null !;
                    hProvider.Dispose();
                }
            }

            base.Dispose(disposing);
        }
Beispiel #5
0
 /// <summary>
 /// Освобождение ресурсов занятых экземпляром класса.
 /// </summary>
 ///
 /// <param name="disposing"><see langword="true"/>, если разрешен
 /// доступ к другим объектам, <see langword="false"/> - другие
 /// объекты могут быть уничтожены.
 /// </param>
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_ivValue != null)
         {
             Array.Clear(_ivValue, 0, _ivValue.Length);
             _ivValue = null;
         }
         if (depadBuffer_ != null)
         {
             Array.Clear(depadBuffer_, 0, depadBuffer_.Length);
             depadBuffer_ = null;
         }
     }
     if ((safeKeyHandle_ != null) && !safeKeyHandle_.IsClosed)
     {
         safeKeyHandle_.Dispose();
     }
     if ((_safeProvHandle != null) && !_safeProvHandle.IsClosed)
     {
         _safeProvHandle.Dispose();
     }
 }