Пример #1
0
 public static string GeneratorKey()
 {
     return(HMAC.GeneratorKey("HMAC-MD5"));
 }
Пример #2
0
 /// <summary>
 /// 生成签名
 /// </summary>
 public static byte[] GeneratorKey()
 {
     return(HMAC.GeneratorKey(Algorithms.HMacSHA256));
 }
Пример #3
0
 public static string GeneratorKey()
 {
     return(HMAC.GeneratorKey("HMac/SHA1"));
 }
Пример #4
0
 /// <summary>
 /// 哈希计算(使用BouncyCastle)
 /// </summary>
 public static byte[] Compute(string data, byte[] key)
 {
     return(HMAC.Compute(data, key, Algorithms.HMacMD5));
     //or
     //return HMAC.Compute(data, key, new MD5Digest());
 }