Interface SigningKeyRepository
public interface SigningKeyRepository
Port that stores signing keys.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteByKid(String kid) Deletes a key.findAll()Finds every stored key.voidsave(SigningKey key) Inserts a key, or replaces the stored key that has the same identifier.<T> TwithRotationLock(Supplier<T> action) Runs an action while holding the cluster-wide rotation lock and inside one transaction, so that two instances can never rotate the keys at the same time.
-
Method Details
-
findAll
List<SigningKey> findAll()Finds every stored key.- Returns:
- the keys, in no particular order; empty when there are none.
-
save
Inserts a key, or replaces the stored key that has the same identifier.- Parameters:
key- the key to store.
-
deleteByKid
Deletes a key.- Parameters:
kid- identifier of the key.
-
withRotationLock
Runs an action while holding the cluster-wide rotation lock and inside one transaction, so that two instances can never rotate the keys at the same time. The action's changes are committed together, or not at all.- Type Parameters:
T- type of the result.- Parameters:
action- the action to run.- Returns:
- what the action returns.
-