public class CachingKeyPairProvider
extends org.apache.sshd.common.keyprovider.FileKeyPairProvider
implements java.lang.Iterable<java.security.KeyPair>
FileKeyPairProvider
that uses an external KeyCache
.Modifier and Type | Class and Description |
---|---|
private class |
CachingKeyPairProvider.CancellingKeyPairIterator |
Modifier and Type | Field and Description |
---|---|
private KeyCache |
cache |
Constructor and Description |
---|
CachingKeyPairProvider(java.util.List<java.nio.file.Path> paths,
KeyCache cache)
Creates a new
CachingKeyPairProvider using the given
KeyCache . |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<java.security.KeyPair> |
iterator() |
private java.util.Iterator<java.security.KeyPair> |
iterator(org.apache.sshd.common.session.SessionContext session) |
private java.security.KeyPair |
loadKey(org.apache.sshd.common.session.SessionContext session,
org.apache.sshd.common.NamedResource resource,
java.nio.file.Path path,
org.apache.sshd.common.config.keys.FilePasswordProvider passwordProvider) |
private java.security.KeyPair |
loadKey(org.apache.sshd.common.session.SessionContext session,
java.nio.file.Path path) |
java.lang.Iterable<java.security.KeyPair> |
loadKeys(org.apache.sshd.common.session.SessionContext session) |
doLoadKeys, getIoResource, getPaths, setPaths
doLoadKeys, doLoadKeys, getPasswordFinder, loadKeys, openKeyPairResource, resetCacheMap, setPasswordFinder
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private final KeyCache cache
public CachingKeyPairProvider(java.util.List<java.nio.file.Path> paths, KeyCache cache)
CachingKeyPairProvider
using the given
KeyCache
. If the cache is null
, this is a simple
FileKeyPairProvider
.paths
- to load keys fromcache
- to use, may be null
if no external caching is desiredpublic java.util.Iterator<java.security.KeyPair> iterator()
iterator
in interface java.lang.Iterable<java.security.KeyPair>
private java.util.Iterator<java.security.KeyPair> iterator(org.apache.sshd.common.session.SessionContext session)
public java.lang.Iterable<java.security.KeyPair> loadKeys(org.apache.sshd.common.session.SessionContext session)
loadKeys
in interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
loadKeys
in class org.apache.sshd.common.keyprovider.FileKeyPairProvider
private java.security.KeyPair loadKey(org.apache.sshd.common.session.SessionContext session, java.nio.file.Path path) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
private java.security.KeyPair loadKey(org.apache.sshd.common.session.SessionContext session, org.apache.sshd.common.NamedResource resource, java.nio.file.Path path, org.apache.sshd.common.config.keys.FilePasswordProvider passwordProvider) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException