Package org.forgerock.json.jose.jwk
Class JWKSetParser
java.lang.Object
org.forgerock.json.jose.jwk.JWKSetParser
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
ConstructorsConstructorDescriptionJWKSetParser
(int readTimeout, int connTimeout) Constructor allowing the configuration of the read and connection timeouts used by the HTTP client for this parser.JWKSetParser
(SimpleHTTPClient simpleHTTPClient) Alternative constructor allowing the calling class to pass in an already-configuredSimpleHTTPClient
.JWKSetParser
(SimpleHTTPClient simpleHTTPClient, JWKLookup jwkLookup) Alternative constructor allowing the calling class to pass in an already-configuredSimpleHTTPClient
. -
Method Summary
Modifier and TypeMethodDescriptiongenerateMapFromJWK
(URL url) Provides a Map of KeyId:Keys as indicated by the JWKSet's URL.Provides a jwks set as indicated by the JWKSet's URL.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.
-
Constructor Details
-
JWKSetParser
Constructor allowing the configuration of the read and connection timeouts used by the HTTP client for this parser.- Parameters:
readTimeout
- read timeout in msconnTimeout
- connection timeout in ms
-
JWKSetParser
Alternative constructor allowing the calling class to pass in an already-configuredSimpleHTTPClient
.- Parameters:
simpleHTTPClient
-SimpleHTTPClient
used to gather HTTP information
-
JWKSetParser
Alternative constructor allowing the calling class to pass in an already-configuredSimpleHTTPClient
.- Parameters:
simpleHTTPClient
-SimpleHTTPClient
used to gather HTTP informationjwkLookup
- to convert the jwk into a real key
-
-
Method Details
-
generateMapFromJWK
Provides a Map of KeyId:Keys as indicated by the JWKSet's URL.- Parameters:
url
- The URL from which to gather the JWKSet- Returns:
- a map of currently valid KeyId:Keys for the provider associated with this URL
- Throws:
FailedToLoadJWKException
- If there are problems connecting to or parsing the response
-
jwkSet
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
-
jwkSetToMap
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
-