props.setProperty("outbound.backupQuantity", "0"); cfg.setOptions(props); try { cfg.signSessionConfig(session.getPrivateKey());
public DataStructure createDataStructure() throws DataFormatException { SessionConfig cfg = new SessionConfig((Destination)(new DestinationTest()).createDataStructure()); cfg.setSignature((Signature)(new SignatureTest()).createDataStructure()); Properties options = new Properties(); options.setProperty("routerHost", "localhost"); options.setProperty("routerPort", "54321"); options.setProperty("routerSecret", "blah"); cfg.setOptions(options); cfg.signSessionConfig((SigningPrivateKey)(new SigningPrivateKeyTest()).createDataStructure()); return cfg; } public DataStructure createStructureToRead() { return new SessionConfig(); }
/** * Send all the messages that a client needs to send to a router to establish * a new session. */ public void connect(I2PSessionImpl session) throws I2PSessionException { updateBandwidth(session); CreateSessionMessage msg = new CreateSessionMessage(); SessionConfig cfg = new SessionConfig(session.getMyDestination()); cfg.setOptions(getRouterOptions(session)); if (session.isOffline()) { cfg.setOfflineSignature(session.getOfflineExpiration(), session.getTransientSigningPublicKey(), session.getOfflineSignature()); } try { cfg.signSessionConfig(session.getPrivateKey()); } catch (DataFormatException dfe) { throw new I2PSessionException("Unable to sign the session config", dfe); } msg.setSessionConfig(cfg); session.sendMessage_unchecked(msg); }
props.setProperty("outbound.lengthVariance", "0"); cfg.setOptions(props);