use of net.i2p.data.router.RouterIdentity in project i2p.i2p by i2p.
the class RouterGenerator method createRouterInfo.
static RouterInfo createRouterInfo(int num) {
RouterInfo info = new RouterInfo();
try {
info.setAddresses(createAddresses(num));
// not necessary, in constructor
// info.setOptions(new Properties());
// info.setPeers(new HashSet());
info.setPublished(Clock.getInstance().now());
RouterIdentity ident = new RouterIdentity();
BigInteger bv = new BigInteger("" + num);
Certificate cert = new Certificate(Certificate.CERTIFICATE_TYPE_NULL, bv.toByteArray());
ident.setCertificate(cert);
ident.setPublicKey(pubkey);
ident.setSigningPublicKey(signingPubKey);
info.setIdentity(ident);
info.sign(signingPrivKey);
} catch (Exception e) {
System.err.println("Error building router " + num + ": " + e.getMessage());
e.printStackTrace();
}
return info;
}
use of net.i2p.data.router.RouterIdentity in project i2p.i2p by i2p.
the class RouterITBase method routerClassSetup.
@BeforeClass
public static void routerClassSetup() {
// order of these matters
Router r = new Router();
_context = new RouterContext(r);
_context.initAll();
r.runRouter();
RouterIdentity rIdentity = new TestRouterIdentity();
RouterInfo rInfo = new RouterInfo();
rInfo.setIdentity(rIdentity);
r.setRouterInfo(rInfo);
_config = prepareConfig(8);
}
Aggregations