public class JGitKeyCache extends java.lang.Object implements KeyCache
KeyCache
. JGit uses one such cache in its
SshdSessionFactory
to avoid loading keys multiple times.Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicReference<java.util.Map<java.nio.file.Path,java.security.KeyPair>> |
cache |
Constructor and Description |
---|
JGitKeyCache() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Removes all
KeyPair 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 a
KeyPair from the cache. |
private java.util.concurrent.atomic.AtomicReference<java.util.Map<java.nio.file.Path,java.security.KeyPair>> cache
public java.security.KeyPair get(java.nio.file.Path path, java.util.function.Function<? super java.nio.file.Path,? extends java.security.KeyPair> loader)
KeyCache
KeyPair
from the cache. Implementations must be
thread-safe.