@Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("[CreateLeaseSetMessage: "); buf.append("\n\tLeaseSet: ").append(getLeaseSet()); buf.append("\n\tSigningPrivateKey: ").append(getSigningPrivateKey()); buf.append("\n\tPrivateKey: ").append(getPrivateKey()); buf.append("\n\tSessionId: ").append(getSessionId()); buf.append("]"); return buf.toString(); } }
int type = leaseSet.getType(); if (type == DatabaseEntry.KEY_TYPE_LEASESET) { msg = new CreateLeaseSetMessage(); msg.setPrivateKey(privs.get(0)); } else { CreateLeaseSet2Message msg2 = new CreateLeaseSet2Message(); msg.setLeaseSet(leaseSet); msg.setSigningPrivateKey(signingPriv); SessionId sid = session.getSessionId(); if (sid == null) { return; msg.setSessionId(sid); session.sendMessage_unchecked(msg);
/** * Don't tell the netdb or key manager */ @Override protected void handleCreateLeaseSet(CreateLeaseSetMessage message) { _runner.leaseSetCreated(message.getLeaseSet()); }
public DataStructure createStructureToRead() { return new CreateLeaseSetMessage(); } }
switch (type) { case CreateLeaseSetMessage.MESSAGE_TYPE: return new CreateLeaseSetMessage(); case CreateSessionMessage.MESSAGE_TYPE: return new CreateSessionMessage();
public DataStructure createDataStructure() throws DataFormatException { CreateLeaseSetMessage msg = new CreateLeaseSetMessage(); msg.setPrivateKey((PrivateKey)(new PrivateKeyTest()).createDataStructure()); msg.setSigningPrivateKey((SigningPrivateKey)(new SigningPrivateKeyTest()).createDataStructure()); msg.setLeaseSet((LeaseSet)(new LeaseSetTest()).createDataStructure()); msg.setSessionId((SessionId)(new SessionIdTest()).createDataStructure()); return msg; } public DataStructure createStructureToRead() { return new CreateLeaseSetMessage(); }
LeaseSet ls = message.getLeaseSet(); if (ls == null) { if (_log.shouldLog(Log.ERROR)) (message.getPrivateKey() == null || message.getSigningPrivateKey() == null)) { if (_log.shouldLog(Log.ERROR)) _log.error("Null private keys: " + message); return; SessionId id = message.getSessionId(); SessionConfig cfg = _runner.getConfig(id); if (cfg == null) { LeaseSetKeys keys = _context.keyManager().getKeys(dest); if (keys == null || !message.getPrivateKey().equals(keys.getDecryptionKey())) { pk = message.getPrivateKey().toPublic(); } catch (IllegalArgumentException iae) { if (_log.shouldLog(Log.ERROR)) _context.keyManager().registerKeys(dest, message.getSigningPrivateKey(), message.getPrivateKey()); } else if (!message.getSigningPrivateKey().equals(keys.getRevocationKey())) { _context.keyManager().registerKeys(dest, message.getSigningPrivateKey(), message.getPrivateKey());