Class 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.
    • Constructor Detail

    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Job
        Descriptive name of the task
      • runJob

        public void runJob()
        Description copied from interface: Job
        Actually perform the task. This call blocks until the Job is complete.
      • 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.
      • getSigTypeConfig

        public static SigType getSigTypeConfig​(RouterContext ctx)
        The configured SigType to expect on read-in
        Since:
        0.9.16
      • 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?
      • createCertificate

        static Certificate createCertificate​(RouterContext ctx,
                                             SigningPublicKey spk)
        Only called at startup via LoadRouterInfoJob and RebuildRouterInfoJob. Not called by periodic RepublishLocalRouterInfoJob. We don't want to change the cert on the fly as it changes the router hash. RouterInfo.isHidden() checks the capability, but RouterIdentity.isHidden() checks the cert. There's no reason to ever add a hidden cert?
        Returns:
        the certificate for a new RouterInfo - probably a null cert.
        Since:
        0.9.16 moved from Router