public static byte[] ComputeKeyedHash(IntPtr prov, CalgHash algId, byte [] data, IntPtr key) { IntPtr hash = CreateHash(prov, algId, key); HashData(hash, data); byte [] baHash = GetHashParam(hash); DestroyHash(hash); return baHash; }
public static IntPtr CreateHash(IntPtr prov, CalgHash algId, IntPtr key) { uint flags = 0; IntPtr hash; bool retVal = NativeMethods.CryptCreateHash(prov, (uint)algId, key, flags, out hash); ErrCode ec = Error.HandleRetVal(retVal); return(hash); }
public static byte[] ComputeKeyedHash(CalgHash algId, byte [] data, IntPtr key) { //dont have to specify enhanced provider, //because hash sizes i care about dont change IntPtr prov = Context.AcquireContext(ProvType.RSA_FULL); byte [] baHash = ComputeKeyedHash(prov, algId, data, key); Context.ReleaseContext(prov); return baHash; }
public static byte [] ComputeKeyedHash(IntPtr prov, CalgHash algId, byte [] data, IntPtr key) { IntPtr hash = CreateHash(prov, algId, key); HashData(hash, data); byte [] baHash = GetHashParam(hash); DestroyHash(hash); return(baHash); }
public static byte [] ComputeKeyedHash(CalgHash algId, byte [] data, IntPtr key) { //dont have to specify enhanced provider, //because hash sizes i care about dont change IntPtr prov = Context.AcquireContext(ProvType.RSA_FULL); byte [] baHash = ComputeKeyedHash(prov, algId, data, key); Context.ReleaseContext(prov); return(baHash); }
public static IntPtr CreateHash(IntPtr prov, CalgHash algId, IntPtr key) { uint flags = 0; IntPtr hash; bool retVal = Crypto.CryptCreateHash(prov, (uint) algId, key, flags, out hash); ErrCode ec = Error.HandleRetVal(retVal); return hash; }
public static IntPtr CreateHash(IntPtr prov, CalgHash algId) { IntPtr key = IntPtr.Zero; //non-keyed hash return CreateHash(prov, algId, key); }
public static byte[] ComputeHash(IntPtr prov, CalgHash algId, byte [] data) { IntPtr key = IntPtr.Zero; return ComputeKeyedHash(prov, algId, data, key); }
public static IntPtr CreateHash(IntPtr prov, CalgHash algId) { IntPtr key = IntPtr.Zero; //non-keyed hash return(CreateHash(prov, algId, key)); }
public static byte [] ComputeHash(IntPtr prov, CalgHash algId, byte [] data) { IntPtr key = IntPtr.Zero; return(ComputeKeyedHash(prov, algId, data, key)); }