public CreateSessionMessage() { _sessionConfig = new SessionConfig(); }
public DataStructure createStructureToRead() { return new SessionConfig(); } }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { SessionConfig config = new SessionConfig(); try { config.readBytes(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the session configuration", dfe); } setSessionConfig(config); }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); _sessionConfig = new SessionConfig(); _sessionConfig.readBytes(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } }
SessionConfig cfg = new SessionConfig(session.getMyDestination()); Properties props = getRouterOptions(session); if (tunnels > 0) {
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); }
SessionConfig cfg = new SessionConfig(dest); cfg.setSignature(in.getSignature()); Properties props = new Properties();