|
||||||||||
| 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_AES128_CBC
The AES CBC Cipher |
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. |
java.lang.String |
getCiphersCS()
Get the ciphers for the Client->Server stream. |
java.lang.String |
getCiphersSC()
Get the ciphers for the Server->Client stream. |
MaverickCallbackHandler |
getGssCallback()
|
HostKeyVerification |
getHostKeyVerification()
Get the host key verification implementation |
java.lang.String |
getKeyExchanges()
Get the ciphers for the Server->Client stream. |
java.lang.String |
getMacsCS()
Get the ciphers for the Client->Server stream. |
java.lang.String |
getMacsSC()
Get the ciphers for the Server->Client stream. |
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 |
getPublicKeys()
Get the ciphers for the Server->Client stream. |
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. |
boolean |
isKeyReExchangeDisabled()
|
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 |
setCipherPreferredPositionCS(java.lang.String name,
int position)
|
void |
setCipherPreferredPositionSC(java.lang.String name,
int position)
|
void |
setGssCallback(MaverickCallbackHandler gsscall)
|
void |
setHostKeyVerification(HostKeyVerification verify)
Set the host key verification implementation |
void |
setKeyExchangePreferredPosition(java.lang.String name,
int position)
|
void |
setKeyReExchangeDisabled(boolean keyReExchangeDisabled)
|
void |
setMacPreferredPositionCS(java.lang.String name,
int position)
|
void |
setMacPreferredPositionSC(java.lang.String name,
int position)
|
void |
setMaximumPacketLength(int maxPacketLength)
Set the maximum packet size supported by the transport layer. |
void |
setPartialMessageTimeout(int partialMessageTimeout)
|
void |
setPreferredCipherCS(int[] order)
Set the preferred SC cipher order |
void |
setPreferredCipherCS(java.lang.String name)
Set the preferred cipher for the Client->Server stream. |
void |
setPreferredCipherSC(int[] order)
Set the preferred SC cipher order |
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(int[] order)
Set the preferred CS Mac order |
void |
setPreferredMacCS(java.lang.String name)
Set the preferred mac for the Client->Server stream. |
void |
setPreferredMacSC(int[] order)
Set the preferred SC Mac order |
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 |
setPublicKeyPreferredPosition(java.lang.String name,
int position)
|
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. |
ComponentFactory |
supportedCiphersCS()
|
ComponentFactory |
supportedCiphersSC()
Returns this context's supported cipher algorithms. |
ComponentFactory |
supportedCompressionsCS()
Get this context's supported CS compression algorithms. |
ComponentFactory |
supportedCompressionsSC()
Get this context's supported SC compression algorithms. |
ComponentFactory |
supportedKeyExchanges()
Get this context's supported key exchange methods. |
ComponentFactory |
supportedMacsCS()
Get this context's supported message authentication algorithms CS. |
ComponentFactory |
supportedMacsSC()
Get this context's supported message authentication algorithms SC. |
ComponentFactory |
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 CIPHER_AES128_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 setGssCallback(MaverickCallbackHandler gsscall)
public MaverickCallbackHandler getGssCallback()
public void setMaximumPacketLength(int maxPacketLength)
maxPacketLength - intpublic void setChannelLimit(int maxChannels)
SshContext
setChannelLimit in interface SshContextmaxChannels - public int getChannelLimit()
SshContext
getChannelLimit in interface SshContextpublic void setX11Display(java.lang.String xDisplay)
SshContext
setX11Display in interface SshContextxDisplay - the display in the form localhost:1public java.lang.String getX11Display()
SshContext
getX11Display in interface SshContext
public byte[] getX11AuthenticationCookie()
throws SshException
SshContext
getX11AuthenticationCookie in interface SshContextSshExceptionpublic void setX11RealCookie(byte[] x11RealCookie)
SshContext
setX11RealCookie in interface SshContextx11RealCookie -
public byte[] getX11RealCookie()
throws SshException
SshContext
getX11RealCookie in interface SshContextSshExceptionpublic void setX11RequestListener(ForwardingRequestListener x11Listener)
SshContext
setX11RequestListener in interface SshContextx11Listener - public ForwardingRequestListener getX11RequestListener()
SshContext
getX11RequestListener in interface SshContextpublic BannerDisplay getBannerDisplay()
public void setBannerDisplay(BannerDisplay bannerdisplay)
bannerdisplay - the banner display, may be nullpublic ComponentFactory supportedCiphersSC()
public ComponentFactory supportedCiphersCS()
public java.lang.String getPreferredCipherCS()
public void setPreferredCipherCS(java.lang.String name)
throws SshException
name -
SshExceptionpublic java.lang.String getPreferredCipherSC()
public java.lang.String getCiphersCS()
public java.lang.String getCiphersSC()
public java.lang.String getMacsCS()
public java.lang.String getMacsSC()
public java.lang.String getPublicKeys()
public java.lang.String getKeyExchanges()
public void setPreferredCipherSC(int[] order)
throws SshException
SshException
public void setPreferredCipherCS(int[] order)
throws SshException
SshException
public void setCipherPreferredPositionCS(java.lang.String name,
int position)
throws SshException
SshException
public void setCipherPreferredPositionSC(java.lang.String name,
int position)
throws SshException
SshException
public void setMacPreferredPositionSC(java.lang.String name,
int position)
throws SshException
SshException
public void setMacPreferredPositionCS(java.lang.String name,
int position)
throws SshException
SshException
public void setPreferredMacSC(int[] order)
throws SshException
SshException
public void setPreferredMacCS(int[] order)
throws SshException
SshException
public void setPreferredCipherSC(java.lang.String name)
throws SshException
name -
SshExceptionpublic ComponentFactory supportedMacsSC()
public ComponentFactory supportedMacsCS()
public java.lang.String getPreferredMacCS()
public void setPreferredMacCS(java.lang.String name)
throws SshException
name -
SshExceptionpublic java.lang.String getPreferredMacSC()
public void setPreferredMacSC(java.lang.String name)
throws SshException
name -
SshExceptionpublic ComponentFactory supportedCompressionsSC()
public ComponentFactory supportedCompressionsCS()
public java.lang.String getPreferredCompressionCS()
public void setPreferredCompressionCS(java.lang.String name)
throws SshException
name -
SshExceptionpublic java.lang.String getPreferredCompressionSC()
public void setPreferredCompressionSC(java.lang.String name)
throws SshException
name -
SshExceptionpublic ComponentFactory supportedKeyExchanges()
public java.lang.String getPreferredKeyExchange()
public void setPreferredKeyExchange(java.lang.String name)
throws SshException
name -
SshExceptionpublic ComponentFactory supportedPublicKeys()
public java.lang.String getPreferredPublicKey()
public void setPreferredPublicKey(java.lang.String name)
throws SshException
name -
SshExceptionpublic void setHostKeyVerification(HostKeyVerification verify)
setHostKeyVerification in interface SshContextverify - public HostKeyVerification getHostKeyVerification()
getHostKeyVerification in interface SshContextpublic void setSFTPProvider(java.lang.String sftpProvider)
SshContext
setSFTPProvider in interface SshContextsftpProvider - public java.lang.String getSFTPProvider()
SshContext
getSFTPProvider in interface SshContextpublic void setPartialMessageTimeout(int partialMessageTimeout)
public int getPartialMessageTimeout()
public boolean isKeyReExchangeDisabled()
public void setKeyReExchangeDisabled(boolean keyReExchangeDisabled)
public void setPublicKeyPreferredPosition(java.lang.String name,
int position)
throws SshException
SshException
public void setKeyExchangePreferredPosition(java.lang.String name,
int position)
throws SshException
SshException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||