Top Inners Fields Constructors Methods
org.apache.sshd.common.keyprovider

public abstract Class AbstractResourceKeyPairProvider<R>

extends AbstractKeyPairProvider
Class Inheritance
Known Direct Subclasses
org.apache.sshd.common.keyprovider.ClassLoadableResourceKeyPairProvider, org.apache.sshd.common.keyprovider.FileKeyPairProvider
Type Parameters
<R>
Type of resource from which the KeyPair is generated
Imports
java.io.IOException, .InputStream, .StreamCorruptedException, java.security.GeneralSecurityException, .KeyPair, java.util.Collection, .Collections, .Iterator, .Map, .NoSuchElementException, .Objects, .TreeMap, .TreeSet, org.apache.sshd.common.NamedResource, org.apache.sshd.common.config.keys.FilePasswordProvider, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.GenericUtils, .ValidateUtils, org.apache.sshd.common.util.io.resource.IoResource, .ResourceStreamProvider, org.apache.sshd.common.util.security.SecurityUtils

Author
Apache MINA SSHD Project

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class

Field Summary

Modifier and TypeField and Description
private final Map<String, Iterable<KeyPair>>
private FilePasswordProvider

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected Iterable<KeyPair>
doLoadKeys(SessionContext session, R resource)

protected Iterable<KeyPair>
doLoadKeys(SessionContext session, NamedResource resourceKey, R resource, FilePasswordProvider provider)

protected Iterable<KeyPair>
doLoadKeys(SessionContext session, NamedResource resourceKey, InputStream inputStream, FilePasswordProvider provider)

protected IoResource<?>
getIoResource(SessionContext session, R resource)

public FilePasswordProvider
protected Iterable<KeyPair>
loadKeys(SessionContext session, Collection<? extends R> resources)

protected InputStream
openKeyPairResource(SessionContext session, NamedResource resourceKey, R resource)

protected void
resetCacheMap(Collection<?>
The collection of new resources - can be null/empty in which case the cache is cleared
resources
)

Checks which of the new resources we already loaded and can keep the associated key pair

public void

Field Detail

cacheMapback to summary
private final Map<String, Iterable<KeyPair>> cacheMap
passwordFinderback to summary
private FilePasswordProvider passwordFinder

Constructor Detail

AbstractResourceKeyPairProviderback to summary
protected AbstractResourceKeyPairProvider()

Method Detail

doLoadKeysback to summary
protected Iterable<KeyPair> doLoadKeys(SessionContext session, R resource) throws IOException, GeneralSecurityException
doLoadKeysback to summary
protected Iterable<KeyPair> doLoadKeys(SessionContext session, NamedResource resourceKey, R resource, FilePasswordProvider provider) throws IOException, GeneralSecurityException
doLoadKeysback to summary
protected Iterable<KeyPair> doLoadKeys(SessionContext session, NamedResource resourceKey, InputStream inputStream, FilePasswordProvider provider) throws IOException, GeneralSecurityException
getIoResourceback to summary
protected IoResource<?> getIoResource(SessionContext session, R resource)
getPasswordFinderback to summary
public FilePasswordProvider getPasswordFinder()
loadKeysback to summary
protected Iterable<KeyPair> loadKeys(SessionContext session, Collection<? extends R> resources)
openKeyPairResourceback to summary
protected InputStream openKeyPairResource(SessionContext session, NamedResource resourceKey, R resource) throws IOException
resetCacheMapback to summary
protected void resetCacheMap(Collection<?> resources)

Checks which of the new resources we already loaded and can keep the associated key pair

Parameters
resources:Collection<?>

The collection of new resources - can be null/empty in which case the cache is cleared

setPasswordFinderback to summary
public void setPasswordFinder(FilePasswordProvider passwordFinder)
org.apache.sshd.common.keyprovider back to summary

protected Class AbstractResourceKeyPairProvider.KeyPairIterator

extends Object
implements Iterator<KeyPair>
Class Inheritance
  • java.lang.Object
  • org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider.KeyPairIterator
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private Iterator<KeyPair>
private final Iterator<? extends R>
private KeyPair
private boolean
protected final SessionContext

Constructor Summary

AccessConstructor and Description
protected
KeyPairIterator(SessionContext session, Collection<? extends R> resources)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public KeyPair
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentIdentitiesback to summary
private Iterator<KeyPair> currentIdentities
iteratorback to summary
private final Iterator<? extends R> iterator
nextKeyPairback to summary
private KeyPair nextKeyPair
nextKeyPairSetback to summary
private boolean nextKeyPairSet
sessionback to summary
protected final SessionContext session

Constructor Detail

KeyPairIteratorback to summary
protected KeyPairIterator(SessionContext session, Collection<? extends R> resources)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public KeyPair next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:KeyPair

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
setNextObjectback to summary
private boolean setNextObject()
Annotations
@SuppressWarnings:synthetic-access