java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.KeyManager.SynchronizeKeysJob
All Implemented Interfaces:
Job
Enclosing class:
KeyManager

private class KeyManager.SynchronizeKeysJobextends JobImpl
Read/Write the 4 files in keyBackup/ As of 0.9.4 this is run on-demand only, there's no need to periodically sync. Actually, there's little need for this at all. If router.keys is corrupt, we should just make a new router identity, there's no real reason to try so hard to recover our old keys.
  • Constructor Details

    • SynchronizeKeysJob

      public SynchronizeKeysJob()
      Builds the key synchronization job.
  • Method Details

    • runJob

      public void runJob()
      Execute the job.
    • syncKeys

      private void syncKeys(File keyDir)
      Synchronizes the router keys with the files in the directory.
      Parameters:
      keyDir - the key directory
    • syncPrivateKey

      private void syncPrivateKey(File keyDir)
      Synchronizes the private key with its file.
      Parameters:
      keyDir - the key directory
    • syncPublicKey

      private void syncPublicKey(File keyDir)
      Synchronizes the public key with its file.
      Parameters:
      keyDir - the key directory
    • syncSigningKey

      private void syncSigningKey(File keyDir, SigType type)
      Synchronize the signing private key with the file on disk.
      Parameters:
      keyDir - the key directory
      type - the SigType to expect on read-in, ignored on write
    • syncVerificationKey

      private void syncVerificationKey(File keyDir, SigType type)
      Synchronize the signing public key with the file on disk.
      Parameters:
      keyDir - the key directory
      type - the SigType to expect on read-in, ignored on write
    • syncKey

      private DataStructure syncKey(File keyFile, DataStructure structure, boolean exists)
      Synchronize the given structure with the file on disk.
      Parameters:
      keyFile - the file holding the serialized structure
      structure - non-null, filled-in if exists is true, or without data if exists is false
      exists - write to file if true, read from file if false
      Returns:
      structure or null on read error
    • getName

      public String getName()
      Return the name.
      Returns:
      the descriptive name of the task