Example #1
0
 public void Clear()
 {
     Password.TryClear(clearAfterUse: true);
     Salt.TryClear(clearAfterUse: true);
     InitialVector.TryClear(clearAfterUse: true);
     PasswordIterations = 0;
     KeySize            = 0;
 }
Example #2
0
        /// <summary>
        /// Implements <seealso cref="IDisposable.Dispose()"/>
        /// </summary>
        public void Dispose()
        {
            // Clear data
            try
            {
                Password.TryClear(clearAfterUse: true);
                Salt.TryClear(clearAfterUse: true);
                InitialVector.TryClear(clearAfterUse: true);
                PasswordIterations = 0;
                KeySize            = 0;
            }
            catch (Exception)
            {
                // ignored
            }

            OnDisposing();
        }