Class BlindCache
java.lang.Object
net.i2p.router.networkdb.kademlia.BlindCache
Cache of blinding data. See proposal 123.
- Since:
- 0.9.40
-
Constructor Summary
ConstructorsConstructorDescriptionBlindCache(RouterContext ctx) Caller MUST call startup() to load persistent cache from disk -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCache(BlindData bd) Persists immediately if secret or privkey is non-nullgetBlindedHash(Destination dest) The hash to lookup for a dest.The hash to lookup for a SPK known to be blinded.getData()For console ConfigKeyringHelpergetData(Destination dest) The cached data or nullgetData(SigningPublicKey spk) The cached data or nullgetHash(Destination dest) The hash to lookup for a dest.The hash to lookup for a dest hash.The cached data or nullbooleanFor console ConfigKeyringHelper.voidrollover()Refresh all the data at midnightvoidsetBlinded(Destination dest) Add the destination to the cache entry.voidsetBlinded(Destination dest, SigType blindedType, String secret) Mark a destination as known to be blindedvoidshutdown()May be restarted by calling startup() again.voidstartup()
-
Constructor Details
-
BlindCache
Caller MUST call startup() to load persistent cache from disk
-
-
Method Details
-
shutdown
public void shutdown()May be restarted by calling startup() again. -
startup
public void startup() -
getHash
The hash to lookup for a dest. If known to be blinded, returns the current blinded hash. If not known to be blinded, returns the standard dest hash.- Parameters:
dest- may or may not be blinded- Returns:
- the unblinded or blinded hash
-
getHash
The hash to lookup for a dest hash. If known to be blinded, returns the current blinded hash. If not known to be blinded, returns h.- Parameters:
h- may or may not be blinded- Returns:
- the blinded hash or h
-
getBlindedHash
The hash to lookup for a dest. If known to be blinded, returns the current blinded hash. If not known to be blinded, returns null.- Parameters:
dest- may or may not be blinded- Returns:
- the blinded hash or null if not blinded
-
getBlindedHash
The hash to lookup for a SPK known to be blinded. Default blinded type assumed. Secret assumed null.- Parameters:
spk- known to be blinded- Returns:
- the blinded hash
- Throws:
IllegalArgumentException- on various errors
-
setBlinded
Mark a destination as known to be blinded- Parameters:
dest- known to be blindedblindedType- null for defaultsecret- may be null- Throws:
IllegalArgumentException- on various errors
-
setBlinded
Add the destination to the cache entry. Must previously be in cache.- Parameters:
dest- known to be blinded- Throws:
IllegalArgumentException- on various errors
-
addToCache
Persists immediately if secret or privkey is non-null -
getData
The cached data or null -
getData
The cached data or null- Parameters:
spk- the unblinded public key
-
getReverseData
The cached data or null- Parameters:
spk- the blinded public key
-
rollover
public void rollover()Refresh all the data at midnight -
getData
For console ConfigKeyringHelper- Returns:
- list is copied
- Since:
- 0.9.41
-
removeBlindData
For console ConfigKeyringHelper. Persists immediately if removed.- Parameters:
spk- the unblinded public key- Returns:
- true if removed
- Since:
- 0.9.41
-