net.i2p.data
public abstract class DatabaseEntry extends DataStructureImpl
Modifier and Type | Field and Description |
---|---|
protected Hash |
_currentRoutingKey |
protected byte[] |
_routingKeyGenMod |
protected Signature |
_signature |
static int |
KEY_TYPE_LEASESET |
static int |
KEY_TYPE_ROUTERINFO
these are the same as in i2np's DatabaseStoreMessage
|
Constructor and Description |
---|
DatabaseEntry() |
Modifier and Type | Method and Description |
---|---|
protected abstract byte[] |
getBytes()
Returns the raw payload data, excluding the signature, to be signed by sign().
|
abstract long |
getDate()
A common interface to the timestamp of the two subclasses.
|
Hash |
getHash()
A common interface to the Hash of the two subclasses.
|
protected abstract KeysAndCert |
getKeysAndCert()
Get the keys and the cert
Identical to getDestination() in LeaseSet,
and getIdentity() in RouterInfo.
|
Hash |
getRoutingKey()
Get the routing key for the structure using the current modifier in the RoutingKeyGenerator.
|
Signature |
getSignature()
Retrieve the proof that the identity stands behind the info here
|
protected SigningPublicKey |
getSigningPublicKey()
Identical to getDestination().getSigningPublicKey() in LeaseSet,
and getIdentity().getSigningPublicKey() in RouterInfo.
|
abstract int |
getType()
Get the type of the data structure.
|
void |
setRoutingKey(Hash key) |
void |
setSignature(Signature signature)
Configure the proof that the entity stands behind the info here
|
void |
sign(SigningPrivateKey key)
Sign the structure using the supplied signing key
|
boolean |
validateRoutingKey() |
protected boolean |
verifySignature()
This is the same as isValid() in RouterInfo
or verifySignature() in LeaseSet.
|
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readBytes, writeBytes
public static final int KEY_TYPE_ROUTERINFO
public static final int KEY_TYPE_LEASESET
protected volatile Signature _signature
protected volatile Hash _currentRoutingKey
protected volatile byte[] _routingKeyGenMod
public abstract long getDate()
protected abstract KeysAndCert getKeysAndCert()
public Hash getHash()
public abstract int getType()
protected abstract byte[] getBytes() throws DataFormatException
DataFormatException
public Hash getRoutingKey()
public void setRoutingKey(Hash key)
public boolean validateRoutingKey()
public Signature getSignature()
public void setSignature(Signature signature)
public void sign(SigningPrivateKey key) throws DataFormatException
DataFormatException
protected SigningPublicKey getSigningPublicKey()
protected boolean verifySignature()