Package org.keycloak.rotation
Class CompositeKeyLocator
- java.lang.Object
- 
- org.keycloak.rotation.CompositeKeyLocator
 
- 
- All Implemented Interfaces:
- Iterable<Key>,- KeyLocator
 
 public class CompositeKeyLocator extends Object implements KeyLocator, Iterable<Key> KeyLocatorthat represents a list of multipleKeyLocators. Key is searched from the first to the lastKeyLocatorin the order given by the list. If there are multipleKeyLocators providing key with the same key ID, the first matching key is returned.- Author:
- hmlnarik
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.keycloak.rotation.KeyLocatorKeyLocator.KeyHash
 
- 
 - 
Constructor SummaryConstructors Constructor Description CompositeKeyLocator()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(KeyLocator keyLocator)Registers a givenKeyLocatoras the lastKeyLocator.voidaddFirst(KeyLocator keyLocator)Registers a givenKeyLocatoras the firstKeyLocator.voidclear()Clears the list of registeredKeyLocatorsKeygetKey(String kid)Returns a key with a particular ID.KeygetKey(Key key)Method that checks if the key passed is inside the locator.Iterator<Key>iterator()voidrefreshKeyCache()If this key locator caches keys in any way, forces this cache cleanup and refreshing the keys.StringtoString()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 - 
Methods inherited from interface org.keycloak.rotation.KeyLocatorgetKey
 
- 
 
- 
- 
- 
Method Detail- 
getKeypublic Key getKey(String kid) throws KeyManagementException Description copied from interface:KeyLocatorReturns a key with a particular ID.- Specified by:
- getKeyin interface- KeyLocator
- Parameters:
- kid- Key ID
- Returns:
- key, which should be used for verify signature on given "input"
- Throws:
- KeyManagementException
 
 - 
getKeypublic Key getKey(Key key) throws KeyManagementException Description copied from interface:KeyLocatorMethod that checks if the key passed is inside the locator.- Specified by:
- getKeyin interface- KeyLocator
- Parameters:
- key- The key to search
- Returns:
- The same key or null if it's not in the locator
- Throws:
- KeyManagementException
 
 - 
refreshKeyCachepublic void refreshKeyCache() Description copied from interface:KeyLocatorIf this key locator caches keys in any way, forces this cache cleanup and refreshing the keys.- Specified by:
- refreshKeyCachein interface- KeyLocator
 
 - 
addFirstpublic void addFirst(KeyLocator keyLocator) Registers a givenKeyLocatoras the firstKeyLocator.
 - 
addpublic void add(KeyLocator keyLocator) Registers a givenKeyLocatoras the lastKeyLocator.
 - 
clearpublic void clear() Clears the list of registeredKeyLocators
 
- 
 
-