Top Description Methods
org.eclipse.jgit.transport.sshd

public Interface KeyCache

Known Direct Implementers
org.eclipse.jgit.transport.sshd.JGitKeyCache
Imports
java.nio.file.Path, java.security.KeyPair, java.util.function.Function

A cache for KeyPairs.
Since
5.2

Method Summary

Modifier and TypeMethod and Description
public void
close()

Removes all KeyPair from this cache and destroys their private keys.

public KeyPair

Returns:

the KeyPair, or null if not present and could not be loaded
get
(Path
of the key
path
,
Function<? super Path, ? extends KeyPair>
to load the key if it isn't present in the cache yet
loader
)

Obtains a KeyPair from the cache.

Method Detail

closeback to summary
public void close()

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

getback to summary
public KeyPair get(Path path, Function<? super Path, ? extends KeyPair> loader)

Obtains a KeyPair from the cache. Implementations must be thread-safe.

Parameters
path:Path

of the key

loader:Function<? super Path, ? extends KeyPair>

to load the key if it isn't present in the cache yet

Returns:KeyPair

the KeyPair, or null if not present and could not be loaded