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


Java ServerHostKeyVerifier类代码示例

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


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

示例1: KexManager

import ch.ethz.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:fast-data-transfer,项目名称:fdt,代码行数:12,代码来源:KexManager.java

示例2: testInit_CantConnect

import ch.ethz.ssh2.ServerHostKeyVerifier; //导入依赖的package包/类
/**
 * Internal IOExceptions convert to RuntimeException.
 */
@Test(expected = RuntimeException.class)
public void testInit_CantConnect() throws IOException
{
  when(mockConnection.connect(any(ServerHostKeyVerifier.class), anyInt(), anyInt())).thenThrow(new IOException());
  initWithFakeTarget();
}
 
开发者ID:Nike-Inc,项目名称:bluegreen-manager,代码行数:10,代码来源:SshClientTest.java

示例3: KexManager

import ch.ethz.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:mattb243,项目名称:AmazonEC2Matlab,代码行数:13,代码来源:KexManager.java

示例4: initialize

import ch.ethz.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 = (HandlerEntry) messageHandlers.elementAt(i);
				try
				{
					he.mh.handleMessage(null, 0);
				}
				catch (Exception ignore)
				{
				}
			}
		}
	});

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


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