Class AbstractResourceKeyPairProvider<R>
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.keyprovider.AbstractKeyPairProvider
-
- org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider<R>
-
- Type Parameters:
R
- Type of resource from which theKeyPair
is generated
- All Implemented Interfaces:
KeyIdentityProvider
,KeyPairProvider
- Direct Known Subclasses:
ClassLoadableResourceKeyPairProvider
,FileKeyPairProvider
public abstract class AbstractResourceKeyPairProvider<R> extends AbstractKeyPairProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractResourceKeyPairProvider.KeyPairIterator
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Iterable<java.security.KeyPair>>
cacheMap
private FilePasswordProvider
passwordFinder
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
EMPTY_KEYS_PROVIDER
-
Fields inherited from interface org.apache.sshd.common.keyprovider.KeyPairProvider
ECDSA_SHA2_NISTP256, ECDSA_SHA2_NISTP384, ECDSA_SHA2_NISTP521, EMPTY_KEYPAIR_PROVIDER, SSH_DSS, SSH_ED25519, SSH_RSA
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractResourceKeyPairProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Iterable<java.security.KeyPair>
doLoadKeys(SessionContext session, NamedResource resourceKey, java.io.InputStream inputStream, FilePasswordProvider provider)
protected java.lang.Iterable<java.security.KeyPair>
doLoadKeys(SessionContext session, NamedResource resourceKey, R resource, FilePasswordProvider provider)
protected java.lang.Iterable<java.security.KeyPair>
doLoadKeys(SessionContext session, R resource)
protected IoResource<?>
getIoResource(SessionContext session, R resource)
FilePasswordProvider
getPasswordFinder()
protected java.lang.Iterable<java.security.KeyPair>
loadKeys(SessionContext session, java.util.Collection<? extends R> resources)
protected java.io.InputStream
openKeyPairResource(SessionContext session, NamedResource resourceKey, R resource)
protected void
resetCacheMap(java.util.Collection<?> resources)
Checks which of the new resources we already loaded and can keep the associated key pairvoid
setPasswordFinder(FilePasswordProvider passwordFinder)
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
getSimplifiedLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
loadKeys
-
Methods inherited from interface org.apache.sshd.common.keyprovider.KeyPairProvider
getKeyTypes, loadKey
-
-
-
-
Field Detail
-
passwordFinder
private FilePasswordProvider passwordFinder
-
cacheMap
private final java.util.Map<java.lang.String,java.lang.Iterable<java.security.KeyPair>> cacheMap
-
-
Method Detail
-
getPasswordFinder
public FilePasswordProvider getPasswordFinder()
-
setPasswordFinder
public void setPasswordFinder(FilePasswordProvider passwordFinder)
-
resetCacheMap
protected void resetCacheMap(java.util.Collection<?> resources)
Checks which of the new resources we already loaded and can keep the associated key pair- Parameters:
resources
- The collection of new resources - can benull
/empty in which case the cache is cleared
-
loadKeys
protected java.lang.Iterable<java.security.KeyPair> loadKeys(SessionContext session, java.util.Collection<? extends R> resources)
-
getIoResource
protected IoResource<?> getIoResource(SessionContext session, R resource)
-
doLoadKeys
protected java.lang.Iterable<java.security.KeyPair> doLoadKeys(SessionContext session, R resource) throws java.io.IOException, java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
-
doLoadKeys
protected java.lang.Iterable<java.security.KeyPair> doLoadKeys(SessionContext session, NamedResource resourceKey, R resource, FilePasswordProvider provider) throws java.io.IOException, java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
-
openKeyPairResource
protected java.io.InputStream openKeyPairResource(SessionContext session, NamedResource resourceKey, R resource) throws java.io.IOException
- Throws:
java.io.IOException
-
doLoadKeys
protected java.lang.Iterable<java.security.KeyPair> doLoadKeys(SessionContext session, NamedResource resourceKey, java.io.InputStream inputStream, FilePasswordProvider provider) throws java.io.IOException, java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
-
-