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

Java Tor类代码示例

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

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



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

示例1: connectSocket

import com.subgraph.orchid.Tor; //导入依赖的package包/类
private void connectSocket() throws IOException {
	if(initializationTracker != null) {
		if(isDirectoryConnection) {
			initializationTracker.notifyEvent(Tor.BOOTSTRAP_STATUS_CONN_DIR);
		} else {
			initializationTracker.notifyEvent(Tor.BOOTSTRAP_STATUS_CONN_OR);
		}
	}

	socket.connect(routerToSocketAddress(router), DEFAULT_CONNECT_TIMEOUT);
	
	if(initializationTracker != null) {
		if(isDirectoryConnection) {
			initializationTracker.notifyEvent(Tor.BOOTSTRAP_STATUS_HANDSHAKE_DIR);
		} else {
			initializationTracker.notifyEvent(Tor.BOOTSTRAP_STATUS_HANDSHAKE_OR);
		}
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:20,代码来源:ConnectionImpl.java


示例2: toBase64

import com.subgraph.orchid.Tor; //导入依赖的package包/类
public String toBase64(boolean stripTrailingEquals) {
	final String b64 = new String(Base64.encode(digestBytes), Tor.getDefaultCharset());
	if(stripTrailingEquals) {
		return stripTrailingEquals(b64);
	} else {
		return b64;
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:9,代码来源:HexDigest.java


示例3: getRawDocumentBytes

import com.subgraph.orchid.Tor; //导入依赖的package包/类
public ByteBuffer getRawDocumentBytes() {
	if(getRawDocumentData() == null) {
		return ByteBuffer.allocate(0);
	} else {
		return ByteBuffer.wrap(getRawDocumentData().getBytes(Tor.getDefaultCharset()));
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:KeyCertificateImpl.java


示例4: createGuardEntryFor

import com.subgraph.orchid.Tor; //导入依赖的package包/类
public GuardEntry createGuardEntryFor(Router router) {
	final GuardEntryImpl entry = new GuardEntryImpl(directory, this, router.getNickname(), router.getIdentityHash().toString());
	final String version = Tor.getImplementation() + "-" + Tor.getVersion();
	entry.setVersion(version);
	
	/* 
	 * "Choose expiry time smudged over the last month."
	 * 
	 * See add_an_entry_guard() in entrynodes.c 
	 */
	final long createTime = (new Date()).getTime() - (random.nextInt(3600 * 24 * 30) * 1000L);
	entry.setCreatedTime(new Date(createTime));
	return entry;
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:15,代码来源:StateFile.java


示例5: getFileContents

import com.subgraph.orchid.Tor; //导入依赖的package包/类
ByteBuffer getFileContents() {
	final StringBuilder sb = new StringBuilder();
	synchronized (guardEntries) {
		for(GuardEntryImpl entry: guardEntries) {
			sb.append(entry.writeToString());
		}
	}
	return ByteBuffer.wrap(sb.toString().getBytes(Tor.getDefaultCharset()));
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:10,代码来源:StateFile.java


示例6: purposeToEventCode

import com.subgraph.orchid.Tor; //导入依赖的package包/类
private int purposeToEventCode(int purpose, boolean getLoadingEvent) {
	switch(purpose) {
	case CircuitManager.DIRECTORY_PURPOSE_CONSENSUS:
		return getLoadingEvent ? Tor.BOOTSTRAP_STATUS_LOADING_STATUS : Tor.BOOTSTRAP_STATUS_REQUESTING_STATUS;
	case CircuitManager.DIRECTORY_PURPOSE_CERTIFICATES:
		 return getLoadingEvent ? Tor.BOOTSTRAP_STATUS_LOADING_KEYS : Tor.BOOTSTRAP_STATUS_REQUESTING_KEYS;
	case CircuitManager.DIRECTORY_PURPOSE_DESCRIPTORS:
		return getLoadingEvent ? Tor.BOOTSTRAP_STATUS_LOADING_DESCRIPTORS : Tor.BOOTSTRAP_STATUS_REQUESTING_DESCRIPTORS;
	default:
		return 0;
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:13,代码来源:DirectoryDocumentRequestor.java


示例7: initialize

import com.subgraph.orchid.Tor; //导入依赖的package包/类
void initialize() {
	final StringBuilder builder = new StringBuilder();
	for(String entry: dirServers) {
		builder.append(entry);
		builder.append('\n');
	}
	final ByteBuffer buffer = ByteBuffer.wrap(builder.toString().getBytes(Tor.getDefaultCharset()));
	final DocumentFieldParser parser = new DocumentFieldParserImpl(buffer);
	
	parser.setHandler(new DocumentParsingHandler() {
		public void endOfDocument() {}
		public void parseKeywordLine() { processKeywordLine(parser);}
	});
	parser.processDocument();
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:16,代码来源:TrustedAuthorities.java


示例8: notifyInitialization

import com.subgraph.orchid.Tor; //导入依赖的package包/类
private void notifyInitialization() {
	if(initializationTracker != null) {
		final int event = creationRequest.isDirectoryCircuit() ? 
				Tor.BOOTSTRAP_STATUS_ONEHOP_CREATE : Tor.BOOTSTRAP_STATUS_CIRCUIT_CREATE;
		initializationTracker.notifyEvent(event);
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:CircuitBuildTask.java


示例9: purposeToEventCode

import com.subgraph.orchid.Tor; //导入依赖的package包/类
private int purposeToEventCode(int purpose, boolean getLoadingEvent) {
	switch(purpose) {
	case DIRECTORY_PURPOSE_CONSENSUS:
		return getLoadingEvent ? Tor.BOOTSTRAP_STATUS_LOADING_STATUS : Tor.BOOTSTRAP_STATUS_REQUESTING_STATUS;
	case DIRECTORY_PURPOSE_CERTIFICATES:
		 return getLoadingEvent ? Tor.BOOTSTRAP_STATUS_LOADING_KEYS : Tor.BOOTSTRAP_STATUS_REQUESTING_KEYS;
	case DIRECTORY_PURPOSE_DESCRIPTORS:
		return getLoadingEvent ? Tor.BOOTSTRAP_STATUS_LOADING_DESCRIPTORS : Tor.BOOTSTRAP_STATUS_REQUESTING_DESCRIPTORS;
	default:
		return 0;
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:13,代码来源:CircuitManagerImpl.java


示例10: createSocketInstance

import com.subgraph.orchid.Tor; //导入依赖的package包/类
private Socket createSocketInstance() throws SocketException {
	final OrchidSocketImpl impl = new OrchidSocketImpl(torClient);
	if(Tor.isAndroidRuntime()) {
		return new AndroidSocket(impl);
	} else {
		// call protected constructor
		return new Socket(impl) {};
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:10,代码来源:OrchidSocketFactory.java


示例11: createSSLSocketFactory

import com.subgraph.orchid.Tor; //导入依赖的package包/类
private SSLSocketFactory createSSLSocketFactory() {
	if(Tor.isAndroidRuntime()) {
		return createAndroidSSLSocketFactory();
	}
	if(sslContext == null) {
		return (SSLSocketFactory) SSLSocketFactory.getDefault();
	} else {
		return sslContext.getSocketFactory();
	}
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:OrchidXmlRpcTransport.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SVcsModification类代码示例发布时间:2022-05-23
下一篇:
Java HttpServer类代码示例发布时间: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