Class CachingKeyPairProvider

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.keyprovider.AbstractKeyPairProvider
org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider<Path>
org.apache.sshd.common.keyprovider.FileKeyPairProvider
org.eclipse.jgit.internal.transport.sshd.CachingKeyPairProvider
All Implemented Interfaces:
Iterable<KeyPair>, org.apache.sshd.common.keyprovider.KeyIdentityProvider, org.apache.sshd.common.keyprovider.KeyPairProvider

public class CachingKeyPairProvider extends org.apache.sshd.common.keyprovider.FileKeyPairProvider implements Iterable<KeyPair>
A FileKeyPairProvider that uses an external KeyCache.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider

    org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider.KeyPairIterator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.sshd.common.AttributeRepository.AttributeKey<Map<String,Path>>
    An attribute set on the SessionContext recording loaded keys by fingerprint.

    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_DSS_CERT, SSH_ECDSA_SHA2_NISTP256_CERT, SSH_ECDSA_SHA2_NISTP384_CERT, SSH_ECDSA_SHA2_NISTP521_CERT, SSH_ED25519, SSH_ED25519_CERT, SSH_RSA, SSH_RSA_CERT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new CachingKeyPairProvider using the given KeyCache.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    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

    debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface org.apache.sshd.common.keyprovider.KeyPairProvider

    getKeyTypes, loadKey
  • Field Details

    • KEY_PATHS_BY_FINGERPRINT

      public static final org.apache.sshd.common.AttributeRepository.AttributeKey<Map<String,Path>> KEY_PATHS_BY_FINGERPRINT
      An attribute set on the SessionContext recording loaded keys by fingerprint. This enables us to provide nicer output by showing key paths, if possible. Users can identify key identities used easier by filename than by fingerprint.
  • Constructor Details

    • CachingKeyPairProvider

      public CachingKeyPairProvider(List<Path> paths, KeyCache cache)
      Creates a new CachingKeyPairProvider using the given KeyCache. If the cache is null, this is a simple FileKeyPairProvider.
      Parameters:
      paths - to load keys from
      cache - to use, may be null if no external caching is desired
  • Method Details

    • iterator

      public Iterator<KeyPair> iterator()
      Specified by:
      iterator in interface Iterable<KeyPair>
    • loadKeys

      public Iterable<KeyPair> loadKeys(org.apache.sshd.common.session.SessionContext session)
      Specified by:
      loadKeys in interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
      Overrides:
      loadKeys in class org.apache.sshd.common.keyprovider.FileKeyPairProvider