Package net.i2p.data.i2cp
Class CreateLeaseSet2Message
- java.lang.Object
-
- net.i2p.data.i2cp.I2CPMessageImpl
-
- net.i2p.data.i2cp.CreateLeaseSetMessage
-
- net.i2p.data.i2cp.CreateLeaseSet2Message
-
- All Implemented Interfaces:
I2CPMessage
public class CreateLeaseSet2Message extends CreateLeaseSetMessage
Like CreateLeaseSetMessage, but supports both old and new LeaseSet types, including LS2, Meta, and Encrypted. Revocation keys are not present. Multiple public/private encryption keys are possible. For LS2: Same as CreateLeaseSetMessage, but has a netdb type before the LeaseSet. PrivateKeys are serialized after the LeaseSet, not before, so we can infer the types from the LeaseSet. For Meta LS: PrivateKeys are not present. For Encrypted LS: TODO- Since:
- 0.9.38
-
-
Field Summary
Fields Modifier and Type Field Description static int
MESSAGE_TYPE
NOTE: Preliminary format was type 40 in 0.9.38.-
Fields inherited from class net.i2p.data.i2cp.CreateLeaseSetMessage
_leaseSet, _privateKey, _sessionId
-
-
Constructor Summary
Constructors Constructor Description CreateLeaseSet2Message()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPrivateKey(PrivateKey key)
Add a private key.protected void
doReadMessage(InputStream in, int size)
Read in the payload part of the message (after the initial 4 byte size and 1 byte type)protected byte[]
doWriteMessage()
Write out the payload part of the message (not including the 4 byte size and 1 byte type)List<PrivateKey>
getPrivateKeys()
This returns all the keys.int
getType()
Return the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessagesString
toString()
-
Methods inherited from class net.i2p.data.i2cp.CreateLeaseSetMessage
getLeaseSet, getPrivateKey, getSessionId, getSigningPrivateKey, sessionId, setLeaseSet, setPrivateKey, setSessionId, setSigningPrivateKey
-
Methods inherited from class net.i2p.data.i2cp.I2CPMessageImpl
readBytes, readMessage, readMessage, writeBytes, writeMessage
-
-
-
-
Field Detail
-
MESSAGE_TYPE
public static final int MESSAGE_TYPE
NOTE: Preliminary format was type 40 in 0.9.38. Format changed as of 0.9.39, changed type to 41.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPrivateKeys
public List<PrivateKey> getPrivateKeys()
This returns all the keys. getPrivateKey() returns the first one.- Returns:
- not a copy, do not modify, null if none
-
addPrivateKey
public void addPrivateKey(PrivateKey key)
Add a private key.
-
doReadMessage
protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException
Description copied from class:I2CPMessageImpl
Read in the payload part of the message (after the initial 4 byte size and 1 byte type)- Overrides:
doReadMessage
in classCreateLeaseSetMessage
- Parameters:
in
- InputStreamsize
- payload size- Throws:
I2CPMessageException
IOException
-
doWriteMessage
protected byte[] doWriteMessage() throws I2CPMessageException, IOException
Description copied from class:I2CPMessageImpl
Write out the payload part of the message (not including the 4 byte size and 1 byte type)- Overrides:
doWriteMessage
in classCreateLeaseSetMessage
- Returns:
- byte array
- Throws:
I2CPMessageException
IOException
-
getType
public int getType()
Description copied from interface:I2CPMessage
Return the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessages- Specified by:
getType
in interfaceI2CPMessage
- Overrides:
getType
in classCreateLeaseSetMessage
- Returns:
- unique identifier for this type of message
-
toString
public String toString()
- Overrides:
toString
in classCreateLeaseSetMessage
-
-