类 HMac

java.lang.Object
com.weicoder.common.crypto.HMac

public final class HMac extends Object
hmac算法
作者:
WD
  • 方法概要

    修饰符和类型
    方法
    说明
    static byte[]
    sha1(byte[] b)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static byte[]
    sha1(byte[] b, String key)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static String
    sha1(String text)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static byte[]
    sha256(byte[] b)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static String
    sha256(String text)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static byte[]
    sha384(byte[] b)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static String
    sha384(String text)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static byte[]
    sha512(byte[] b)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
    static String
    sha512(String text)
    使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细资料

    • sha1

      public static String sha1(String text)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      text - 原始输入字符串
      返回:
      结果
    • sha1

      public static byte[] sha1(byte[] b)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      b - 原始输入字符串
      返回:
      结果
    • sha1

      public static byte[] sha1(byte[] b, String key)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      b - 原始输入字符串
      key - 加密key
      返回:
      结果
    • sha256

      public static String sha256(String text)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      text - 原始输入字符串
      返回:
      结果
    • sha256

      public static byte[] sha256(byte[] b)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      b - 原始输入字符串
      返回:
      结果
    • sha384

      public static String sha384(String text)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      text - 原始输入字符串
      返回:
      结果
    • sha384

      public static byte[] sha384(byte[] b)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      b - 原始输入字符串
      返回:
      结果
    • sha512

      public static String sha512(String text)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      text - 原始输入字符串
      返回:
      结果
    • sha512

      public static byte[] sha512(byte[] b)
      使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
      参数:
      b - 字节数组
      返回:
      结果