Package org.keycloak.rotation
Class CompositeKeyLocator
java.lang.Object
org.keycloak.rotation.CompositeKeyLocator
- All Implemented Interfaces:
Iterable<Key>
,KeyLocator
KeyLocator
that represents a list of multiple KeyLocator
s. Key is searched
from the first to the last KeyLocator
in the order given by the list. If there are
multiple KeyLocator
s 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.KeyLocator
KeyLocator.KeyHash
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(KeyLocator keyLocator) Registers a givenKeyLocator
as the lastKeyLocator
.void
addFirst
(KeyLocator keyLocator) Registers a givenKeyLocator
as the firstKeyLocator
.void
clear()
Clears the list of registeredKeyLocator
sReturns a key with a particular ID.Method that checks if the key passed is inside the locator.iterator()
void
If this key locator caches keys in any way, forces this cache cleanup and refreshing the keys.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.keycloak.rotation.KeyLocator
getKey
-
Constructor Details
-
CompositeKeyLocator
public CompositeKeyLocator()
-
-
Method Details
-
getKey
Description copied from interface:KeyLocator
Returns a key with a particular ID.- Specified by:
getKey
in interfaceKeyLocator
- Parameters:
kid
- Key ID- Returns:
- key, which should be used for verify signature on given "input"
- Throws:
KeyManagementException
-
getKey
Description copied from interface:KeyLocator
Method that checks if the key passed is inside the locator.- Specified by:
getKey
in interfaceKeyLocator
- Parameters:
key
- The key to search- Returns:
- The same key or null if it's not in the locator
- Throws:
KeyManagementException
-
refreshKeyCache
public void refreshKeyCache()Description copied from interface:KeyLocator
If this key locator caches keys in any way, forces this cache cleanup and refreshing the keys.- Specified by:
refreshKeyCache
in interfaceKeyLocator
-
addFirst
Registers a givenKeyLocator
as the firstKeyLocator
. -
add
Registers a givenKeyLocator
as the lastKeyLocator
. -
clear
public void clear()Clears the list of registeredKeyLocator
s -
toString
-
iterator
-