コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the CkRsaPkcsOaepParams class.
 /// </summary>
 /// <param name='hashAlg'>Mechanism ID of the message digest algorithm used to calculate the digest of the encoding parameter (CKM)</param>
 /// <param name='mgf'>Mask generation function to use on the encoded block (CKG)</param>
 /// <param name='source'>Source of the encoding parameter (CKZ)</param>
 /// <param name='sourceData'>Data used as the input for the encoding parameter source</param>
 public CkRsaPkcsOaepParams(ulong hashAlg, ulong mgf, ulong source, byte[] sourceData)
 {
     if (Platform.UnmanagedLongSize == 4)
     {
         if (Platform.StructPackingSize == 0)
         {
             _params40 = new HighLevelAPI40.MechanismParams.CkRsaPkcsOaepParams(Convert.ToUInt32(hashAlg), Convert.ToUInt32(mgf), Convert.ToUInt32(source), sourceData);
         }
         else
         {
             _params41 = new HighLevelAPI41.MechanismParams.CkRsaPkcsOaepParams(Convert.ToUInt32(hashAlg), Convert.ToUInt32(mgf), Convert.ToUInt32(source), sourceData);
         }
     }
     else
     {
         if (Platform.StructPackingSize == 0)
         {
             _params80 = new HighLevelAPI80.MechanismParams.CkRsaPkcsOaepParams(hashAlg, mgf, source, sourceData);
         }
         else
         {
             _params81 = new HighLevelAPI81.MechanismParams.CkRsaPkcsOaepParams(hashAlg, mgf, source, sourceData);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the CkRsaPkcsOaepParams class.
 /// </summary>
 /// <param name='hashAlg'>Mechanism ID of the message digest algorithm used to calculate the digest of the encoding parameter (CKM)</param>
 /// <param name='mgf'>Mask generation function to use on the encoded block (CKG)</param>
 /// <param name='source'>Source of the encoding parameter (CKZ)</param>
 /// <param name='sourceData'>Data used as the input for the encoding parameter source</param>
 public CkRsaPkcsOaepParams(ulong hashAlg, ulong mgf, ulong source, byte[] sourceData)
 {
     if (Platform.UnmanagedLongSize == 4)
     {
         if (Platform.StructPackingSize == 0)
             _params40 = new HighLevelAPI40.MechanismParams.CkRsaPkcsOaepParams(Convert.ToUInt32(hashAlg), Convert.ToUInt32(mgf), Convert.ToUInt32(source), sourceData);
         else
             _params41 = new HighLevelAPI41.MechanismParams.CkRsaPkcsOaepParams(Convert.ToUInt32(hashAlg), Convert.ToUInt32(mgf), Convert.ToUInt32(source), sourceData);
     }
     else
     {
         if (Platform.StructPackingSize == 0)
             _params80 = new HighLevelAPI80.MechanismParams.CkRsaPkcsOaepParams(hashAlg, mgf, source, sourceData);
         else
             _params81 = new HighLevelAPI81.MechanismParams.CkRsaPkcsOaepParams(hashAlg, mgf, source, sourceData);
     }
 }
コード例 #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;
            }
        }