Package org.forgerock.json.jose.jwk
Class JWKSetParser
- java.lang.Object
-
- org.forgerock.json.jose.jwk.JWKSetParser
-
public class JWKSetParser extends Object
Provides methods to gather a JWKSet from a URL and return a map of key ids to keys as dictated by that JWKS.
-
-
Constructor Summary
Constructors Constructor Description JWKSetParser(Client client)
Alternative constructor allowing the calling class to pass in an already-configuredClient
.JWKSetParser(Client client, JWKLookup jwkLookup)
Alternative constructor allowing the calling class to pass in an already-configuredClient
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Promise<JsonValue,FailedToLoadJWKException>
gatherHttpContentsAsync(URL url)
Uses the Client to gather HTTP information.JWKSet
jwkSet(URL url)
Deprecated.UsejwkSetAsync(URL)
instead.Promise<JWKSet,FailedToLoadJWKException>
jwkSetAsync(URL url)
Provides a JWK set as indicated by the JWKSet's URL.Map<String,Key>
jwkSetToMap(JWKSet jwkSet)
Converts a supplied JWKSet into a map of key:values, where the keys are the keyIds and the values are verification keys.
-
-
-
Method Detail
-
gatherHttpContentsAsync
public Promise<JsonValue,FailedToLoadJWKException> gatherHttpContentsAsync(URL url)
Uses the Client to gather HTTP information.- Parameters:
url
- The URL from which to read the information- Returns:
- a
Promise
of a JsonValue.
-
jwkSet
public JWKSet jwkSet(URL url) throws FailedToLoadJWKException
Deprecated.UsejwkSetAsync(URL)
instead.Provides a jwks set as indicated by the JWKSet's URL.- Parameters:
url
- The URL from which to gather the JWKSet- Returns:
- a jwks set valid for the provider associated with this URL
- Throws:
FailedToLoadJWKException
- If there are problems connecting to or parsing the response
-
jwkSetAsync
public Promise<JWKSet,FailedToLoadJWKException> jwkSetAsync(URL url)
Provides a JWK set as indicated by the JWKSet's URL.
-
jwkSetToMap
public Map<String,Key> jwkSetToMap(JWKSet jwkSet) throws FailedToLoadJWKException
Converts a supplied JWKSet into a map of key:values, where the keys are the keyIds and the values are verification keys.- Parameters:
jwkSet
- The JWKSet to convert- Returns:
- A map of key ids to their respective keys
- Throws:
FailedToLoadJWKException
- If there are issues parsing the JWKSet's contents
-
-