Пример #1
0
 /// <summary>
 /// Initializes a new instance of the CkPbeParams class.
 /// </summary>
 /// <param name='initVector'>8-byte initialization vector (IV), if an IV is required</param>
 /// <param name='password'>Password to be used in the PBE key generation</param>
 /// <param name='salt'>Salt to be used in the PBE key generation</param>
 /// <param name='iteration'>Number of iterations required for the generation</param>
 public CkPbeParams(byte[] initVector, byte[] password, byte[] salt, ulong iteration)
 {
     if (Platform.UnmanagedLongSize == 4)
     {
         if (Platform.StructPackingSize == 0)
         {
             _params40 = new HighLevelAPI40.MechanismParams.CkPbeParams(initVector, password, salt, Convert.ToUInt32(iteration));
         }
         else
         {
             _params41 = new HighLevelAPI41.MechanismParams.CkPbeParams(initVector, password, salt, Convert.ToUInt32(iteration));
         }
     }
     else
     {
         if (Platform.StructPackingSize == 0)
         {
             _params80 = new HighLevelAPI80.MechanismParams.CkPbeParams(initVector, password, salt, iteration);
         }
         else
         {
             _params81 = new HighLevelAPI81.MechanismParams.CkPbeParams(initVector, password, salt, iteration);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the CkPbeParams class.
 /// </summary>
 /// <param name='initVector'>8-byte initialization vector (IV), if an IV is required</param>
 /// <param name='password'>Password to be used in the PBE key generation</param>
 /// <param name='salt'>Salt to be used in the PBE key generation</param>
 /// <param name='iteration'>Number of iterations required for the generation</param>
 public CkPbeParams(byte[] initVector, byte[] password, byte[] salt, ulong iteration)
 {
     if (Platform.UnmanagedLongSize == 4)
     {
         if (Platform.StructPackingSize == 0)
             _params40 = new HighLevelAPI40.MechanismParams.CkPbeParams(initVector, password, salt, Convert.ToUInt32(iteration));
         else
             _params41 = new HighLevelAPI41.MechanismParams.CkPbeParams(initVector, password, salt, Convert.ToUInt32(iteration));
     }
     else
     {
         if (Platform.StructPackingSize == 0)
             _params80 = new HighLevelAPI80.MechanismParams.CkPbeParams(initVector, password, salt, iteration);
         else
             _params81 = new HighLevelAPI81.MechanismParams.CkPbeParams(initVector, password, salt, iteration);
     }
 }
Пример #3
0
        /// <summary>
        /// Disposes object
        /// </summary>
        /// <param name="disposing">Flag indicating whether managed resources should be disposed</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!this._disposed)
            {
                if (disposing)
                {
                    // Dispose managed objects
                    if (_params40 != null)
                    {
                        _params40.Dispose();
                        _params40 = null;
                    }

                    if (_params41 != null)
                    {
                        _params41.Dispose();
                        _params41 = null;
                    }

                    if (_params80 != null)
                    {
                        _params80.Dispose();
                        _params80 = null;
                    }

                    if (_params81 != null)
                    {
                        _params81.Dispose();
                        _params81 = null;
                    }
                }

                // Dispose unmanaged objects

                _disposed = true;
            }
        }
Пример #4
0
        /// <summary>
        /// Disposes object
        /// </summary>
        /// <param name="disposing">Flag indicating whether managed resources should be disposed</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!this._disposed)
            {
                if (disposing)
                {
                    // Dispose managed objects
                    if (_params40 != null)
                    {
                        _params40.Dispose();
                        _params40 = null;
                    }

                    if (_params41 != null)
                    {
                        _params41.Dispose();
                        _params41 = null;
                    }

                    if (_params80 != null)
                    {
                        _params80.Dispose();
                        _params80 = null;
                    }

                    if (_params81 != null)
                    {
                        _params81.Dispose();
                        _params81 = null;
                    }
                }
                
                // Dispose unmanaged objects

                _disposed = true;
            }
        }