Package net.i2p.client
Interface I2PClient
- All Known Implementing Classes:
I2PClientImpl
,I2PSimpleClient
public interface I2PClient
Define the standard means of interacting with the I2P system
An I2PClient contains no state, it is just a facility for creating private key files
and generating sesssions from existing private key files.
- Author:
- jrandom
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_LISTEN_PORT
7654static SigType
DEFAULT_SIGTYPE
static String
PROP_ENABLE_SSL
static String
PROP_FAST_RECEIVE
For router->client payloads.static String
PROP_GZIP
static String
PROP_PW
static String
PROP_RELIABILITY
Reliability propertystatic String
PROP_RELIABILITY_BEST_EFFORT
Reliability value: best effortstatic String
PROP_RELIABILITY_GUARANTEED
Reliability value: guaranteedstatic String
PROP_RELIABILITY_NONE
static String
PROP_SIGTYPE
static String
PROP_TCP_HOST
Standard host property, defaulting to localhost if not specifiedstatic String
PROP_TCP_PORT
Standard port number propertystatic String
PROP_USER
static int
PROTOCOL_BYTE
protocol flag that must be sent when opening the i2cp connection to the router -
Method Summary
Modifier and Type Method Description Destination
createDestination(OutputStream destKeyStream)
Create a new destination with the default certificate creation properties and store it, along with the private encryption and signing keys at the specified location Caller must close stream.Destination
createDestination(OutputStream destKeyStream, SigType type)
Create a destination with the given signature type.Destination
createDestination(OutputStream destKeyStream, Certificate cert)
Create a new destination with the given certificate and store it, along with the private encryption and signing keys at the specified location Caller must close stream.I2PSession
createSession(InputStream destKeyStream, Properties options)
Create a new client session for the Destination stored at the destKeyStream using the specified options to both connect to the router, to instruct the router how to handle the new session, and to configure the end to end encryption.
-
Field Details
-
PROP_TCP_HOST
Standard host property, defaulting to localhost if not specified- See Also:
- Constant Field Values
-
PROP_TCP_PORT
Standard port number property- See Also:
- Constant Field Values
-
PROP_RELIABILITY
Reliability property- See Also:
- Constant Field Values
-
PROP_RELIABILITY_BEST_EFFORT
Reliability value: best effort- See Also:
- Constant Field Values
-
PROP_RELIABILITY_GUARANTEED
Reliability value: guaranteed- See Also:
- Constant Field Values
-
PROP_RELIABILITY_NONE
- Since:
- 0.8.1
- See Also:
- Constant Field Values
-
PROP_SIGTYPE
- Since:
- 0.9.12
- See Also:
- Constant Field Values
-
DEFAULT_SIGTYPE
- Since:
- 0.9.12
-
PROP_FAST_RECEIVE
For router->client payloads. If false, the router will send the MessageStatus, the client must respond with a ReceiveMessageBegin, the router will send the MessagePayload, and the client respond with a ReceiveMessageEnd. If true, the router will send the MessagePayload immediately, and will not send a MessageStatus. The client will not send ReceiveMessageBegin or ReceiveMessageEnd. Default false, but the implementation in this package sets to true.- Since:
- 0.9.4
- See Also:
- Constant Field Values
-
PROP_ENABLE_SSL
- Since:
- 0.9.44, was protected in I2PSessionImpl
- See Also:
- Constant Field Values
-
PROP_USER
- Since:
- 0.9.44, was protected in I2PSessionImpl
- See Also:
- Constant Field Values
-
PROP_PW
- Since:
- 0.9.44, was protected in I2PSessionImpl
- See Also:
- Constant Field Values
-
PROP_GZIP
- Since:
- 0.9.46
- See Also:
- Constant Field Values
-
DEFAULT_LISTEN_PORT
static final int DEFAULT_LISTEN_PORT7654- Since:
- 0.9.38
- See Also:
- Constant Field Values
-
PROTOCOL_BYTE
static final int PROTOCOL_BYTEprotocol flag that must be sent when opening the i2cp connection to the router- See Also:
- Constant Field Values
-
-
Method Details
-
createSession
Create a new client session for the Destination stored at the destKeyStream using the specified options to both connect to the router, to instruct the router how to handle the new session, and to configure the end to end encryption. As of 0.9.19, defaults in options are honored.- Parameters:
destKeyStream
- location from which to read the Destination, PrivateKey, and SigningPrivateKey from, format is specified inPrivateKeyFile
options
- set of options to configure the router with, if null will use System properties- Returns:
- new session allowing a Destination to recieve all of its messages and send messages to any other Destination.
- Throws:
I2PSessionException
-
createDestination
Create a new destination with the default certificate creation properties and store it, along with the private encryption and signing keys at the specified location Caller must close stream.- Parameters:
destKeyStream
- create a new destination and write out the object to the given stream, formatted as Destination, PrivateKey, and SigningPrivateKey format is specified inPrivateKeyFile
- Returns:
- new destination
- Throws:
I2PException
IOException
-
createDestination
Destination createDestination(OutputStream destKeyStream, SigType type) throws I2PException, IOExceptionCreate a destination with the given signature type. It will have a null certificate for DSA 1024/160 and KeyCertificate otherwise. This is not bound to the I2PClient, you must supply the data back again in createSession(). Caller must close stream.- Parameters:
destKeyStream
- location to write out the destination, PrivateKey, and SigningPrivateKey, format is specified inPrivateKeyFile
- Throws:
I2PException
IOException
- Since:
- 0.9.12
-
createDestination
Destination createDestination(OutputStream destKeyStream, Certificate cert) throws I2PException, IOExceptionCreate a new destination with the given certificate and store it, along with the private encryption and signing keys at the specified location Caller must close stream.- Parameters:
destKeyStream
- location to write out the destination, PrivateKey, and SigningPrivateKey, format is specified inPrivateKeyFile
cert
- certificate to tie to the destination- Returns:
- newly created destination
- Throws:
I2PException
IOException
-