Package uk.co.spudsoft.jwtvalidatorvertx
Class AlgorithmAndKeyPair
java.lang.Object
uk.co.spudsoft.jwtvalidatorvertx.AlgorithmAndKeyPair
Associated the algorithm with a
KeyPair
. The keys for some algorithms (like RSA) can be used for
different types of JWS algorithms (i.e. RS512 and RS256 use the same size RSA keys). In order for the token builder to work
with the JwksHandler
-
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmAndKeyPair
(JsonWebAlgorithm algorithm, KeyPair keyPair) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.cache.Cache
<String, AlgorithmAndKeyPair> createCache
(Duration keyLifetime) Create a guava cache with a configured key lifetime.Get the algorithm to use with this key.Get the KeyPair.
-
Constructor Details
-
AlgorithmAndKeyPair
Constructor.- Parameters:
algorithm
- The algorithm to use with this key.keyPair
- The key pair.
-
-
Method Details
-
createCache
public static com.google.common.cache.Cache<String,AlgorithmAndKeyPair> createCache(Duration keyLifetime) Create a guava cache with a configured key lifetime.- Parameters:
keyLifetime
- The value to use for the expireAfterWrite setting.- Returns:
- a guava cache with a configured key lifetime.
-
getAlgorithm
Get the algorithm to use with this key.- Returns:
- the algorithm to use with this key.
-
getKeyPair
Get the KeyPair.- Returns:
- the KeyPair.
-