public class RouterKeyGenerator extends RoutingKeyGenerator
コンストラクタ | 説明 |
---|---|
RouterKeyGenerator(I2PAppContext context) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
boolean |
generateDateBasedModData() |
Update the current modifier data with some bytes derived from the current
date (yyyyMMdd in GMT)
|
long |
getLastChanged() |
The version of the current (today's) mod data.
|
byte[] |
getModData() |
The current (today's) mod data.
|
byte[] |
getNextModData() |
Tomorrow's mod data.
|
Hash |
getNextRoutingKey(Hash origKey) |
Get the routing key using tomorrow's modData, not today's
|
Hash |
getRoutingKey(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.
|
Hash |
getRoutingKey(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(java.lang.String[] args) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInstance
public RouterKeyGenerator(I2PAppContext context)
public byte[] getModData()
public byte[] getNextModData()
public long getLastChanged()
RoutingKeyGenerator
getLastChanged
クラス内 RoutingKeyGenerator
public long getTimeTillMidnight()
public boolean generateDateBasedModData()
public Hash getRoutingKey(Hash origKey)
getRoutingKey
クラス内 RoutingKeyGenerator
java.lang.IllegalArgumentException
- if origKey is nullpublic Hash getNextRoutingKey(Hash origKey)
public Hash getRoutingKey(Hash origKey, long time)
time
- Java timepublic static void main(java.lang.String[] args)