Class I2PClientImpl

java.lang.Object
net.i2p.client.impl.I2PClientImpl
All Implemented Interfaces:
I2PClient

public class I2PClientImpl extends Object implements I2PClient
Base client implementation. 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
  • Constructor Details

    • I2PClientImpl

      public I2PClientImpl()
  • Method Details

    • createDestination

      public Destination createDestination(OutputStream destKeyStream) throws I2PException, IOException
      Create a destination with a DSA 1024/160 signature type and a null certificate. This is not bound to the I2PClient, you must supply the data back again in createSession(). Caller must close stream.
      Specified by:
      createDestination in interface I2PClient
      Parameters:
      destKeyStream - location to write out the destination, PrivateKey, and SigningPrivateKey, format is specified in PrivateKeyFile
      Returns:
      new destination
      Throws:
      I2PException
      IOException
    • createDestination

      public Destination createDestination(OutputStream destKeyStream, SigType type) throws I2PException, IOException
      Create 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.
      Specified by:
      createDestination in interface I2PClient
      Parameters:
      destKeyStream - location to write out the destination, PrivateKey, and SigningPrivateKey, format is specified in PrivateKeyFile
      Throws:
      I2PException
      IOException
      Since:
      0.9.12
    • createDestination

      public Destination createDestination(OutputStream destKeyStream, Certificate cert) throws I2PException, IOException
      Create the destination with the given payload and write it out along with the PrivateKey and SigningPrivateKey to the destKeyStream If cert is a KeyCertificate, the signing keypair will be of the specified type. The KeyCertificate data must be ............................. The padding if any will be randomized. The extra key data if any will be set in the key cert. Caller must close stream.
      Specified by:
      createDestination in interface I2PClient
      Parameters:
      destKeyStream - location to write out the destination, PrivateKey, and SigningPrivateKey, format is specified in PrivateKeyFile
      cert - certificate to tie to the destination
      Returns:
      newly created destination
      Throws:
      I2PException
      IOException
    • createSession

      public I2PSession createSession(InputStream destKeyStream, Properties options) throws I2PSessionException
      Create a new session (though do not connect it yet)
      Specified by:
      createSession in interface I2PClient
      Parameters:
      destKeyStream - location from which to read the Destination, PrivateKey, and SigningPrivateKey from, format is specified in PrivateKeyFile
      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
    • createSession

      public I2PSession createSession(I2PAppContext context, InputStream destKeyStream, Properties options) throws I2PSessionException
      Create a new session (though do not connect it yet)
      Parameters:
      destKeyStream - location from which to read the Destination, PrivateKey, and SigningPrivateKey from, format is specified in PrivateKeyFile
      options - set of options to configure the router with, if null will use System properties
      Throws:
      I2PSessionException