Interface KeyCache

All Known Implementing Classes:
JGitKeyCache

public interface KeyCache
A cache for KeyPairs.
Since:
5.2
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all KeyPair from this cache and destroys their private keys.
    get(Path path, Function<? super Path,? extends KeyPair> loader)
    Obtains a KeyPair from the cache.
  • Method Details

    • get

      KeyPair get(Path path, Function<? super Path,? extends KeyPair> loader)
      Obtains a KeyPair from the cache. Implementations must be thread-safe.
      Parameters:
      path - of the key
      loader - to load the key if it isn't present in the cache yet
      Returns:
      the KeyPair, or null if not present and could not be loaded
    • close

      void close()
      Removes all KeyPair from this cache and destroys their private keys. This cache instance must not be used anymore thereafter.