当前位置: 首页>>代码示例>>Java>>正文


Java ServerHostKeyVerifier类代码示例

本文整理汇总了Java中com.trilead.ssh2.ServerHostKeyVerifier的典型用法代码示例。如果您正苦于以下问题:Java ServerHostKeyVerifier类的具体用法?Java ServerHostKeyVerifier怎么用?Java ServerHostKeyVerifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServerHostKeyVerifier类属于com.trilead.ssh2包,在下文中一共展示了ServerHostKeyVerifier类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: KexManager

import com.trilead.ssh2.ServerHostKeyVerifier; //导入依赖的package包/类
public KexManager(TransportManager tm, ClientServerHello csh, CryptoWishList initialCwl, String hostname, int port,
		ServerHostKeyVerifier keyVerifier, SecureRandom rnd)
{
	this.tm = tm;
	this.csh = csh;
	this.nextKEXcryptoWishList = initialCwl;
	this.nextKEXdhgexParameters = new DHGexParameters();
	this.hostname = hostname;
	this.port = port;
	this.verifier = keyVerifier;
	this.rnd = rnd;
}
 
开发者ID:dragonlinux,项目名称:connectbot,代码行数:13,代码来源:KexManager.java

示例2: setupAuthenticateSshSessionWithPublicKeyTest

import com.trilead.ssh2.ServerHostKeyVerifier; //导入依赖的package包/类
private Connection setupAuthenticateSshSessionWithPublicKeyTest(Session sess, boolean returning) throws IOException {
    String nullString = null;
    Connection sshConnection = Mockito.mock(Connection.class);
    Mockito.doReturn(null).when(sshConnection).connect(Mockito.any(ServerHostKeyVerifier.class), Mockito.eq(CONNECT_TIMEOUT), Mockito.eq(CONNECT_TIMEOUT));
    Mockito.doReturn(returning).when(sshConnection).authenticateWithPublicKey(Mockito.eq("root"), Mockito.any(File.class), Mockito.eq(nullString));
    Mockito.doReturn(sess).when(sshConnection).openSession();
    return sshConnection;
}
 
开发者ID:Autonomiccs,项目名称:autonomiccs-platform,代码行数:9,代码来源:SshUtilsTest.java

示例3: KexManager

import com.trilead.ssh2.ServerHostKeyVerifier; //导入依赖的package包/类
public KexManager(TransportManager tm, ClientServerHello csh,
		CryptoWishList initialCwl, String hostname, int port,
		ServerHostKeyVerifier keyVerifier, SecureRandom rnd) {
	this.tm = tm;
	this.csh = csh;
	this.nextKEXcryptoWishList = initialCwl;
	this.nextKEXdhgexParameters = new DHGexParameters();
	this.hostname = hostname;
	this.port = port;
	this.verifier = keyVerifier;
	this.rnd = rnd;
}
 
开发者ID:jianlinwei,项目名称:sshtunnel,代码行数:13,代码来源:KexManager.java

示例4: testOpenConnectionTimeOut

import com.trilead.ssh2.ServerHostKeyVerifier; //导入依赖的package包/类
@Test
public void testOpenConnectionTimeOut() throws Exception {
  when( connection.authenticateWithPassword( username, password ) ).thenReturn( true );
  assertNotNull( SSHData.OpenConnection( server, port, username, password, false, null,
    null, 100, null, null, proxyPort, proxyUsername, proxyPassword ) );
  verify( connection ).connect( isNull( ServerHostKeyVerifier.class ), eq( 0 ), eq( 100 * 1000 ) );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:SSHDataTest.java

示例5: initialize

import com.trilead.ssh2.ServerHostKeyVerifier; //导入依赖的package包/类
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex,
		int connectTimeout, SecureRandom rnd, ProxyData proxyData) throws IOException
{
	/* First, establish the TCP connection to the SSH-2 server */

	establishConnection(proxyData, connectTimeout);

	/* Parse the server line and say hello - important: this information is later needed for the
	 * key exchange (to stop man-in-the-middle attacks) - that is why we wrap it into an object
	 * for later use.
	 */

	ClientServerHello csh = new ClientServerHello(sock.getInputStream(), sock.getOutputStream());

	tc = new TransportConnection(sock.getInputStream(), sock.getOutputStream(), rnd);

	km = new KexManager(this, csh, cwl, hostname, port, verifier, rnd);
	km.initiateKEX(cwl, dhgex);

	receiveThread = new Thread(new Runnable()
	{
		public void run()
		{
			try
			{
				receiveLoop();
			}
			catch (IOException e)
			{
				close(e, false);

				if (log.isEnabled())
					log.log(10, "Receive thread: error in receiveLoop: " + e.getMessage());
			}

			if (log.isEnabled())
				log.log(50, "Receive thread: back from receiveLoop");

			/* Tell all handlers that it is time to say goodbye */

			if (km != null)
			{
				try
				{
					km.handleMessage(null, 0);
				}
				catch (IOException e)
				{
				}
			}

			for (int i = 0; i < messageHandlers.size(); i++)
			{
				HandlerEntry he = messageHandlers.elementAt(i);
				try
				{
					he.mh.handleMessage(null, 0);
				}
				catch (Exception ignore)
				{
				}
			}
		}
	});

	receiveThread.setDaemon(true);
	receiveThread.start();
}
 
开发者ID:dragonlinux,项目名称:connectbot,代码行数:69,代码来源:TransportManager.java

示例6: initialize

import com.trilead.ssh2.ServerHostKeyVerifier; //导入依赖的package包/类
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier,
		DHGexParameters dhgex, int connectTimeout, SecureRandom rnd,
		ProxyData proxyData) throws IOException {
	/* First, establish the TCP connection to the SSH-2 server */

	establishConnection(proxyData, connectTimeout);

	/*
	 * Parse the server line and say hello - important: this information is
	 * later needed for the key exchange (to stop man-in-the-middle attacks)
	 * - that is why we wrap it into an object for later use.
	 */

	ClientServerHello csh = new ClientServerHello(sock.getInputStream(),
			sock.getOutputStream());

	tc = new TransportConnection(sock.getInputStream(),
			sock.getOutputStream(), rnd);

	km = new KexManager(this, csh, cwl, hostname, port, verifier, rnd);
	km.initiateKEX(cwl, dhgex);

	receiveThread = new Thread(new Runnable() {
		@Override
		public void run() {
			try {
				receiveLoop();
			} catch (IOException e) {
				close(e, false);

				if (log.isEnabled())
					log.log(10, "Receive thread: error in receiveLoop: "
							+ e.getMessage());
			}

			if (log.isEnabled())
				log.log(50, "Receive thread: back from receiveLoop");

			/* Tell all handlers that it is time to say goodbye */

			if (km != null) {
				try {
					km.handleMessage(null, 0);
				} catch (IOException e) {
				}
			}

			for (int i = 0; i < messageHandlers.size(); i++) {
				HandlerEntry he = messageHandlers.elementAt(i);
				try {
					he.mh.handleMessage(null, 0);
				} catch (Exception ignore) {
				}
			}
		}
	});

	receiveThread.setDaemon(true);
	receiveThread.start();
}
 
开发者ID:jianlinwei,项目名称:sshtunnel,代码行数:61,代码来源:TransportManager.java


注:本文中的com.trilead.ssh2.ServerHostKeyVerifier类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。