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 int
MESSAGE_TYPE
static int
TYPE_DEST
static int
TYPE_HASH
static int
TYPE_HOST
static int
TYPE_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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)int
getAuthType()
BlindData
getBlindData()
String
getDestination()
int
getEndpointType()
Hash
getHash()
String
getHostname()
PrivateKey
getPrivateKey()
String
getSecret()
SessionId
getSessionId()
SigningPublicKey
getSigningPublicKey()
long
getTimeout()
int
getType()
Return the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessagesSessionId
sessionId()
Return the SessionId for this message.String
toString()
-
Methods inherited from class net.i2p.data.i2cp.I2CPMessageImpl
readBytes, readMessage, readMessage, writeBytes, writeMessage
-
-
-
-
Field Detail
-
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 Detail
-
BlindingInfoMessage
public BlindingInfoMessage()
-
BlindingInfoMessage
public BlindingInfoMessage(BlindData bd, SessionId id)
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 Detail
-
getSessionId
public SessionId getSessionId()
-
sessionId
public SessionId sessionId()
Return the SessionId for this message.- Specified by:
sessionId
in interfaceI2CPMessage
- Overrides:
sessionId
in 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
public Hash getHash()
- Returns:
- only valid if endpoint type == 0 or 2
-
getHostname
public String getHostname()
- Returns:
- only valid if endpoint type == 1
-
getDestination
public String getDestination()
- Returns:
- only valid if endpoint type == 2
-
getSigningPublicKey
public SigningPublicKey getSigningPublicKey()
- Returns:
- only valid if endpoint type == 2 or 3
-
getPrivateKey
public PrivateKey getPrivateKey()
- Returns:
- private key or null
-
getSecret
public String getSecret()
- Returns:
- secret or null
-
getBlindData
public BlindData getBlindData()
- Returns:
- blind data or null if not enough info
-
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)- Specified by:
doReadMessage
in classI2CPMessageImpl
- 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)- Specified by:
doWriteMessage
in classI2CPMessageImpl
- 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- Returns:
- unique identifier for this type of message
-
-