|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maverick.ssh2.Ssh2Context
This class implements SshContextto provide SSH2 connection configuration through the SshConnector class.
To configure an authentication banner for SSH2 connections see BannerDisplay.
The preferred message authentication algorithm for each data stream can be set using:
Once further cipher, public key and compression algorithms have been implemented the same process will apply.SshConnector con = SshConnector.getInstance(); Ssh2Context context = (Ssh2Context) con.getContext(SshConnector.SSH2); context.setPreferredMacCS(Ssh2Context.HMAC_MD5); // Client->Server data stream context.setPreferredMacSC(Ssh2Context.HMAC_MD5); // Server->Client data stream
Field Summary | |
static java.lang.String |
CIPHER_BLOWFISH_CBC
The Blowfish CBC cipher |
static java.lang.String |
CIPHER_TRIPLEDES_CBC
The 3DES CBC cipher |
static java.lang.String |
COMPRESSION_NONE
Compression off |
static java.lang.String |
COMPRESSION_ZLIB
Optional zlib compression (requires sshtools-zlib.jar in classpath) |
static java.lang.String |
HMAC_MD5
MD5 message authentication |
static java.lang.String |
HMAC_MD5_96
MD5 96 bit message authentication |
static java.lang.String |
HMAC_SHA1
SHA1 message authentication |
static java.lang.String |
HMAC_SHA1_96
SHA1 96 bit message authentication |
static java.lang.String |
KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
Optional key exchange mechanism in which the server maintains a list of acceptable generators and primes |
static java.lang.String |
KEX_DIFFIE_HELLMAN_GROUP1_SHA1
The required key exchange method |
static java.lang.String |
KEX_DIFFIE_HELLMAN_GROUP14_SHA1
|
static java.lang.String |
PUBLIC_KEY_SSHDSS
SSH2 DSA Public Key |
static java.lang.String |
PUBLIC_KEY_SSHRSA
SSH2 RSA Public Key |
Constructor Summary | |
Ssh2Context()
Contructs a default context |
Method Summary | |
BannerDisplay |
getBannerDisplay()
Get the contexts banner display |
int |
getChannelLimit()
Get the maximum number of channels that are allowed open at any one time. |
HostKeyVerification |
getHostKeyVerification()
Get the host key verification implementation |
int |
getMaximumPacketLength()
Get the maximim packet size supported by the transport layer. |
int |
getPartialMessageTimeout()
|
java.lang.String |
getPreferredCipherCS()
Get the currently preferred cipher for the Client->Server stream. |
java.lang.String |
getPreferredCipherSC()
Get the currently preferred cipher for the Server->Client stream. |
java.lang.String |
getPreferredCompressionCS()
Get the currently preferred compression for the Client->Server stream. |
java.lang.String |
getPreferredCompressionSC()
Get the currently preferred compression for the Server->Client stream. |
java.lang.String |
getPreferredKeyExchange()
Get the currently preferred key exchange method. |
java.lang.String |
getPreferredMacCS()
Get the currently preferred mac for the Client->Server stream. |
java.lang.String |
getPreferredMacSC()
Get the currently supported mac for the Server-Client stream. |
java.lang.String |
getPreferredPublicKey()
Get the currently preferred public key algorithm. |
java.lang.String |
getSFTPProvider()
Get the path to the SFTP provider. |
byte[] |
getX11AuthenticationCookie()
Get a fake random cookie for X11 authentication |
java.lang.String |
getX11Display()
Get the currently configured XDisplay setting which will be null if no display is currently set. |
byte[] |
getX11RealCookie()
Get the real X11 authentication cookie, if not cookie has been set the fake cookie will be returned. |
ForwardingRequestListener |
getX11RequestListener()
Get the X11 forwarding request listener. |
void |
setBannerDisplay(BannerDisplay bannerdisplay)
Set a banner display for callback of authentication banners |
void |
setChannelLimit(int maxChannels)
Set the maximum number of channels that are allowed open at any one time. |
void |
setHostKeyVerification(HostKeyVerification verify)
Set the host key verification implementation |
void |
setMaximumPacketLength(int maxPacketLength)
Set the maximum packet size supported by the transport layer. |
void |
setPartialMessageTimeout(int partialMessageTimeout)
|
void |
setPreferredCipherCS(java.lang.String name)
Set the preferred cipher for the Client->Server stream. |
void |
setPreferredCipherSC(java.lang.String name)
Set the preferred cipher for the Server->Client stream. |
void |
setPreferredCompressionCS(java.lang.String name)
Set the preferred compression for the Client->Server stream. |
void |
setPreferredCompressionSC(java.lang.String name)
Set the preferred compression for the Server->Client stream. |
void |
setPreferredKeyExchange(java.lang.String name)
Set the preferred key exchange method. |
void |
setPreferredMacCS(java.lang.String name)
Set the preferred mac for the Client->Server stream. |
void |
setPreferredMacSC(java.lang.String name)
Set the preferred mac for the Server->Client stream. |
void |
setPreferredPublicKey(java.lang.String name)
Set the preferred public key algorithm. |
void |
setSFTPProvider(java.lang.String sftpProvider)
Set the path to the SFTP provider. |
void |
setX11Display(java.lang.String xDisplay)
Set the DISPLAY variable for the SSH connection. |
void |
setX11RealCookie(byte[] x11RealCookie)
Sets the real X11 authentication cookie which can be obtained from the users $HOME/.Xauthority file. |
void |
setX11RequestListener(ForwardingRequestListener x11Listener)
Set the listener to which X11 forwarding requests will be processed. |
AbstractComponentFactory |
supportedCiphers()
Returns this context's supported cipher algorithms. |
AbstractComponentFactory |
supportedCompressions()
Get this context's supported compression algorithms. |
AbstractComponentFactory |
supportedKeyExchanges()
Get this context's supported key exchange methods. |
AbstractComponentFactory |
supportedMacs()
Get this context's supported message authentication algorithms. |
AbstractComponentFactory |
supportedPublicKeys()
Get this context's supported public keys. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CIPHER_TRIPLEDES_CBC
public static final java.lang.String CIPHER_BLOWFISH_CBC
public static final java.lang.String HMAC_SHA1
public static final java.lang.String HMAC_SHA1_96
public static final java.lang.String HMAC_MD5
public static final java.lang.String HMAC_MD5_96
public static final java.lang.String COMPRESSION_NONE
public static final java.lang.String COMPRESSION_ZLIB
public static final java.lang.String KEX_DIFFIE_HELLMAN_GROUP1_SHA1
public static final java.lang.String KEX_DIFFIE_HELLMAN_GROUP14_SHA1
public static final java.lang.String KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
public static final java.lang.String PUBLIC_KEY_SSHDSS
public static final java.lang.String PUBLIC_KEY_SSHRSA
Constructor Detail |
public Ssh2Context() throws SshException
SshException
Method Detail |
public int getMaximumPacketLength()
public void setMaximumPacketLength(int maxPacketLength)
maxPacketLength
- intpublic void setChannelLimit(int maxChannels)
SshContext
setChannelLimit
in interface SshContext
maxChannels
- public int getChannelLimit()
SshContext
getChannelLimit
in interface SshContext
public void setX11Display(java.lang.String xDisplay)
SshContext
setX11Display
in interface SshContext
xDisplay
- the display in the form localhost:1public java.lang.String getX11Display()
SshContext
getX11Display
in interface SshContext
public byte[] getX11AuthenticationCookie()
SshContext
getX11AuthenticationCookie
in interface SshContext
public void setX11RealCookie(byte[] x11RealCookie)
SshContext
setX11RealCookie
in interface SshContext
x11RealCookie
- public byte[] getX11RealCookie()
SshContext
getX11RealCookie
in interface SshContext
public void setX11RequestListener(ForwardingRequestListener x11Listener)
SshContext
setX11RequestListener
in interface SshContext
x11Listener
- public ForwardingRequestListener getX11RequestListener()
SshContext
getX11RequestListener
in interface SshContext
public BannerDisplay getBannerDisplay()
public void setBannerDisplay(BannerDisplay bannerdisplay)
bannerdisplay
- the banner display, may be nullpublic AbstractComponentFactory supportedCiphers()
public java.lang.String getPreferredCipherCS()
public void setPreferredCipherCS(java.lang.String name) throws SshException
name
-
SshException
public java.lang.String getPreferredCipherSC()
public void setPreferredCipherSC(java.lang.String name) throws SshException
name
-
SshException
public AbstractComponentFactory supportedMacs()
public java.lang.String getPreferredMacCS()
public void setPreferredMacCS(java.lang.String name) throws SshException
name
-
SshException
public java.lang.String getPreferredMacSC()
public void setPreferredMacSC(java.lang.String name) throws SshException
name
-
SshException
public AbstractComponentFactory supportedCompressions()
public java.lang.String getPreferredCompressionCS()
public void setPreferredCompressionCS(java.lang.String name) throws SshException
name
-
SshException
public java.lang.String getPreferredCompressionSC()
public void setPreferredCompressionSC(java.lang.String name) throws SshException
name
-
SshException
public AbstractComponentFactory supportedKeyExchanges()
public java.lang.String getPreferredKeyExchange()
public void setPreferredKeyExchange(java.lang.String name) throws SshException
name
-
SshException
public AbstractComponentFactory supportedPublicKeys()
public java.lang.String getPreferredPublicKey()
public void setPreferredPublicKey(java.lang.String name) throws SshException
name
-
SshException
public void setHostKeyVerification(HostKeyVerification verify)
setHostKeyVerification
in interface SshContext
verify
- public HostKeyVerification getHostKeyVerification()
getHostKeyVerification
in interface SshContext
public void setSFTPProvider(java.lang.String sftpProvider)
SshContext
setSFTPProvider
in interface SshContext
sftpProvider
- public java.lang.String getSFTPProvider()
SshContext
getSFTPProvider
in interface SshContext
public void setPartialMessageTimeout(int partialMessageTimeout)
public int getPartialMessageTimeout()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |