Ejemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (disposing)
         {
             // Note: we always want to zeroize the sensitive key material
             if (KeyValue != null)
             {
                 if (OwnsKey)
                 {
                     //Array.Clear(KeyValue, 0, KeyValue.Length);
                     KeyValue.Dispose();
                 }
                 KeyValue = null;
             }
             if (IVValue != null)
             {
                 Array.Clear(IVValue, 0, IVValue.Length);
                 IVValue = null;
             }
         }
     }
     finally
     {
         base.Dispose(disposing);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources.
 /// </summary>
 /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (disposing)
         {
             if (OwnsKeyPair && KeyPairValue != null)
             {
                 KeyPairValue.Dispose();
             }
         }
     }
     finally
     {
         base.Dispose(disposing);
     }
 }
Ejemplo n.º 3
0
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    if (KeyValue != null && OwnsKey)
                    {
                        KeyValue.Dispose();
                    }

                    if (m_ownsSession && m_session != null)
                    {
                        m_session.Dispose();
                    }
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }