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 Summary
ConstructorDescriptionSHA512DigestHexJpaOAuth2AuthorizationHashValueProvider
(int tokenHashesByTokenValuesCacheSize) -
Method Summary
Modifier and TypeMethodDescriptiongetHashRepresentation
(@NonNull String rawValue) Computes the hash representation of the providedrawValue
.Simple bounded cache to avoid potentially expensive hash computations on back-to-back calls.
-
Constructor Details
-
SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider
public SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider(int tokenHashesByTokenValuesCacheSize) -
SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider
public SHA512DigestHexJpaOAuth2AuthorizationHashValueProvider()
-
-
Method Details
-
getHashRepresentation
Description copied from interface:JpaOAuth2AuthorizationHashValueProvider
Computes the hash representation of the providedrawValue
.- Specified by:
getHashRepresentation
in interfaceJpaOAuth2AuthorizationHashValueProvider
- Parameters:
rawValue
- the raw value to hash. Must not be null.- Returns:
- a string of the hash representation of the provided
rawValue
-
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.
-