Package org.eclipse.jgit.transport.sshd
Class JGitKeyCache
- java.lang.Object
-
- org.eclipse.jgit.transport.sshd.JGitKeyCache
-
- All Implemented Interfaces:
KeyCache
public class JGitKeyCache extends java.lang.Object implements KeyCache
A simpleKeyCache. JGit uses one such cache in itsSshdSessionFactoryto avoid loading keys multiple times.- Since:
- 5.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<java.util.Map<java.nio.file.Path,java.security.KeyPair>>cache
-
Constructor Summary
Constructors Constructor Description JGitKeyCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Removes allKeyPairfrom this cache and destroys their private keys.java.security.KeyPairget(java.nio.file.Path path, java.util.function.Function<? super java.nio.file.Path,? extends java.security.KeyPair> loader)Obtains aKeyPairfrom the cache.
-
-
-
Method Detail
-
get
public java.security.KeyPair get(java.nio.file.Path path, java.util.function.Function<? super java.nio.file.Path,? extends java.security.KeyPair> loader)Description copied from interface:KeyCacheObtains aKeyPairfrom the cache. Implementations must be thread-safe.
-
-