Class CachingKeyPairProvider
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.keyprovider.AbstractKeyPairProvider
-
- org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider<java.nio.file.Path>
-
- org.apache.sshd.common.keyprovider.FileKeyPairProvider
-
- org.eclipse.jgit.internal.transport.sshd.CachingKeyPairProvider
-
- All Implemented Interfaces:
java.lang.Iterable<java.security.KeyPair>,org.apache.sshd.common.keyprovider.KeyIdentityProvider,org.apache.sshd.common.keyprovider.KeyPairProvider
public class CachingKeyPairProvider extends org.apache.sshd.common.keyprovider.FileKeyPairProvider implements java.lang.Iterable<java.security.KeyPair>AFileKeyPairProviderthat uses an externalKeyCache.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCachingKeyPairProvider.CancellingKeyPairIterator
-
Constructor Summary
Constructors Constructor Description CachingKeyPairProvider(java.util.List<java.nio.file.Path> paths, KeyCache cache)Creates a newCachingKeyPairProviderusing the givenKeyCache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.KeyPairloadKey(org.apache.sshd.common.session.SessionContext session, java.nio.file.Path path)private java.security.KeyPairloadKey(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)java.lang.Iterable<java.security.KeyPair>loadKeys(org.apache.sshd.common.session.SessionContext session)-
Methods inherited from class org.apache.sshd.common.keyprovider.FileKeyPairProvider
doLoadKeys, getIoResource, getPaths, setPaths
-
Methods inherited from class org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider
doLoadKeys, doLoadKeys, getPasswordFinder, loadKeys, openKeyPairResource, resetCacheMap, setPasswordFinder
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
getSimplifiedLogger
-
-
-
-
Field Detail
-
cache
private final KeyCache cache
-
-
Constructor Detail
-
CachingKeyPairProvider
public CachingKeyPairProvider(java.util.List<java.nio.file.Path> paths, KeyCache cache)Creates a newCachingKeyPairProviderusing the givenKeyCache. If the cache isnull, this is a simpleFileKeyPairProvider.- Parameters:
paths- to load keys fromcache- to use, may benullif no external caching is desired
-
-
Method Detail
-
iterator
public java.util.Iterator<java.security.KeyPair> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.security.KeyPair>
-
iterator
private java.util.Iterator<java.security.KeyPair> iterator(org.apache.sshd.common.session.SessionContext session)
-
loadKeys
public java.lang.Iterable<java.security.KeyPair> loadKeys(org.apache.sshd.common.session.SessionContext session)
- Specified by:
loadKeysin interfaceorg.apache.sshd.common.keyprovider.KeyIdentityProvider- Overrides:
loadKeysin classorg.apache.sshd.common.keyprovider.FileKeyPairProvider
-
loadKey
private java.security.KeyPair loadKey(org.apache.sshd.common.session.SessionContext session, java.nio.file.Path path) throws java.io.IOException, java.security.GeneralSecurityException- Throws:
java.io.IOExceptionjava.security.GeneralSecurityException
-
loadKey
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- Throws:
java.io.IOExceptionjava.security.GeneralSecurityException
-
-