class BlindCache extends Object
Constructor and Description |
---|
BlindCache(RouterContext ctx)
Caller MUST call startup() to load persistent cache from disk
|
Modifier and Type | Method and Description |
---|---|
void |
addToCache(BlindData bd)
Persists immediately if secret or privkey is non-null
|
Hash |
getBlindedHash(Destination dest)
The hash to lookup for a dest.
|
Hash |
getBlindedHash(SigningPublicKey spk)
The hash to lookup for a SPK known to be blinded.
|
List<BlindData> |
getData()
For console ConfigKeyringHelper
|
BlindData |
getData(Destination dest)
The cached data or null
|
BlindData |
getData(SigningPublicKey spk)
The cached data or null
|
Hash |
getHash(Destination dest)
The hash to lookup for a dest.
|
Hash |
getHash(Hash h)
The hash to lookup for a dest hash.
|
BlindData |
getReverseData(SigningPublicKey spk)
The cached data or null
|
boolean |
removeBlindData(SigningPublicKey spk)
For console ConfigKeyringHelper.
|
void |
rollover()
Refresh all the data at midnight
|
void |
setBlinded(Destination dest)
Add the destination to the cache entry.
|
void |
setBlinded(Destination dest,
SigType blindedType,
String secret)
Mark a destination as known to be blinded
|
void |
shutdown()
May be restarted by calling startup() again.
|
void |
startup() |
public BlindCache(RouterContext ctx)
public void shutdown()
public void startup()
public Hash getHash(Destination dest)
dest
- may or may not be blindedpublic Hash getHash(Hash h)
h
- may or may not be blindedpublic Hash getBlindedHash(Destination dest)
dest
- may or may not be blindedpublic Hash getBlindedHash(SigningPublicKey spk)
spk
- known to be blindedIllegalArgumentException
- on various errorspublic void setBlinded(Destination dest, SigType blindedType, String secret)
dest
- known to be blindedblindedType
- null for defaultsecret
- may be nullIllegalArgumentException
- on various errorspublic void setBlinded(Destination dest)
dest
- known to be blindedIllegalArgumentException
- on various errorspublic void addToCache(BlindData bd)
public BlindData getData(Destination dest)
public BlindData getData(SigningPublicKey spk)
spk
- the unblinded public keypublic BlindData getReverseData(SigningPublicKey spk)
spk
- the blinded public keypublic void rollover()
public List<BlindData> getData()
public boolean removeBlindData(SigningPublicKey spk)
spk
- the unblinded public key