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
FieldsModifier and TypeFieldDescriptionstatic final intNOTE: Preliminary format was type 40 in 0.9.38.Fields inherited from class net.i2p.data.i2cp.CreateLeaseSetMessage
_leaseSet, _privateKey, _sessionId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrivateKey(PrivateKey key) Add a private key.protected voiddoReadMessage(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.intgetType()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, setSigningPrivateKeyMethods 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:I2CPMessageImplRead in the payload part of the message (after the initial 4 byte size and 1 byte type)- Overrides:
doReadMessagein classCreateLeaseSetMessage- Parameters:
in- InputStreamsize- payload size- Throws:
I2CPMessageExceptionIOException
-
doWriteMessage
Description copied from class:I2CPMessageImplWrite out the payload part of the message (not including the 4 byte size and 1 byte type)- Overrides:
doWriteMessagein classCreateLeaseSetMessage- Returns:
- byte array
- Throws:
I2CPMessageExceptionIOException
-
getType
public int getType()Description copied from interface:I2CPMessageReturn the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessages- Specified by:
getTypein interfaceI2CPMessage- Overrides:
getTypein classCreateLeaseSetMessage- Returns:
- unique identifier for this type of message
-
toString
- Overrides:
toStringin classCreateLeaseSetMessage
-