Package org.forgerock.json.jose.jwk
Class JWKSet
- java.lang.Object
- 
- org.forgerock.json.jose.jwt.JWObject
- 
- org.forgerock.json.jose.jwk.JWKSet
 
 
- 
 public class JWKSet extends JWObject Holds a Set of JWKs.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JWKfindJwk(String kid)Search for a JWK that matches the kid.JWKfindJwk(Algorithm algorithm, String keyUse)Search for a JWK that matches the algorithm and the key usage.JsonValuegetJWKsAsJsonValue()Get the JWKs in the set.List<JWK>getJWKsAsList()Get the JWKs in the set.static JWKSetparse(String json)Parses a JWKSet object from a string json object.static JWKSetparse(JsonValue json)Parses a JWKSet object from a jsonValue object.StringtoJsonString()Prints the JWK Set as a json string.protected static JsonValuetoJsonValue(String json)Converts a json string to a jsonValue.- 
Methods inherited from class org.forgerock.json.jose.jwt.JWObjectcheckListValuesAreOfType, checkValueIsOfType, equals, get, hashCode, isDefined, isValueOfType, keys, put, toJsonValue, toString
 
- 
 
- 
- 
- 
Constructor Detail- 
JWKSetpublic JWKSet() Constructs an empty JWKSet.
 - 
JWKSetpublic JWKSet(JWK jwk) Construct a JWKSet from a single JWK.- Parameters:
- jwk- the jwk to construct the set from
 
 - 
JWKSetpublic JWKSet(JsonValue jwks) Construct a JWKSet from a single JWK.- Parameters:
- jwks- contains a list of json web keys
 
 
- 
 - 
Method Detail- 
getJWKsAsJsonValuepublic JsonValue getJWKsAsJsonValue() Get the JWKs in the set.- Returns:
- a list of JWKs as JsonValues
 
 - 
toJsonValueprotected static JsonValue toJsonValue(String json) Converts a json string to a jsonValue.- Parameters:
- json- a json jwk set object string
- Returns:
- a json value of the son string
- Throws:
- JsonException- if unable to parse
 
 - 
parsepublic static JWKSet parse(String json) Parses a JWKSet object from a string json object.- Parameters:
- json- string json object
- Returns:
- a JWKSet
 
 - 
parsepublic static JWKSet parse(JsonValue json) Parses a JWKSet object from a jsonValue object.- Parameters:
- json- an JsonValue object
- Returns:
- a JWKSet
 
 - 
toJsonStringpublic String toJsonString() Prints the JWK Set as a json string.- Returns:
- A String representing JWK
 
 - 
findJwkpublic JWK findJwk(Algorithm algorithm, String keyUse) Search for a JWK that matches the algorithm and the key usage.- Parameters:
- algorithm- the algorithm needed
- keyUse- the key usage. If null, only the algorithm will be used as a search criteria.
- Returns:
- A jwk that matches the search criteria. If no JWK found for the key usage, then it searches for a JWK without key usage defined. If still no JWK found, then returns null.
 
 
- 
 
-