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
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
Modifier and TypeFieldDescriptionstatic final int
NOTE: Preliminary format was type 40 in 0.9.38.Fields inherited from class net.i2p.data.i2cp.CreateLeaseSetMessage
_leaseSet, _privateKey, _sessionId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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[]
Write out the payload part of the message (not including the 4 byte size and 1 byte type)This returns all the keys.int
getType()
Return the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessagestoString()
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 Details
-
MESSAGE_TYPE
public static final int MESSAGE_TYPENOTE: Preliminary format was type 40 in 0.9.38. Format changed as of 0.9.39, changed type to 41.- See Also:
-
-
Constructor Details
-
CreateLeaseSet2Message
public CreateLeaseSet2Message()
-
-
Method Details
-
getPrivateKeys
This returns all the keys. getPrivateKey() returns the first one.- Returns:
- not a copy, do not modify, null if none
-
addPrivateKey
Add a private key. -
doReadMessage
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
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
- Overrides:
toString
in classCreateLeaseSetMessage
-