Interface SigningKeyRepository


public interface SigningKeyRepository
Port that stores signing keys.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes a key.
    Finds every stored key.
    void
    Inserts a key, or replaces the stored key that has the same identifier.
    <T> T
    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

      void save(SigningKey key)
      Inserts a key, or replaces the stored key that has the same identifier.
      Parameters:
      key - the key to store.
    • deleteByKid

      void deleteByKid(String kid)
      Deletes a key.
      Parameters:
      kid - identifier of the key.
    • withRotationLock

      <T> T withRotationLock(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. 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.