java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.startup.CreateRouterInfoJob
- All Implemented Interfaces:
Job
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
FieldsModifier and TypeFieldDescriptionstatic final StringRouter info filename.static final StringOld router keys filename.static final StringRouter keys filename.(package private) static final StringProperty for router encryption type.(package private) static final StringProperty for router signature type.Constructor Summary
ConstructorsConstructorDescriptionCreateRouterInfoJob(RouterContext ctx, Job next) Creates a new CreateRouterInfoJob.Method Summary
Modifier and TypeMethodDescription(package private) RouterInfoWrites 6 files:router.info(standard RI format),router.keys.dat, and 4 individual key files under keyBackup/(package private) static longgetCurrentPublishDate(RouterContext context) We probably don't want to expose the exact time at which a router published its info.static EncTypeThe configured EncType to expect on read-in.getName()Descriptive name of the task.static SigTypeThe configured SigType to expect on read-in.voidrunJob()Actually perform the task.Methods inherited from class JobImpl
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionvoiddropped()Default implementation does nothing.final RouterContextThe router context that this job belongs to.longgetJobId()The unique job ID for this job.longThe timestamp when this job was last made ready for execution.The timing object for this job.voidmadeReady(long now) For JobQueue only, not for external use.protected voidrequeue(long delayMs) Requeue this job to run after the specified delay.toString()
Field Details
INFO_FILENAME
KEYS_FILENAME
KEYS2_FILENAME
PROP_ROUTER_SIGTYPE
Property for router signature type.- See Also:
PROP_ROUTER_ENCTYPE
Property for router encryption type.- See Also:
Constructor Details
CreateRouterInfoJob
CreateRouterInfoJob(RouterContext ctx, Job next) Creates a new CreateRouterInfoJob.- Parameters:
ctx- the router contextnext- the job to run after creation
Method Details
getName
runJob
public void runJob()Description copied from interface:JobActually 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.datfile format: This is the same "eepPriv.dat" format used by the client code, as documented in PrivateKeyFile.Old
router.keysfile 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.
- Returns:
- the created RouterInfo, or null on failure
getSigTypeConfig
The configured SigType to expect on read-in.- Parameters:
ctx- the router context- Returns:
- the configured signature type
getEncTypeConfig
The configured EncType to expect on read-in.- Parameters:
ctx- the router context- Returns:
- the configured encryption type
getCurrentPublishDate
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?- Parameters:
context- the router context- Returns:
- the current time as publish date