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>
KeyLocator
that represents a list of multipleKeyLocator
s. Key is searched from the first to the lastKeyLocator
in the order given by the list. If there are multipleKeyLocator
s providing key with the same key ID, the first matching key is returned.- Author:
- hmlnarik
-
-
Constructor Summary
Constructors Constructor Description CompositeKeyLocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
sKey
getKey(String kid)
Returns a key with a particular ID.Iterator<Key>
iterator()
void
refreshKeyCache()
If this key locator caches keys in any way, forces this cache cleanup and refreshing the keys.String
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
-
-
-
-
Method Detail
-
getKey
public Key getKey(String kid) throws KeyManagementException
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
-
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
public void addFirst(KeyLocator keyLocator)
Registers a givenKeyLocator
as the firstKeyLocator
.
-
add
public void add(KeyLocator keyLocator)
Registers a givenKeyLocator
as the lastKeyLocator
.
-
clear
public void clear()
Clears the list of registeredKeyLocator
s
-
-