Enum Class SignAlgorithm

java.lang.Object
java.lang.Enum<SignAlgorithm>
tech.riemann.nif.web.sign.SignAlgorithm
All Implemented Interfaces:
Serializable, Comparable<SignAlgorithm>, Constable

public enum SignAlgorithm extends Enum<SignAlgorithm>
签名算法枚举

定义支持的签名算法类型

使用示例:

@SignVerify(algorithm = SignAlgorithm.HMAC_SHA256)
public Result createOrder() {
}
Author:
Kerbores(kerbores@riemann.tech)
  • Enum Constant Details

    • HMAC_SHA256

      public static final SignAlgorithm HMAC_SHA256
      HMAC-SHA256算法

      推荐使用,安全性高,性能良好

    • SM3

      public static final SignAlgorithm SM3
      国密SM3算法

      适用于国密合规场景(作为哈希摘要用途)

    • SM2

      public static final SignAlgorithm SM2
      国密SM2非对称签名(SM3WithSM2)

      真正对标RSA的非对称签名,私钥签名、公钥验签

    • RSA

      public static final SignAlgorithm RSA
      RSA非对称签名(SHA256withRSA)

      私钥签名、公钥验签

    • HMAC_SHA512

      public static final SignAlgorithm HMAC_SHA512
      HMAC-SHA512算法

      安全性更高,但性能略低

  • Method Details

    • values

      public static SignAlgorithm[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SignAlgorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getAlgorithmName

      public String getAlgorithmName()
      获取算法名称
      Returns:
      算法名称