• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HiddenServiceCircuit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: processRendezvous2

import com.subgraph.orchid.HiddenServiceCircuit; //导入依赖的package包/类
HiddenServiceCircuit processRendezvous2(TorTapKeyAgreement kex) {
	final RelayCell cell = circuit.receiveRelayCell();
	if(cell == null) {
		logger.info("Timeout waiting for RENDEZVOUS2");
		return null;
	} else if (cell.getRelayCommand() != RelayCell.RELAY_COMMAND_RENDEZVOUS2) {
		logger.info("Unexpected Relay cell type received while waiting for RENDEZVOUS2: "+ cell.getRelayCommand());
		return null;
	}
	final BigInteger peerPublic = readPeerPublic(cell);
	final HexDigest handshakeDigest = readHandshakeDigest(cell);
	if(peerPublic == null || handshakeDigest == null) {
		return null;
	}
	final byte[] verifyHash = new byte[TorMessageDigest.TOR_DIGEST_SIZE];
	final byte[] keyMaterial = new byte[CircuitNodeCryptoState.KEY_MATERIAL_SIZE];
	if(!kex.deriveKeysFromDHPublicAndHash(peerPublic, handshakeDigest.getRawBytes(), keyMaterial, verifyHash)) {
		logger.info("Error deriving session keys while extending to hidden service");
		return null;
	}
	return circuit.connectHiddenService(CircuitNodeImpl.createAnonymous(circuit.getFinalCircuitNode(), keyMaterial, verifyHash));
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:23,代码来源:RendezvousProcessor.java


示例2: connectHiddenService

import com.subgraph.orchid.HiddenServiceCircuit; //导入依赖的package包/类
public HiddenServiceCircuit connectHiddenService(CircuitNode node) {
	if(type != InternalType.UNUSED) {
		throw new IllegalStateException("Cannot connect hidden service from internal circuit type "+ type);
	}
	appendNode(node);
	type = InternalType.HS_CIRCUIT;
	return this;
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:9,代码来源:InternalCircuitImpl.java


示例3: getStreamTo

import com.subgraph.orchid.HiddenServiceCircuit; //导入依赖的package包/类
public Stream getStreamTo(String onion, int port) throws OpenFailedException, InterruptedException, TimeoutException {
	final HiddenService hs = getHiddenServiceForOnion(onion);
	final HiddenServiceCircuit circuit = getCircuitTo(hs);
	
	try {
		return circuit.openStream(port, HS_STREAM_TIMEOUT);
	} catch (StreamConnectFailedException e) {
		throw new OpenFailedException("Failed to open stream to hidden service "+ hs.getOnionAddressForLogging() + " reason "+ e.getReason());
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:HiddenServiceManager.java


示例4: getCircuitTo

import com.subgraph.orchid.HiddenServiceCircuit; //导入依赖的package包/类
private synchronized HiddenServiceCircuit getCircuitTo(HiddenService hs) throws OpenFailedException {
	if(hs.getCircuit() == null) {
		final HiddenServiceCircuit c = openCircuitTo(hs);
		if(c == null) {
			throw new OpenFailedException("Failed to open circuit to "+ hs.getOnionAddressForLogging());
		}
		hs.setCircuit(c);
	}
	return hs.getCircuit();
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:HiddenServiceManager.java


示例5: openCircuitTo

import com.subgraph.orchid.HiddenServiceCircuit; //导入依赖的package包/类
private HiddenServiceCircuit openCircuitTo(HiddenService hs) throws OpenFailedException {
	HSDescriptor descriptor = getDescriptorFor(hs);
	
	for(int i = 0; i < RENDEZVOUS_RETRY_COUNT; i++) {
		final HiddenServiceCircuit c = openRendezvousCircuit(hs, descriptor);
		if(c != null) {
			return c;
		}
	}
	throw new OpenFailedException("Failed to open circuit to "+ hs.getOnionAddressForLogging());
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:12,代码来源:HiddenServiceManager.java


示例6: openRendezvousCircuit

import com.subgraph.orchid.HiddenServiceCircuit; //导入依赖的package包/类
private HiddenServiceCircuit openRendezvousCircuit(HiddenService hs, HSDescriptor descriptor) {
	final RendezvousCircuitBuilder builder = new RendezvousCircuitBuilder(directory, circuitManager, hs, descriptor);
	try {
		return builder.call();
	} catch (Exception e) {
		return null;
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:9,代码来源:HiddenServiceManager.java


示例7: call

import com.subgraph.orchid.HiddenServiceCircuit; //导入依赖的package包/类
public HiddenServiceCircuit call() throws Exception {
	
	logger.fine("Opening rendezvous circuit for "+ logServiceName());
	
	final InternalCircuit rendezvous = circuitManager.getCleanInternalCircuit();
	logger.fine("Establishing rendezvous for "+ logServiceName());
	RendezvousProcessor rp = new RendezvousProcessor(rendezvous);
	if(!rp.establishRendezvous()) {
		rendezvous.markForClose();
		return null;
	}
	logger.fine("Opening introduction circuit for "+ logServiceName());
	final IntroductionProcessor introductionProcessor = openIntroduction();
	if(introductionProcessor == null) {
		logger.info("Failed to open connection to any introduction point");
		rendezvous.markForClose();
		return null;
	}
	logger.fine("Sending introduce cell for "+ logServiceName());
	final TorTapKeyAgreement kex = new TorTapKeyAgreement();
	final boolean icResult = introductionProcessor.sendIntroduce(introductionProcessor.getServiceKey(), kex.getPublicKeyBytes(), rp.getCookie(), rp.getRendezvousRouter());
	introductionProcessor.markCircuitForClose();
	if(!icResult) {
		rendezvous.markForClose();
		return null;
	}
	logger.fine("Processing RV2 for "+ logServiceName());
	HiddenServiceCircuit hsc = rp.processRendezvous2(kex);
	if(hsc == null) {
		rendezvous.markForClose();
	}

	logger.fine("Rendezvous circuit opened for "+ logServiceName());
	
	return hsc;
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:37,代码来源:RendezvousCircuitBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Stub类代码示例发布时间:2022-05-23
下一篇:
Java CollectionTerminatedException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap