Package net.i2p.data.i2cp
Class BlindingInfoMessage
java.lang.Object
net.i2p.data.i2cp.I2CPMessageImpl
net.i2p.data.i2cp.BlindingInfoMessage
- All Implemented Interfaces:
I2CPMessage
public class BlindingInfoMessage extends I2CPMessageImpl
Advise the router that the endpoint is blinded.
Client to router. There is no reply.
Preliminary - subject to change -
See proposal 123.
-
Field Summary
Fields Modifier and Type Field Description static intMESSAGE_TYPEstatic intTYPE_DESTstatic intTYPE_HASHstatic intTYPE_HOSTstatic intTYPE_KEY -
Constructor Summary
Constructors Constructor Description BlindingInfoMessage()BlindingInfoMessage(String h, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret)Deprecated.unimplemented on router sideBlindingInfoMessage(BlindData bd, SessionId id)This is the constructor used by I2CP client-side.BlindingInfoMessage(Destination d, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret)BlindingInfoMessage(Hash h, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret)Deprecated.unimplemented on router sideBlindingInfoMessage(SigningPublicKey s, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret) -
Method Summary
Modifier and Type Method Description 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[]doWriteMessage()Write out the payload part of the message (not including the 4 byte size and 1 byte type)intgetAuthType()BlindDatagetBlindData()StringgetDestination()intgetEndpointType()HashgetHash()StringgetHostname()PrivateKeygetPrivateKey()StringgetSecret()SessionIdgetSessionId()SigningPublicKeygetSigningPublicKey()longgetTimeout()intgetType()Return the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessagesSessionIdsessionId()Return the SessionId for this message.StringtoString()Methods inherited from class net.i2p.data.i2cp.I2CPMessageImpl
readBytes, readMessage, readMessage, writeBytes, writeMessage
-
Field Details
-
MESSAGE_TYPE
public static final int MESSAGE_TYPE- See Also:
- Constant Field Values
-
TYPE_HASH
public static final int TYPE_HASH- See Also:
- Constant Field Values
-
TYPE_HOST
public static final int TYPE_HOST- See Also:
- Constant Field Values
-
TYPE_DEST
public static final int TYPE_DEST- See Also:
- Constant Field Values
-
TYPE_KEY
public static final int TYPE_KEY- See Also:
- Constant Field Values
-
-
Constructor Details
-
BlindingInfoMessage
public BlindingInfoMessage() -
BlindingInfoMessage
This is the constructor used by I2CP client-side. Will create a DEST or KEY message type, depending on whether BlindData has the full destination. -
BlindingInfoMessage
@Deprecated public BlindingInfoMessage(Hash h, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret)Deprecated.unimplemented on router sideHASH not supported by router and may not be useful- Parameters:
authType- 0 (none), 1 (DH), 3 (PSK)expiration- ms from now or 0 for foreverprivKey- null for auth none, non-null for DH/PSKsecret- may be null, 255 UTF-8 bytes max
-
BlindingInfoMessage
@Deprecated public BlindingInfoMessage(String h, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret)Deprecated.unimplemented on router sideHOST not supported by router and may not be useful- Parameters:
h- hostnameauthType- 0 (none), 1 (DH), 3 (PSK)expiration- ms from now or 0 for foreverprivKey- null for auth none, non-null for DH/PSKsecret- may be null, 255 UTF-8 bytes max
-
BlindingInfoMessage
public BlindingInfoMessage(Destination d, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret)- Parameters:
authType- 0 (none), 1 (DH), 3 (PSK)expiration- ms from now or 0 for foreverprivKey- null for auth none, non-null for DH/PSKsecret- may be null, 255 UTF-8 bytes max
-
BlindingInfoMessage
public BlindingInfoMessage(SigningPublicKey s, SessionId id, int expiration, int authType, SigType blindType, PrivateKey privKey, String secret)- Parameters:
authType- 0 (none), 1 (DH), 3 (PSK)expiration- ms from now or 0 for foreverprivKey- null for auth none, non-null for DH/PSKsecret- may be null, 255 UTF-8 bytes max
-
-
Method Details
-
getSessionId
-
sessionId
Return the SessionId for this message.- Specified by:
sessionIdin interfaceI2CPMessage- Overrides:
sessionIdin classI2CPMessageImpl- Returns:
- null always. Extending classes with a SessionId must override.
-
getTimeout
public long getTimeout()- Returns:
- ms 1 to 2**32 - 1
-
getAuthType
public int getAuthType()- Returns:
- 0 (none), 1 (DH), 3 (PSK)
-
getEndpointType
public int getEndpointType()- Returns:
- 0 (hash) or 1 (host) or 2 (dest) or 3 (key)
-
getHash
- Returns:
- only valid if endpoint type == 0 or 2
-
getHostname
- Returns:
- only valid if endpoint type == 1
-
getDestination
- Returns:
- only valid if endpoint type == 2
-
getSigningPublicKey
- Returns:
- only valid if endpoint type == 2 or 3
-
getPrivateKey
- Returns:
- private key or null
-
getSecret
- Returns:
- secret or null
-
getBlindData
- Returns:
- blind data or null if not enough info
-
doReadMessage
Description copied from class:I2CPMessageImplRead in the payload part of the message (after the initial 4 byte size and 1 byte type)- Specified by:
doReadMessagein classI2CPMessageImpl- 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)- Specified by:
doWriteMessagein classI2CPMessageImpl- 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- Returns:
- unique identifier for this type of message
-
toString
-