Class Sha512DigestUtils

java.lang.Object
org.springframework.security.core.token.Sha512DigestUtils

public abstract class Sha512DigestUtils extends Object
Provides SHA512 digest methods.

Based on Commons Codec, which does not presently provide SHA512 support.

Since:
2.0.1
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    sha(byte[] data)
    Calculates the SHA digest and returns the value as a byte[].
    static byte[]
    sha(String data)
    Calculates the SHA digest and returns the value as a byte[].
    static String
    shaHex(byte[] data)
    Calculates the SHA digest and returns the value as a hex string.
    static String
    shaHex(String data)
    Calculates the SHA digest and returns the value as a hex string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Sha512DigestUtils

      public Sha512DigestUtils()
  • Method Details

    • sha

      public static byte[] sha(byte[] data)
      Calculates the SHA digest and returns the value as a byte[].
      Parameters:
      data - Data to digest
      Returns:
      SHA digest
    • sha

      public static byte[] sha(String data)
      Calculates the SHA digest and returns the value as a byte[].
      Parameters:
      data - Data to digest
      Returns:
      SHA digest
    • shaHex

      public static String shaHex(byte[] data)
      Calculates the SHA digest and returns the value as a hex string.
      Parameters:
      data - Data to digest
      Returns:
      SHA digest as a hex string
    • shaHex

      public static String shaHex(String data)
      Calculates the SHA digest and returns the value as a hex string.
      Parameters:
      data - Data to digest
      Returns:
      SHA digest as a hex string