Class AlgorithmAndKeyPair

java.lang.Object
uk.co.spudsoft.jwtvalidatorvertx.AlgorithmAndKeyPair

public class AlgorithmAndKeyPair extends Object
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 Details

    • AlgorithmAndKeyPair

      public AlgorithmAndKeyPair(JsonWebAlgorithm algorithm, KeyPair keyPair)
      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

      public JsonWebAlgorithm getAlgorithm()
      Get the algorithm to use with this key.
      Returns:
      the algorithm to use with this key.
    • getKeyPair

      public KeyPair getKeyPair()
      Get the KeyPair.
      Returns:
      the KeyPair.