Package com.sshtools.client
Class SshClientContext
java.lang.Object
com.sshtools.synergy.nio.ProtocolContext
com.sshtools.synergy.ssh.SshContext
com.sshtools.client.SshClientContext
- All Implemented Interfaces:
com.sshtools.common.ssh.Context
,com.sshtools.common.ssh.ExecutorServiceProvider
- Direct Known Subclasses:
SwitchingSshContext
public class SshClientContext
extends com.sshtools.synergy.ssh.SshContext
Holds the configuration for an SSH connection.
-
Field Summary
FieldsFields inherited from class com.sshtools.synergy.ssh.SshContext
byteBufferPool, CIPHER_AES_GCM_128, CIPHER_AES_GCM_256, CIPHER_AES128_CBC, CIPHER_AES128_CTR, CIPHER_AES192_CBC, CIPHER_AES192_CTR, CIPHER_AES256_CBC, CIPHER_AES256_CTR, CIPHER_ARCFOUR, CIPHER_ARCFOUR_128, CIPHER_ARCFOUR_256, CIPHER_BLOWFISH_CBC, CIPHER_TRIPLEDES_CBC, CIPHER_TRIPLEDES_CTR, ciphersCS, ciphersSC, componentManager, COMPRESSION_NONE, COMPRESSION_ZLIB, compressionLevel, compressionsCS, compressionsSC, daemon, executor, extendedIdentificationSanitization, HMAC_MD5, HMAC_MD5_96, HMAC_MD5_ETM, HMAC_RIPEMD160, HMAC_RIPEMD160_ETM, HMAC_SHA1, HMAC_SHA1_96, HMAC_SHA1_ETM, HMAC_SHA256, HMAC_SHA256_96, HMAC_SHA256_ETM, HMAC_SHA512, HMAC_SHA512_96, HMAC_SHA512_ETM, idleAuthenticationTimeoutSeconds, idleConnectionTimeout, keepAliveDataMaxLength, keepAliveInterval, KEX_DIFFIE_HELLMAN_ECDH_NISTP_256, KEX_DIFFIE_HELLMAN_ECDH_NISTP_384, KEX_DIFFIE_HELLMAN_ECDH_NISTP_521, KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1, KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA256, KEX_DIFFIE_HELLMAN_GROUP1_SHA1, KEX_DIFFIE_HELLMAN_GROUP14_SHA1, KEX_DIFFIE_HELLMAN_GROUP14_SHA256, KEX_DIFFIE_HELLMAN_GROUP15_SHA512, KEX_DIFFIE_HELLMAN_GROUP16_SHA512, KEX_DIFFIE_HELLMAN_GROUP17_SHA512, KEX_DIFFIE_HELLMAN_GROUP18_SHA512, KEYBOARD_INTERACTIVE_AUTHENTICATION, keyExchanges, killTunnelsOnRemoteForwardingCancel, locale, macCS, macSC, MAX_NUM_BYTES_BEFORE_REKEY, MAX_NUM_PACKETS_BEFORE_REKEY, maxChannels, maxDHGroupExchangeKeySize, maximumPacketLength, maximumSocketsBacklogPerRemotelyForwardedConnection, minDHGroupExchangeKeySize, PASSWORD_AUTHENTICATION, prefCipherCS, prefCipherSC, prefCompressionCS, prefCompressionSC, preferredDHGroupExchangeKeySize, prefKeyExchange, prefMacCS, prefMacSC, prefPublicKey, PUBLIC_KEY_ECDSA_SHA2_NISPTP_256, PUBLIC_KEY_ECDSA_SHA2_NISPTP_384, PUBLIC_KEY_ECDSA_SHA2_NISPTP_521, PUBLIC_KEY_ED25519, PUBLIC_KEY_RSA_SHA256, PUBLIC_KEY_RSA_SHA512, PUBLIC_KEY_SSHDSS, PUBLIC_KEY_SSHRSA, PUBLICKEY_AUTHENTICATION, publicKeys, sendIgnorePacketOnIdle, signatures, softwareVersionComments
Fields inherited from class com.sshtools.synergy.nio.ProtocolContext
keepAlive, receiveBufferSize, reuseAddress, sendBufferSize, tcpNoDelay
-
Constructor Summary
ConstructorsConstructorDescriptionSshClientContext
(com.sshtools.common.ssh.SecurityLevel securityLevel) SshClientContext
(com.sshtools.synergy.nio.SshEngine daemon) SshClientContext
(com.sshtools.synergy.nio.SshEngine daemon, com.sshtools.common.ssh.components.ComponentManager componentManager, com.sshtools.common.ssh.SecurityLevel securityLevel) SshClientContext
(com.sshtools.synergy.nio.SshEngine daemon, com.sshtools.common.ssh.SecurityLevel securityLevel) -
Method Summary
Modifier and TypeMethodDescriptionaddGlobalRequestHandler
(com.sshtools.synergy.ssh.GlobalRequestHandler<SshClientContext> handler) addStateListener
(ClientStateListener stateListener) protected void
com.sshtools.synergy.nio.ProtocolEngine
createEngine
(com.sshtools.synergy.nio.ConnectRequestFuture connectFuture) com.sshtools.synergy.ssh.ChannelFactory<SshClientContext>
com.sshtools.synergy.ssh.ConnectionManager<SshClientContext>
com.sshtools.synergy.nio.SshEngineContext
final com.sshtools.synergy.nio.SshEngine
com.sshtools.synergy.ssh.ForwardingManager<SshClientContext>
com.sshtools.synergy.ssh.GlobalRequestHandler<SshClientContext>
com.sshtools.common.knownhosts.HostKeyVerification
boolean
com.sshtools.synergy.nio.SocketConnectionFactory
int
Get the username of this connection.void
keysExchanged
(boolean first) setBannerDisplay
(BannerDisplay bannerDisplay) void
setChannelFactory
(com.sshtools.synergy.ssh.ChannelFactory<SshClientContext> channelFactory) setConnectionManager
(com.sshtools.synergy.ssh.ConnectionManager<SshClientContext> connectionManager) setForwardingManager
(com.sshtools.synergy.ssh.ForwardingManager<SshClientContext> forwardingManager) setHostKeyVerification
(com.sshtools.common.knownhosts.HostKeyVerification hkv) void
setPreferKeyboardInteractiveOverPassword
(boolean preferKeyboardInteractiveOverPassword) void
setPreferredPublicKey
(String prefPublicKey) setSubsystemCacheSize
(int subsystemCacheSize) setUsername
(String username) Set the username for this connection.com.sshtools.common.ssh.components.ComponentFactory<com.sshtools.synergy.ssh.components.SshKeyExchange<?>>
boolean
Methods inherited from class com.sshtools.synergy.ssh.SshContext
addOperationListener, enableFIPSMode, getByteBufferPool, getChannelLimit, getCiphersCS, getCiphersSC, getComponentManager, getCompressionLevel, getExecutorListeners, getExecutorService, getForwardingPolicy, getHttpRedirectUrl, getIdleAuthenticationTimeoutSeconds, getIdleConnectionTimeoutSeconds, getKeepAliveDataMaxLength, getKeepAliveInterval, getKeyExchangePacketLimit, getKeyExchanges, getKeyExchangeTransferLimit, getLocale, getMacsCS, getMacsSC, getMaxDHGroupExchangeKeySize, getMaximumPacketLength, getMaximumSocketsBacklogPerRemotelyForwardedConnection, getMinDHGroupExchangeKeySize, getPolicy, getPolicy, getPreferredCipherCS, getPreferredCipherSC, getPreferredCompressionCS, getPreferredCompressionSC, getPreferredDHGroupExchangeKeySize, getPreferredKeyExchange, getPreferredMacCS, getPreferredMacSC, getPublicKeys, getRemoteForwardingCancelKillsTunnels, getSoftwareVersionComments, getSupportedSignatures, hasPolicy, init, isExtendedIdentificationSanitization, isHttpRedirect, isSendIgnorePacketOnIdle, isSHA1SignaturesSupported, listPublicKeys, removeOperationListener, setChannelLimit, setCipherPreferredPositionCS, setCipherPreferredPositionSC, setCompressionLevel, setExtendedIdentificationSanitization, setHttpRedirect, setHttpRedirectUrl, setIdleAuthenticationTimeoutSeconds, setIdleConnectionTimeoutSeconds, setKeepAliveDataMaxLength, setKeepAliveInterval, setKeyExchangePacketLimit, setKeyExchangePreferredPosition, setKeyExchangeTransferLimit, setLocale, setMacPreferredPositionCS, setMacPreferredPositionSC, setMaxDHGroupExchangeKeySize, setMaximumPacketLength, setMaximumSocketsBacklogPerRemotelyForwardedConnection, setMinDHGroupExchangeKeySize, setPolicy, setPreferredCipherCS, setPreferredCipherCS, setPreferredCipherCS, setPreferredCipherSC, setPreferredCipherSC, setPreferredCipherSC, setPreferredCompressionCS, setPreferredCompressionSC, setPreferredDHGroupExchangeKeySize, setPreferredKeyExchange, setPreferredKeyExchange, setPreferredMacCS, setPreferredMacCS, setPreferredMacCS, setPreferredMacSC, setPreferredMacSC, setPreferredMacSC, setPublicKeyPreferredPosition, setRemoteForwardingCancelKillsTunnels, setSendIgnorePacketOnIdle, setSHA1SignaturesSupported, setSocketConnectionFactory, setSoftwareVersionComments, shutdown, supportedCiphersCS, supportedCiphersSC, supportedCompressionsCS, supportedCompressionsSC, supportedMacsCS, supportedMacsSC, supportedPublicKeys
Methods inherited from class com.sshtools.synergy.nio.ProtocolContext
enableHTTPProxy, enableHTTPProxy, enableHTTPProxy, enableHTTPProxy, enableSocks4Proxy, enableSocks5Proxy, getOptionalHeaders, getProxyHostname, getProxyPassword, getProxyPort, getProxyType, getProxyUsername, getReceiveBufferSize, getSendBufferSize, getSocketOptionKeepAlive, getSocketOptionReuseAddress, getSocketOptionTcpNoDelay, getUserAgent, isProxyEnabled, isResolveLocally, setReceiveBufferSize, setSendBufferSize, setSocketOptionKeepAlive, setSocketOptionReuseAddress, setSocketOptionTcpNoDelay
-
Field Details
-
transport
-
-
Constructor Details
-
SshClientContext
- Throws:
IOException
com.sshtools.common.ssh.SshException
-
SshClientContext
public SshClientContext(com.sshtools.synergy.nio.SshEngine daemon, com.sshtools.common.ssh.components.ComponentManager componentManager, com.sshtools.common.ssh.SecurityLevel securityLevel) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
SshClientContext
public SshClientContext(com.sshtools.synergy.nio.SshEngine daemon) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
SshClientContext
public SshClientContext(com.sshtools.synergy.nio.SshEngine daemon, com.sshtools.common.ssh.SecurityLevel securityLevel) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
SshClientContext
public SshClientContext(com.sshtools.common.ssh.SecurityLevel securityLevel) throws IOException, com.sshtools.common.ssh.SshException - Throws:
IOException
com.sshtools.common.ssh.SshException
-
-
Method Details
-
createEngine
public com.sshtools.synergy.nio.ProtocolEngine createEngine(com.sshtools.synergy.nio.ConnectRequestFuture connectFuture) throws IOException - Specified by:
createEngine
in classcom.sshtools.synergy.ssh.SshContext
- Throws:
IOException
-
getEngine
public final com.sshtools.synergy.nio.SshEngine getEngine()- Overrides:
getEngine
in classcom.sshtools.synergy.ssh.SshContext
-
setUsername
Set the username for this connection.- Parameters:
username
-
-
getUsername
Get the username of this connection.- Returns:
-
addStateListener
-
getStateListeners
-
getForwardingManager
- Specified by:
getForwardingManager
in classcom.sshtools.synergy.ssh.SshContext
-
setForwardingManager
public SshClientContext setForwardingManager(com.sshtools.synergy.ssh.ForwardingManager<SshClientContext> forwardingManager) -
keysExchanged
public void keysExchanged(boolean first) -
getAuthenticationClient
-
configureKeyExchanges
protected void configureKeyExchanges()- Specified by:
configureKeyExchanges
in classcom.sshtools.synergy.ssh.SshContext
-
testClientKeyExchangeAlgorithm
public boolean testClientKeyExchangeAlgorithm(SshKeyExchangeClientFactory<? extends SshKeyExchangeClient> cls) -
getSupportedPublicKeys
- Specified by:
getSupportedPublicKeys
in classcom.sshtools.synergy.ssh.SshContext
-
supportedKeyExchanges
public com.sshtools.common.ssh.components.ComponentFactory<com.sshtools.synergy.ssh.components.SshKeyExchange<?>> supportedKeyExchanges()- Overrides:
supportedKeyExchanges
in classcom.sshtools.synergy.ssh.SshContext
-
getPreferredPublicKey
- Specified by:
getPreferredPublicKey
in classcom.sshtools.synergy.ssh.SshContext
-
setPreferredPublicKey
-
getConnectionManager
- Specified by:
getConnectionManager
in classcom.sshtools.synergy.ssh.SshContext
-
setConnectionManager
public SshClientContext setConnectionManager(com.sshtools.synergy.ssh.ConnectionManager<SshClientContext> connectionManager) -
addAuthenticator
-
getAuthenticators
-
getBannerDisplay
-
setBannerDisplay
-
getSubsystemCacheSize
public int getSubsystemCacheSize() -
setSubsystemCacheSize
-
getChannelFactory
- Specified by:
getChannelFactory
in classcom.sshtools.synergy.ssh.SshContext
-
setChannelFactory
public void setChannelFactory(com.sshtools.synergy.ssh.ChannelFactory<SshClientContext> channelFactory) -
getDaemonContext
public com.sshtools.synergy.nio.SshEngineContext getDaemonContext()- Overrides:
getDaemonContext
in classcom.sshtools.synergy.ssh.SshContext
-
addGlobalRequestHandler
public SshClientContext addGlobalRequestHandler(com.sshtools.synergy.ssh.GlobalRequestHandler<SshClientContext> handler) -
getGlobalRequestHandler
public com.sshtools.synergy.ssh.GlobalRequestHandler<SshClientContext> getGlobalRequestHandler(String name) - Specified by:
getGlobalRequestHandler
in classcom.sshtools.synergy.ssh.SshContext
-
getSocketConnectionFactory
public com.sshtools.synergy.nio.SocketConnectionFactory getSocketConnectionFactory()- Overrides:
getSocketConnectionFactory
in classcom.sshtools.synergy.ssh.SshContext
-
getHostKeyVerification
public com.sshtools.common.knownhosts.HostKeyVerification getHostKeyVerification() -
setHostKeyVerification
public SshClientContext setHostKeyVerification(com.sshtools.common.knownhosts.HostKeyVerification hkv) -
getPreferKeyboardInteractiveOverPassword
public boolean getPreferKeyboardInteractiveOverPassword() -
setPreferKeyboardInteractiveOverPassword
public void setPreferKeyboardInteractiveOverPassword(boolean preferKeyboardInteractiveOverPassword)
-