public class RouterKeyGenerator
extends net.i2p.data.RoutingKeyGenerator
| Constructor and Description |
|---|
RouterKeyGenerator(net.i2p.I2PAppContext context) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
generateDateBasedModData()
Update the current modifier data with some bytes derived from the current
date (yyyyMMdd in GMT)
|
long |
getLastChanged() |
byte[] |
getModData()
The current (today's) mod data.
|
byte[] |
getNextModData()
Tomorrow's mod data.
|
net.i2p.data.Hash |
getNextRoutingKey(net.i2p.data.Hash origKey)
Get the routing key using tomorrow's modData, not today's
|
net.i2p.data.Hash |
getRoutingKey(net.i2p.data.Hash origKey)
Generate a modified (yet consistent) hash from the origKey by generating the
SHA256 of the targetKey with the current modData appended to it
This makes Sybil's job a lot harder, as she needs to essentially take over the
whole keyspace.
|
net.i2p.data.Hash |
getRoutingKey(net.i2p.data.Hash origKey,
long time)
Get the routing key for the specified date, not today's
|
long |
getTimeTillMidnight()
How long until midnight (ms)
|
static void |
main(String[] args) |
public byte[] getModData()
public byte[] getNextModData()
public long getLastChanged()
getLastChanged in class net.i2p.data.RoutingKeyGeneratorpublic long getTimeTillMidnight()
public boolean generateDateBasedModData()
public net.i2p.data.Hash getRoutingKey(net.i2p.data.Hash origKey)
getRoutingKey in class net.i2p.data.RoutingKeyGeneratorIllegalArgumentException - if origKey is nullpublic net.i2p.data.Hash getNextRoutingKey(net.i2p.data.Hash origKey)
public net.i2p.data.Hash getRoutingKey(net.i2p.data.Hash origKey,
long time)
time - Java timepublic static void main(String[] args)