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 itsSshdSessionFactory
to 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 void
close()
Removes allKeyPair
from this cache and destroys their private keys.java.security.KeyPair
get(java.nio.file.Path path, java.util.function.Function<? super java.nio.file.Path,? extends java.security.KeyPair> loader)
Obtains aKeyPair
from 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:KeyCache
Obtains aKeyPair
from the cache. Implementations must be thread-safe.
-
-