net.i2p.router.startup

## Class CreateRouterInfoJob

- java.lang.Object
- - net.i2p.router.JobImpl
  - - net.i2p.router.startup.CreateRouterInfoJob

- All Implemented Interfaces:
    Job

      public class CreateRouterInfoJob
      extends JobImpl

  Warning - misnamed. This creates a new RouterIdentity, i.e. new router keys and hash. It then builds a new RouterInfo and saves all the keys. This is generally run only once, on a new install.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `INFO_FILENAME`
    `static String` | `KEYS_FILENAME`
    `static String` | `KEYS2_FILENAME`
    `(package private) static String` | `PROP_ROUTER_ENCTYPE`
    `(package private) static String` | `PROP_ROUTER_SIGTYPE`

    - ### Fields inherited from class net.i2p.router.JobImpl

      `_id`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CreateRouterInfoJob(RouterContext ctx, Job next)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) RouterInfo` | `createRouterInfo()` Writes 6 files: router.info (standard RI format), router.keys.dat, and 4 individual key files under keyBackup/ router.keys.dat file format: This is the same "eepPriv.dat" format used by the client code, as documented in PrivateKeyFile.
    `(package private) static long` | `getCurrentPublishDate(RouterContext context)` We probably don't want to expose the exact time at which a router published its info.
    `static EncType` | `getEncTypeConfig(RouterContext ctx)` The configured EncType to expect on read-in
    `String` | `getName()` Descriptive name of the task
    `static SigType` | `getSigTypeConfig(RouterContext ctx)` The configured SigType to expect on read-in
    `void` | `runJob()` Actually perform the task.

    - ### Methods inherited from class net.i2p.router.JobImpl

      `dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### INFO_FILENAME

          public static final String INFO_FILENAME

      See Also:
        Constant Field Values

    - #### KEYS_FILENAME

          public static final String KEYS_FILENAME

      See Also:
        Constant Field Values

    - #### KEYS2_FILENAME

          public static final String KEYS2_FILENAME

      See Also:
        Constant Field Values

    - #### PROP_ROUTER_ENCTYPE

          static final String PROP_ROUTER_ENCTYPE

      See Also:
        Constant Field Values

    - #### PROP_ROUTER_SIGTYPE

          static final String PROP_ROUTER_SIGTYPE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CreateRouterInfoJob

          CreateRouterInfoJob(RouterContext ctx,
                              Job next)

  - ### Method Detail

    - #### createRouterInfo

          RouterInfo createRouterInfo()

      Writes 6 files: router.info (standard RI format), router.keys.dat, and 4 individual key files under keyBackup/ router.keys.dat file format: This is the same "eepPriv.dat" format used by the client code, as documented in PrivateKeyFile. Old router.keys file format: Note that this is NOT the same "eepPriv.dat" format used by the client code.

             - Private key (256 bytes)
             - Signing Private key (20 bytes)
             - Public key (256 bytes)
             - Signing Public key (128 bytes)
            Total 660 bytes

      Caller must hold Router.routerInfoFileLock.

    - #### getCurrentPublishDate

          static long getCurrentPublishDate(RouterContext context)

      We probably don't want to expose the exact time at which a router published its info. perhaps round down to the nearest minute? 10 minutes? 30 minutes? day?

    - #### getEncTypeConfig

          public static EncType getEncTypeConfig(RouterContext ctx)

      The configured EncType to expect on read-in

    - #### getName

          public String getName()

      Description copied from interface: `Job`
      Descriptive name of the task
      Returns:
        the descriptive name of the task

    - #### getSigTypeConfig

          public static SigType getSigTypeConfig(RouterContext ctx)

      The configured SigType to expect on read-in

    - #### runJob

          public void runJob()

      Description copied from interface: `Job`
      Actually perform the task. This call blocks until the Job is complete.