本文整理汇总了Java中com.subgraph.orchid.Router.getIdentityHash方法的典型用法代码示例。如果您正苦于以下问题:Java Router.getIdentityHash方法的具体用法?Java Router.getIdentityHash怎么用?Java Router.getIdentityHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.subgraph.orchid.Router
的用法示例。
在下文中一共展示了Router.getIdentityHash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifyIdentityKey
import com.subgraph.orchid.Router; //导入方法依赖的package包/类
protected void verifyIdentityKey(PublicKey publicKey) throws ConnectionHandshakeException {
if(!(publicKey instanceof RSAPublicKey)) {
throw new ConnectionHandshakeException("Identity certificate public key is not an RSA key as expected");
}
final TorPublicKey identityKey = new TorPublicKey((RSAPublicKey)publicKey);
final Router router = connection.getRouter();
if((router instanceof BridgeRouter) && (router.getIdentityHash() == null)) {
logger.info("Setting Bridge fingerprint from connection handshake for "+ router);
((BridgeRouter) router).setIdentity(identityKey.getFingerprint());
} else if(!identityKey.getFingerprint().equals(router.getIdentityHash())) {
throw new ConnectionHandshakeException("Router identity does not match certificate key");
}
}
示例2: NTorCircuitExtender
import com.subgraph.orchid.Router; //导入方法依赖的package包/类
public NTorCircuitExtender(CircuitExtender extender, Router router) {
this.extender = extender;
this.router = router;
this.kex = new TorNTorKeyAgreement(router.getIdentityHash(), router.getNTorOnionKey());
}