Package com.weicoder.common.crypto
Class HMac
- java.lang.Object
-
- com.weicoder.common.crypto.HMac
-
public final class HMac extends java.lang.Objecthmac算法- Author:
- WD
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]sha1(byte[] b)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static byte[]sha1(byte[] b, java.lang.String key)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static java.lang.Stringsha1(java.lang.String text)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static byte[]sha256(byte[] b)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static java.lang.Stringsha256(java.lang.String text)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static byte[]sha384(byte[] b)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static java.lang.Stringsha384(java.lang.String text)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static byte[]sha512(byte[] b)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.static java.lang.Stringsha512(java.lang.String text)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
-
-
-
Method Detail
-
sha1
public static java.lang.String sha1(java.lang.String text)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
text- 原始输入字符串- Returns:
- 结果
-
sha1
public static byte[] sha1(byte[] b)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
b- 原始输入字符串- Returns:
- 结果
-
sha1
public static byte[] sha1(byte[] b, java.lang.String key)使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
b- 原始输入字符串key- 加密key- Returns:
- 结果
-
sha256
public static java.lang.String sha256(java.lang.String text)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
text- 原始输入字符串- Returns:
- 结果
-
sha256
public static byte[] sha256(byte[] b)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
b- 原始输入字符串- Returns:
- 结果
-
sha384
public static java.lang.String sha384(java.lang.String text)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
text- 原始输入字符串- Returns:
- 结果
-
sha384
public static byte[] sha384(byte[] b)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
b- 原始输入字符串- Returns:
- 结果
-
sha512
public static java.lang.String sha512(java.lang.String text)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
text- 原始输入字符串- Returns:
- 结果
-
sha512
public static byte[] sha512(byte[] b)
使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.- Parameters:
b- 字节数组- Returns:
- 结果
-
-