Class SshContext
- All Implemented Interfaces:
Context,ExecutorServiceProvider
SshEngine.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.sshtools.common.util.ByteBufferPoolstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected ComponentFactory<SshCipher>protected ComponentFactory<SshCipher>protected ComponentManagerstatic final StringCompression offstatic final StringZLIB compressionprotected intprotected ComponentFactory<SshCompression>protected ComponentFactory<SshCompression>protected SshEngineprotected static ExecutorServiceprotected booleanstatic final StringMD5 message authenticationstatic final StringMD5 96 bit message authenticationstatic final Stringstatic final Stringstatic final Stringstatic final StringSHA1 message authenticationstatic final StringSHA1 96 bit message authenticationstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected intprotected intprotected intprotected intstatic final Stringstatic final Stringstatic final Stringstatic final StringConstant for the algorithm name "diffie-hellman-group-exchange-sha1".static final Stringstatic final StringConstant for the algorithm name "diffie-hellman-group1-sha1".static final StringConstant for the algorithm name "diffie-hellman-group14-sha1".static final StringConstant for the algorithm name "diffie-hellman-group14-sha256".static final StringConstant for the algorithm name "diffie-hellman-group15-sha512".static final StringConstant for the algorithm name "diffie-hellman-group16-sha512".static final StringConstant for the algorithm name "diffie-hellman-group17-sha512".static final StringConstant for the algorithm name "diffie-hellman-group18-sha512".static final Stringprotected ComponentFactory<SshKeyExchange<? extends SshContext>>protected booleanprotected Localeprotected ComponentFactory<SshHmac>protected ComponentFactory<SshHmac>protected longprotected longprotected intprotected intprotected intprotected intprotected intstatic final StringIdentifier for password authenticationprotected Stringprotected Stringprotected Stringprotected Stringprotected intprotected Stringprotected Stringprotected Stringprotected Stringstatic final StringECDSA 256 bit Public Keystatic final StringECDSA 384 bit Public Keystatic final StringECDSA 521 bit Public Keystatic final StringED25519 Public keystatic final StringED25519 Public keystatic final StringRSA key with SHA256 signaturestatic final StringRSA key with SHA512 signaturestatic final StringSSH2 DSA Public Keystatic final StringSSH2 RSA Public Keystatic final StringIdentifier for public key authenticationprotected ComponentFactory<SshPublicKey>protected booleanprotected ComponentFactory<SshPublicKey>protected SocketConnectionFactoryprotected StringFields inherited from class com.sshtools.synergy.nio.ProtocolContext
keepAlive, receiveBufferSize, reuseAddress, sendBufferSize, tcpNoDelay -
Constructor Summary
ConstructorsConstructorDescriptionSshContext(ComponentManager componentManager, SecurityLevel securityLevel) Constructs a default context but does not set the daemonSshContext(SshEngine daemon, ComponentManager componentManager, SecurityLevel securityLevel) Constructs a default context -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract voidabstract ProtocolEnginecreateEngine(ConnectRequestFuture connectFuture) Create a protocol engine.voidcom.sshtools.common.util.ByteBufferPoolabstract ChannelFactory<? extends SshContext>intGet the maximum number of open channels allowed by each client.Get the ciphers for the Server->Client stream.intGet the current compression levelabstract ConnectionManager<? extends SshContext>Get the instance of the SSHD for this context.abstract ForwardingManager<? extends SshContext>abstract GlobalRequestHandler<? extends SshContext>getGlobalRequestHandler(String requestname) intintShould the connection be disconnected on session timeout?intGet the maximum data length for the keep-alive packet.intGet the current keep-alive interval (in seconds).longGet the number of packets to send before a key exchange is forcedGet the ciphers for the Server->Client stream.longGet the number of bytes to transfer before a key exchange is forced.Get the ciphers for the Client->Server stream.Get the ciphers for the Server->Client stream.intintGet the maximum supported length of an SSH packet.intint<P> P<P> PGet the currently preferred cipher for the Client->Server stream.Get the currently preferred cipher for the Server->Client stream.Get the currently preferred compression for the Client->Server stream.Get the currently preferred compression for the Server->Client stream.intGet the currently preferred key exchange method.Get the currently preferred mac for the Client->Server stream.Get the currently supported mac for the Server-Client stream.abstract StringGet the ciphers for the Server->Client stream.booleanDetermines whether the cancellation of a remote forwarding drops currently active tunnelsGet the software/version/comments field that is to be used in the SSH protocols negotiation procedure.abstract StringbooleanvoidInitialise the SshContext by setting the daemonbooleanbooleanbooleanbooleanprotected StringlistPublicKeys(String... keys) voidvoidsetChannelLimit(int maxChannels) Set the maximum number of open channels allowed by each client (defaults to 100).voidsetCipherPreferredPositionCS(String name, int position) voidsetCipherPreferredPositionSC(String name, int position) voidsetCompressionLevel(int compressionLevel) Set the compression level to use if compression is enabledvoidsetExtendedIdentificationSanitization(boolean extendedIdentificationSanitization) voidsetHttpRedirect(boolean httpRedirect) voidsetHttpRedirectUrl(String httpRedirectUrl) voidsetIdleAuthenticationTimeoutSeconds(int idleAuthenticationTimeoutSeconds) voidsetIdleConnectionTimeoutSeconds(int idleConnectionTimeout) Inform the context that the connection should be disconnected on session timeoutvoidsetKeepAliveDataMaxLength(int keepAliveDataMaxLength) Set the maximum data length for the keep-alive packet.voidsetKeepAliveInterval(int keepAliveInterval) Set the keep-alive interval (in seconds).voidsetKeyExchangePacketLimit(int MAX_NUM_PACKETS_BEFORE_REKEY) This tells the server how many packets to use before a key exchange.voidsetKeyExchangePreferredPosition(String name, int position) voidsetKeyExchangeTransferLimit(long MAX_NUM_BYTES_BEFORE_REKEY) This limit tells the server when to force a key exchange.voidvoidsetMacPreferredPositionCS(String name, int position) voidsetMacPreferredPositionSC(String name, int position) voidsetMaxDHGroupExchangeKeySize(int maxDHGroupExchangeKeySize) voidsetMaximumPacketLength(int maximumPacketLength) Set the maximum supported length of an SSH packet.voidsetMaximumSocketsBacklogPerRemotelyForwardedConnection(int maximumSocketsBacklogPerRemotelyForwardedConnection) voidsetMinDHGroupExchangeKeySize(int minDHGroupExchangeKeySize) voidvoidsetPreferredCipherCS(int[] order) Set the preferred SC cipher ordervoidsetPreferredCipherCS(String name) Set the preferred cipher for the Client->Server stream.voidsetPreferredCipherCS(String[] order) Set the preferred CS cipher ordervoidsetPreferredCipherSC(int[] order) Set the preferred SC cipher ordervoidsetPreferredCipherSC(String name) Set the preferred cipher for the Server->Client stream.voidsetPreferredCipherSC(String[] order) Set the preferred SC cipher ordervoidSet the preferred compression for the Client->Server stream.voidSet the preferred compression for the Server->Client stream.voidsetPreferredDHGroupExchangeKeySize(int preferredDHGroupExchangeKeySize) voidSet the preferred key exchange method.voidsetPreferredKeyExchange(String[] order) voidsetPreferredMacCS(int[] order) Set the preferred CS Mac ordervoidsetPreferredMacCS(String name) Set the preferred MAC for the Client->Server stream.voidsetPreferredMacCS(String[] order) voidsetPreferredMacSC(int[] order) Set the preferred SC Mac ordervoidsetPreferredMacSC(String name) Set the preferred mac for the Server->Client stream.voidsetPreferredMacSC(String[] order) voidsetPublicKeyPreferredPosition(String name, int position) voidsetRemoteForwardingCancelKillsTunnels(boolean killTunnelsOnRemoteForwardingCancel) When the user cancels a remote forwarding should active tunnels be dropped?voidsetSendIgnorePacketOnIdle(boolean sendIgnorePacketOnIdle) voidsetSHA1SignaturesSupported(boolean sha1SignaturesSupported) voidsetSocketConnectionFactory(SocketConnectionFactory socketConnectionFactory) voidsetSoftwareVersionComments(String softwareVersionComments) Set the current implementations software/version/comments field that is used during the SSH protocols negotiation procedure.voidshutdown()Returns a factory implementation that enables configuration of the available ciphers.Get the supported compression algorithms.ComponentFactory<SshKeyExchange<? extends SshContext>>Get the supported key exchange methods.Get the supported message authentication algorithms.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
-
CIPHER_TRIPLEDES_CBC
- See Also:
-
CIPHER_TRIPLEDES_CTR
- See Also:
-
CIPHER_BLOWFISH_CBC
- See Also:
-
CIPHER_AES128_CBC
- See Also:
-
CIPHER_AES192_CBC
- See Also:
-
CIPHER_AES256_CBC
- See Also:
-
CIPHER_AES128_CTR
- See Also:
-
CIPHER_AES192_CTR
- See Also:
-
CIPHER_AES256_CTR
- See Also:
-
CIPHER_ARCFOUR
- See Also:
-
CIPHER_ARCFOUR_128
- See Also:
-
CIPHER_ARCFOUR_256
- See Also:
-
CIPHER_AES_GCM_128
- See Also:
-
CIPHER_AES_GCM_256
- See Also:
-
HMAC_SHA1
SHA1 message authentication- See Also:
-
HMAC_SHA1_ETM
- See Also:
-
HMAC_SHA1_96
SHA1 96 bit message authentication- See Also:
-
HMAC_MD5
MD5 message authentication- See Also:
-
HMAC_MD5_ETM
- See Also:
-
HMAC_MD5_96
MD5 96 bit message authentication- See Also:
-
HMAC_SHA256
- See Also:
-
HMAC_SHA256_ETM
- See Also:
-
HMAC_SHA256_96
- See Also:
-
HMAC_SHA512
- See Also:
-
HMAC_SHA512_ETM
- See Also:
-
HMAC_SHA512_96
- See Also:
-
HMAC_RIPEMD160
- See Also:
-
HMAC_RIPEMD160_ETM
- See Also:
-
COMPRESSION_NONE
Compression off- See Also:
-
COMPRESSION_ZLIB
ZLIB compression- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP1_SHA1
Constant for the algorithm name "diffie-hellman-group1-sha1".- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
Constant for the algorithm name "diffie-hellman-group-exchange-sha1".- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA256
- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP14_SHA1
Constant for the algorithm name "diffie-hellman-group14-sha1".- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP14_SHA256
Constant for the algorithm name "diffie-hellman-group14-sha256".- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP15_SHA512
Constant for the algorithm name "diffie-hellman-group15-sha512".- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP16_SHA512
Constant for the algorithm name "diffie-hellman-group16-sha512".- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP17_SHA512
Constant for the algorithm name "diffie-hellman-group17-sha512".- See Also:
-
KEX_DIFFIE_HELLMAN_GROUP18_SHA512
Constant for the algorithm name "diffie-hellman-group18-sha512".- See Also:
-
KEX_DIFFIE_HELLMAN_ECDH_NISTP_256
- See Also:
-
KEX_DIFFIE_HELLMAN_ECDH_NISTP_384
- See Also:
-
KEX_DIFFIE_HELLMAN_ECDH_NISTP_521
- See Also:
-
PUBLIC_KEY_SSHDSS
SSH2 DSA Public Key- See Also:
-
PUBLIC_KEY_ED25519
ED25519 Public key- See Also:
-
PUBLIC_KEY_ED448
ED25519 Public key- See Also:
-
PUBLIC_KEY_SSHRSA
SSH2 RSA Public Key- See Also:
-
PUBLIC_KEY_ECDSA_SHA2_NISPTP_256
ECDSA 256 bit Public Key- See Also:
-
PUBLIC_KEY_ECDSA_SHA2_NISPTP_384
ECDSA 384 bit Public Key- See Also:
-
PUBLIC_KEY_ECDSA_SHA2_NISPTP_521
ECDSA 521 bit Public Key- See Also:
-
PUBLIC_KEY_RSA_SHA256
RSA key with SHA256 signature- See Also:
-
PUBLIC_KEY_RSA_SHA512
RSA key with SHA512 signature- See Also:
-
PASSWORD_AUTHENTICATION
Identifier for password authentication- See Also:
-
PUBLICKEY_AUTHENTICATION
Identifier for public key authentication- See Also:
-
KEYBOARD_INTERACTIVE_AUTHENTICATION
- See Also:
-
maximumSocketsBacklogPerRemotelyForwardedConnection
protected int maximumSocketsBacklogPerRemotelyForwardedConnection -
socketConnectionFactory
-
compressionsCS
-
compressionsSC
-
ciphersCS
-
ciphersSC
-
keyExchanges
-
macCS
-
macSC
-
publicKeys
-
signatures
-
prefCipherCS
-
prefCipherSC
-
prefMacCS
-
prefMacSC
-
prefCompressionCS
-
prefCompressionSC
-
prefKeyExchange
-
prefPublicKey
-
maxChannels
protected int maxChannels -
compressionLevel
protected int compressionLevel -
maximumPacketLength
protected int maximumPacketLength -
MAX_NUM_PACKETS_BEFORE_REKEY
protected long MAX_NUM_PACKETS_BEFORE_REKEY -
MAX_NUM_BYTES_BEFORE_REKEY
protected long MAX_NUM_BYTES_BEFORE_REKEY -
daemon
-
softwareVersionComments
-
extendedIdentificationSanitization
protected boolean extendedIdentificationSanitization -
killTunnelsOnRemoteForwardingCancel
protected boolean killTunnelsOnRemoteForwardingCancel -
sendIgnorePacketOnIdle
protected boolean sendIgnorePacketOnIdle -
idleConnectionTimeout
protected int idleConnectionTimeout -
idleAuthenticationTimeoutSeconds
protected int idleAuthenticationTimeoutSeconds -
keepAliveInterval
protected int keepAliveInterval -
keepAliveDataMaxLength
protected int keepAliveDataMaxLength -
executor
-
locale
-
byteBufferPool
protected com.sshtools.common.util.ByteBufferPool byteBufferPool -
minDHGroupExchangeKeySize
protected int minDHGroupExchangeKeySize -
preferredDHGroupExchangeKeySize
protected int preferredDHGroupExchangeKeySize -
maxDHGroupExchangeKeySize
protected int maxDHGroupExchangeKeySize -
componentManager
-
-
Constructor Details
-
SshContext
public SshContext(ComponentManager componentManager, SecurityLevel securityLevel) throws IOException, SshException Constructs a default context but does not set the daemon- Parameters:
componentManager-- Throws:
SshExceptionIOException
-
SshContext
public SshContext(SshEngine daemon, ComponentManager componentManager, SecurityLevel securityLevel) throws IOException, SshException Constructs a default context- Parameters:
componentManager-- Throws:
IOExceptionSshException
-
-
Method Details
-
init
Initialise the SshContext by setting the daemon -
getConnectionManager
-
createEngine
Description copied from class:ProtocolContextCreate a protocol engine.- Specified by:
createEnginein classProtocolContext- Returns:
- ProtocolEngine
- Throws:
IOException
-
getSupportedPublicKeys
-
configureKeyExchanges
protected abstract void configureKeyExchanges() -
getPreferredPublicKey
-
getChannelFactory
-
getPolicy
-
getPolicy
-
setPolicy
-
hasPolicy
-
getComponentManager
- Specified by:
getComponentManagerin interfaceContext
-
addOperationListener
-
removeOperationListener
-
getExecutorListeners
- Specified by:
getExecutorListenersin interfaceExecutorServiceProvider
-
setSocketConnectionFactory
- Overrides:
setSocketConnectionFactoryin classProtocolContext
-
getSocketConnectionFactory
- Overrides:
getSocketConnectionFactoryin classProtocolContext
-
getGlobalRequestHandler
public abstract GlobalRequestHandler<? extends SshContext> getGlobalRequestHandler(String requestname) -
getEngine
Get the instance of the SSHD for this context.- Returns:
- Daemon
-
setChannelLimit
public void setChannelLimit(int maxChannels) Set the maximum number of open channels allowed by each client (defaults to 100).- Parameters:
maxChannels-
-
getChannelLimit
public int getChannelLimit()Get the maximum number of open channels allowed by each client.- Returns:
- int
-
getSupportedSignatures
-
supportedCiphersCS
Returns a factory implementation that enables configuration of the available ciphers.
The standard default ciphers installed are 3DES and Blowfish, however the J2SSH Maverick API on which this server is based also supports a number of optional ciphers AES, CAST and Twofish. These can be installed by adding the sshtools-cipher.jar to your class path and using the following code within your SSHD
SshDaemon#configure(ConfigurationContext)method.// import the cipher package import com.sshtools.cipher.*; // Add AES context.supportedCiphers().add(AES128Cbc.AES128_CBC, AES128Cbc.class); context.supportedCiphers().add(AES192Cbc.AES192_CBC, AES192Cbc.class); context.supportedCiphers().add(AES256Cbc.AES256_CBC, AES256Cbc.class); // Add Twofish - note the 256 bit cipher has two different entries to maintain backwards compatibility context.supportedCiphers().add(Twofish128Cbc.TWOFISH128_CBC, Twofish128Cbc.class); context.supportedCiphers().add(Twofish192Cbc.TWOFISH192_CBC, Twofish192Cbc.class); context.supportedCiphers().add(Twofish256Cbc.TWOFISH256_CBC, Twofish256Cbc.class); context.supportedCiphers().add(Twofish256Cbc.TWOFISH_CBC, Twofish256Cbc.class); // Add CAST context.supportedCiphers().add(CAST128Cbc.CAST128_CBC, CAST128Cbc.class);
- Returns:
- the component factory
-
supportedCiphersSC
-
getPreferredCipherCS
Get the currently preferred cipher for the Client->Server stream.- Returns:
- the preferred Client-Server cipher
-
setPreferredCipherCS
Set the preferred cipher for the Client->Server stream.
Use the static fields available within this class (or the com.sshtools.cipher classes) to identify the correct cipher.
context.setPreferredCipherCS(ConfigurationContext.CIPHER_BLOWFISH_CBC);
The default cipher is 3DES- Parameters:
name-- Throws:
IOException- if the cipher is not supportedSshException
-
getPreferredCipherSC
Get the currently preferred cipher for the Server->Client stream.- Returns:
- the preferred Server-Client cipher
-
getSoftwareVersionComments
Get the software/version/comments field that is to be used in the SSH protocols negotiation procedure.- Returns:
- String
-
setSoftwareVersionComments
Set the current implementations software/version/comments field that is used during the SSH protocols negotiation procedure. This value MUST consist of printable US-ASCII characters with the exception of whitespace and the minus sign (-) and be no longer than 200 characters.- Parameters:
softwareVersionComments-
-
setPreferredCipherSC
Set the preferred cipher for the Server->Client stream.
Use the static fields available within this class (or the com.sshtools.cipher classes) to identify the correct cipher.
context.setPreferredCipherSC(ConfigurationContext.CIPHER_BLOWFISH_CBC);
The default cipher is 3DES- Parameters:
name-- Throws:
IOExceptionSshException
-
supportedMacsCS
Get the supported message authentication algorithms.
There are no optional MAC algorithms currently available and this method is supplied in preperation for future enhancements.
- Returns:
- the component factory
-
supportedMacsSC
-
getPreferredMacCS
Get the currently preferred mac for the Client->Server stream.- Returns:
- the preferred Client-Server mac
-
setPreferredMacCS
Set the preferred MAC for the Client->Server stream.
Use the static fields available within this class to identify the correct MAC.
context.setPreferredMacCS(ConfigurationContext.HMAC_MD5);
The default MAC is HMAC_SHA1- Parameters:
name-- Throws:
IOExceptionSshException
-
getPreferredMacSC
Get the currently supported mac for the Server-Client stream.- Returns:
- the preferred Server-Client mac
-
setRemoteForwardingCancelKillsTunnels
public void setRemoteForwardingCancelKillsTunnels(boolean killTunnelsOnRemoteForwardingCancel) When the user cancels a remote forwarding should active tunnels be dropped?- Parameters:
killTunnelsOnRemoteForwardingCancel- boolean
-
getRemoteForwardingCancelKillsTunnels
public boolean getRemoteForwardingCancelKillsTunnels()Determines whether the cancellation of a remote forwarding drops currently active tunnels- Returns:
- boolean
-
isExtendedIdentificationSanitization
public boolean isExtendedIdentificationSanitization() -
setExtendedIdentificationSanitization
public void setExtendedIdentificationSanitization(boolean extendedIdentificationSanitization) -
setPreferredMacSC
Set the preferred mac for the Server->Client stream.
Use the static fields available within this class to identify the correct MAC.
context.setPreferredMacCS(ConfigurationContext.HMAC_MD5);
The default MAC is HMAC_SHA1- Parameters:
name-- Throws:
IOExceptionSshException
-
supportedCompressionsCS
Get the supported compression algorithms.
There are no optional compression algorithms currently available and this method is supplied in preperation for future enhancements.
- Returns:
- the component factory
-
supportedCompressionsSC
-
getPreferredCompressionCS
Get the currently preferred compression for the Client->Server stream.- Returns:
- the preferred Client-Server compression
-
setPreferredCompressionCS
Set the preferred compression for the Client->Server stream.
It is recommended that you do not set the preferred compression so that the client has control over the compression selection.
- Parameters:
name-- Throws:
IOException
-
getPreferredCompressionSC
Get the currently preferred compression for the Server->Client stream.- Returns:
- the preferred Server->Client compression
-
setPreferredCompressionSC
Set the preferred compression for the Server->Client stream.
It is recommended that you do not set the preferred compression so that the client has control over the compression selection.
- Parameters:
name-- Throws:
IOException
-
supportedKeyExchanges
Get the supported key exchange methods.
There are no optional key exchange algorithms currently available and this method is supplied in preperation for future enhancements.
- Returns:
- the component factory
-
getPreferredKeyExchange
Get the currently preferred key exchange method.- Returns:
- the preferred key exhcange
-
setPreferredKeyExchange
Set the preferred key exchange method.
There is only one supported key exchange algorithm and as such this method is supplied in preperation for future enhancements.
- Parameters:
name-- Throws:
IOExceptionSshException
-
setCompressionLevel
public void setCompressionLevel(int compressionLevel) Set the compression level to use if compression is enabled- Parameters:
compressionLevel- int
-
getCompressionLevel
public int getCompressionLevel()Get the current compression level- Returns:
- int
-
getMaximumSocketsBacklogPerRemotelyForwardedConnection
public int getMaximumSocketsBacklogPerRemotelyForwardedConnection() -
setMaximumSocketsBacklogPerRemotelyForwardedConnection
public void setMaximumSocketsBacklogPerRemotelyForwardedConnection(int maximumSocketsBacklogPerRemotelyForwardedConnection) -
getCiphersSC
Get the ciphers for the Server->Client stream.- Returns:
- the Server-Client ciphers in order of preference
-
getCiphersCS
-
getMacsCS
Get the ciphers for the Client->Server stream.- Returns:
- the Client-Server ciphers in order of preference
-
getMacsSC
Get the ciphers for the Server->Client stream.- Returns:
- the Server-Client ciphers in order of preference
-
getPublicKeys
Get the ciphers for the Server->Client stream.- Returns:
- the Server-Client ciphers in order of preference
-
getKeyExchanges
Get the ciphers for the Server->Client stream.- Returns:
- the Server-Client ciphers in order of preference
-
setPreferredCipherSC
Set the preferred SC cipher order- Parameters:
order- , list of indices to be moved to the top.- Throws:
SshException
-
setPreferredCipherSC
Set the preferred SC cipher order- Parameters:
order-- Throws:
SshException
-
setPreferredCipherCS
Set the preferred SC cipher order- Parameters:
order- , list of indices to be moved to the top.- Throws:
SshException
-
setPreferredCipherCS
Set the preferred CS cipher order- Parameters:
order-- Throws:
SshException
-
setPreferredMacSC
Set the preferred SC Mac order- Parameters:
order- , list of indices to be moved to the top.- Throws:
SshException
-
setPreferredMacSC
- Parameters:
order-- Throws:
SshException
-
setPreferredKeyExchange
- Parameters:
order-- Throws:
SshException
-
setPreferredMacCS
Set the preferred CS Mac order- Parameters:
order- , list of indices to be moved to the top.- Throws:
SshException
-
setPreferredMacCS
- Throws:
SshException
-
setCipherPreferredPositionCS
- Throws:
SshException
-
setCipherPreferredPositionSC
- Throws:
SshException
-
setMacPreferredPositionSC
- Throws:
SshException
-
setMacPreferredPositionCS
- Throws:
SshException
-
setPublicKeyPreferredPosition
- Throws:
SshException
-
setKeyExchangePreferredPosition
- Throws:
SshException
-
setMaximumPacketLength
public void setMaximumPacketLength(int maximumPacketLength) Set the maximum supported length of an SSH packet.- Parameters:
maximumPacketLength- int
-
getMaximumPacketLength
public int getMaximumPacketLength()Get the maximum supported length of an SSH packet.- Specified by:
getMaximumPacketLengthin interfaceContext- Returns:
- int
-
setKeyExchangeTransferLimit
public void setKeyExchangeTransferLimit(long MAX_NUM_BYTES_BEFORE_REKEY) This limit tells the server when to force a key exchange.- Parameters:
MAX_NUM_BYTES_BEFORE_REKEY- int
-
setKeyExchangePacketLimit
public void setKeyExchangePacketLimit(int MAX_NUM_PACKETS_BEFORE_REKEY) This tells the server how many packets to use before a key exchange.- Parameters:
MAX_NUM_PACKETS_BEFORE_REKEY- int
-
getKeyExchangeTransferLimit
public long getKeyExchangeTransferLimit()Get the number of bytes to transfer before a key exchange is forced.- Returns:
- int
-
getKeyExchangePacketLimit
public long getKeyExchangePacketLimit()Get the number of packets to send before a key exchange is forced- Returns:
- int
-
getIdleConnectionTimeoutSeconds
public int getIdleConnectionTimeoutSeconds()Should the connection be disconnected on session timeout?- Returns:
-
setIdleConnectionTimeoutSeconds
public void setIdleConnectionTimeoutSeconds(int idleConnectionTimeout) Inform the context that the connection should be disconnected on session timeout- Parameters:
idleConnectionTimeout-
-
supportedPublicKeys
-
getKeepAliveInterval
public int getKeepAliveInterval()Get the current keep-alive interval (in seconds). The server sends an SSH_MSG_IGNORE every n seconds after no activity on a connection.- Returns:
-
setKeepAliveInterval
public void setKeepAliveInterval(int keepAliveInterval) Set the keep-alive interval (in seconds). The server sends an SSH_MSG_IGNORE message every n seconds after no activity on a connection.- Parameters:
keepAliveInterval-
-
getKeepAliveDataMaxLength
public int getKeepAliveDataMaxLength()Get the maximum data length for the keep-alive packet.- Returns:
-
setKeepAliveDataMaxLength
public void setKeepAliveDataMaxLength(int keepAliveDataMaxLength) Set the maximum data length for the keep-alive packet. Default is 128, the actual number of bytes is random up to this maximum.- Parameters:
keepAliveDataMaxLength-
-
setLocale
-
getLocale
-
enableFIPSMode
- Throws:
SshException
-
getExecutorService
- Specified by:
getExecutorServicein interfaceContext- Specified by:
getExecutorServicein interfaceExecutorServiceProvider
-
shutdown
public void shutdown()- Specified by:
shutdownin classProtocolContext
-
getByteBufferPool
public com.sshtools.common.util.ByteBufferPool getByteBufferPool()- Specified by:
getByteBufferPoolin interfaceContext
-
getDaemonContext
-
getIdleAuthenticationTimeoutSeconds
public int getIdleAuthenticationTimeoutSeconds() -
setIdleAuthenticationTimeoutSeconds
public void setIdleAuthenticationTimeoutSeconds(int idleAuthenticationTimeoutSeconds) -
getMinDHGroupExchangeKeySize
public int getMinDHGroupExchangeKeySize() -
setMinDHGroupExchangeKeySize
public void setMinDHGroupExchangeKeySize(int minDHGroupExchangeKeySize) -
getForwardingManager
-
listPublicKeys
-
isSendIgnorePacketOnIdle
public boolean isSendIgnorePacketOnIdle() -
setSendIgnorePacketOnIdle
public void setSendIgnorePacketOnIdle(boolean sendIgnorePacketOnIdle) -
isHttpRedirect
public boolean isHttpRedirect() -
setHttpRedirect
public void setHttpRedirect(boolean httpRedirect) -
getHttpRedirectUrl
-
setHttpRedirectUrl
-
getPreferredDHGroupExchangeKeySize
public int getPreferredDHGroupExchangeKeySize() -
setPreferredDHGroupExchangeKeySize
public void setPreferredDHGroupExchangeKeySize(int preferredDHGroupExchangeKeySize) -
getMaxDHGroupExchangeKeySize
public int getMaxDHGroupExchangeKeySize() -
setMaxDHGroupExchangeKeySize
public void setMaxDHGroupExchangeKeySize(int maxDHGroupExchangeKeySize) -
getForwardingPolicy
-
isSHA1SignaturesSupported
public boolean isSHA1SignaturesSupported() -
setSHA1SignaturesSupported
public void setSHA1SignaturesSupported(boolean sha1SignaturesSupported)
-