Enum Class SignatureAlgorithm

java.lang.Object
java.lang.Enum<SignatureAlgorithm>
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
All Implemented Interfaces:
Serializable, Comparable<SignatureAlgorithm>, Constable, JwaAlgorithm, JwsAlgorithm

public enum SignatureAlgorithm extends Enum<SignatureAlgorithm> implements JwsAlgorithm
An enumeration of the cryptographic algorithms defined by the JSON Web Algorithms (JWA) specification and used by JSON Web Signature (JWS) to digitally sign the contents of the JWS Protected Header and JWS Payload.
Since:
5.2
See Also:
  • Enum Constant Details

    • RS256

      public static final SignatureAlgorithm RS256
      RSASSA-PKCS1-v1_5 using SHA-256 (Recommended)
    • RS384

      public static final SignatureAlgorithm RS384
      RSASSA-PKCS1-v1_5 using SHA-384 (Optional)
    • RS512

      public static final SignatureAlgorithm RS512
      RSASSA-PKCS1-v1_5 using SHA-512 (Optional)
    • ES256

      public static final SignatureAlgorithm ES256
      ECDSA using P-256 and SHA-256 (Recommended+)
    • ES384

      public static final SignatureAlgorithm ES384
      ECDSA using P-384 and SHA-384 (Optional)
    • ES512

      public static final SignatureAlgorithm ES512
      ECDSA using P-521 and SHA-512 (Optional)
    • PS256

      public static final SignatureAlgorithm PS256
      RSASSA-PSS using SHA-256 and MGF1 with SHA-256 (Optional)
    • PS384

      public static final SignatureAlgorithm PS384
      RSASSA-PSS using SHA-384 and MGF1 with SHA-384 (Optional)
    • PS512

      public static final SignatureAlgorithm PS512
      RSASSA-PSS using SHA-512 and MGF1 with SHA-512 (Optional)
  • Method Details

    • values

      public static SignatureAlgorithm[] 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 SignatureAlgorithm 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
    • getName

      public String getName()
      Returns the algorithm name.
      Specified by:
      getName in interface JwaAlgorithm
      Returns:
      the algorithm name
    • from

      public static SignatureAlgorithm from(String name)
      Attempt to resolve the provided algorithm name to a SignatureAlgorithm.
      Parameters:
      name - the algorithm name
      Returns:
      the resolved SignatureAlgorithm, or null if not found