Class SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider

java.lang.Object
com.broadleafcommerce.auth.authorization.provider.jpa.support.SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider
All Implemented Interfaces:
JpaOAuth2AuthorizationHashValueProvider

public class SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider extends Object implements JpaOAuth2AuthorizationHashValueProvider
Implementation of JpaOAuth2AuthorizationHashValueProvider that returns a SHA-512 digest hex string.

The result is always a 128-character-long alphanumeric string.

  • Constructor Details

    • SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider

      public SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider(int tokenHashesByTokenValuesCacheSize)
    • SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider

      public SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider()
  • Method Details

    • getHashRepresentation

      public String getHashRepresentation(@NonNull @NonNull String rawValue)
      Description copied from interface: JpaOAuth2AuthorizationHashValueProvider
      Computes the hash representation of the provided rawValue.
      Specified by:
      getHashRepresentation in interface JpaOAuth2AuthorizationHashValueProvider
      Parameters:
      rawValue - the raw value to hash. Must not be null.
      Returns:
      a string of the hash representation of the provided rawValue
    • getTokenHashesByTokenValuesCache

      protected Map<String,String> getTokenHashesByTokenValuesCache()
      Simple bounded cache to avoid potentially expensive hash computations on back-to-back calls. Note that the hash computation for map keys is cheaper than the SHA512 computation.