最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
.net Compact Flamework中MD5CryptoServiceProvider的实现
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
最近出于工作需要对MD5CryptoServiceProvider进行了实现,这个类的接口和完整版下面的接口完全一致。
Implementation of the "System.Security.Cryptography.MD5CryptoServiceProvider" class.
public sealed class MD5CryptoServiceProvider : MD5
{
public MD5CryptoServiceProvider()
{
Initialize();
m_Disposed = false;
}
public override void Initialize()
{
if (m_Disposed)
throw new ObjectDisposedException(this.GetType().FullName);
if (m_Hash != IntPtr.Zero)
{
Crypto.CryptDestroyHash(m_Hash);
}
m_Prov = Crypto.AcquireContext(ProvType.RSA_FULL);
bool retVal=Crypto.CryptCreateHash(m_Prov, (uint)CalgHash.MD5, IntPtr.Zero, 0, out m_Hash);
}
protected override void HashCore(byte[] array, int ibStart, int cbSize)
{
if (m_Disposed)
-
上一个: ASP.NET设计网络硬盘之查看文件夹
-
下一个: ASP.NET设计网络硬盘之文件夹实现