Class JwkKeys

java.lang.Object
io.helidon.security.jwt.jwk.JwkKeys

public final class JwkKeys extends Object
A representation of the JSON web keys document - a map of key ids to corresponding web keys. The keys may be of different types and algorithms. Example (as used in unit test):
 JwkKeys keys = JwkKeys.builder()
 .resource("jwk_data.json")
 .build();

 Optional<Jwk> key = keys
 .forKeyId("cc34c0a0-bd5a-4a3c-a50d-a2a7db7643df");
 
  • Method Details

    • builder

      public static JwkKeys.Builder builder()
      Create a new builder for this class.
      Returns:
      builder instance
    • create

      public static JwkKeys create(JsonObject json)
      Create Jwk keys from its JSON representation.
      Parameters:
      json - json with jwk keys
      Returns:
      keys set up from the provided json
    • forKeyId

      public Optional<Jwk> forKeyId(String keyId)
      Get a JWK for defined key id if present.
      Parameters:
      keyId - keyId of the key to obtain from this keys
      Returns:
      Jwk if present
    • keys

      public List<Jwk> keys()
      List of keys in this instance.
      Returns:
      all keys configured