DataStructurepublic class LeaseSet extends DatabaseEntry
| 修飾子とタイプ | フィールド | 説明 |
|---|---|---|
static int |
MAX_LEASES |
Unlimited before 0.6.3;
6 as of 0.6.3;
Increased in version 0.9.
|
_currentRoutingKey, _routingKeyGenMod, _signature, KEY_TYPE_LEASESET, KEY_TYPE_ROUTERINFO| コンストラクタ | 説明 |
|---|---|
LeaseSet() |
| 修飾子とタイプ | メソッド | 説明 |
|---|---|---|
void |
addLease(Lease lease) |
|
void |
encrypt(SessionKey key) |
Encrypt the gateway and tunnel ID of each lease, leaving the expire dates unchanged.
|
boolean |
equals(java.lang.Object object) |
|
protected byte[] |
getBytes() |
Returns the raw payload data, excluding the signature, to be signed by sign().
|
long |
getDate() |
Same as getEarliestLeaseDate()
|
Destination |
getDestination() |
|
long |
getEarliestLeaseDate() |
Retrieve the end date of the earliest lease included in this leaseSet.
|
PublicKey |
getEncryptionKey() |
|
KeysAndCert |
getKeysAndCert() |
Get the keys and the cert
Identical to getDestination() in LeaseSet,
and getIdentity() in RouterInfo.
|
long |
getLatestLeaseDate() |
Retrieve the end date of the latest lease included in this leaseSet.
|
Lease |
getLease(int index) |
|
int |
getLeaseCount() |
|
boolean |
getReceivedAsPublished() |
If true, we received this LeaseSet by a remote peer publishing it to
us, rather than by searching for it ourselves or locally creating it.
|
boolean |
getReceivedAsReply() |
If true, we received this LeaseSet by searching for it
Default false.
|
SigningPublicKey |
getSigningKey() |
推奨されていません。
unused
|
int |
getType() |
Get the type of the data structure.
|
int |
hashCode() |
the destination has enough randomness in it to use it by itself for speed
|
boolean |
isCurrent(long fudge) |
Determine whether ANY lease is currently valid, at least within a given
fudge factor
|
void |
readBytes(java.io.InputStream in) |
This does NOT validate the signature
|
void |
setDestination(Destination dest) |
|
void |
setEncryptionKey(PublicKey encryptionKey) |
|
void |
setReceivedAsPublished(boolean received) |
Default false
|
void |
setReceivedAsReply() |
set to true @since 0.7.14
|
void |
setSigningKey(SigningPublicKey key) |
The revocation key.
|
int |
size() |
Number of bytes, NOT including signature
|
java.lang.String |
toString() |
|
boolean |
verifySignature() |
Verify that the signature matches the lease set's destination's signing public key.
|
boolean |
verifySignature(SigningPublicKey signingKey) |
推奨されていません。
revocation unused
|
void |
writeBytes(java.io.OutputStream out) |
This does NOT validate the signature
|
getHash, getRoutingKey, getSignature, getSigningPublicKey, setSignature, sign, validateRoutingKeycalculateHash, fromBase64, fromByteArray, read, toBase64, toByteArraypublic static final int MAX_LEASES
public long getDate()
getDate クラス内 DatabaseEntrypublic KeysAndCert getKeysAndCert()
DatabaseEntrygetKeysAndCert クラス内 DatabaseEntrypublic int getType()
DatabaseEntrygetType クラス内 DatabaseEntrypublic Destination getDestination()
public void setDestination(Destination dest)
java.lang.IllegalStateException - if already signedpublic PublicKey getEncryptionKey()
public void setEncryptionKey(PublicKey encryptionKey)
java.lang.IllegalStateException - if already signed@Deprecated public SigningPublicKey getSigningKey()
public void setSigningKey(SigningPublicKey key)
java.lang.IllegalArgumentException - if different typepublic boolean getReceivedAsPublished()
public void setReceivedAsPublished(boolean received)
public boolean getReceivedAsReply()
public void setReceivedAsReply()
public void addLease(Lease lease)
java.lang.IllegalStateException - if already signedpublic int getLeaseCount()
public Lease getLease(int index)
public long getEarliestLeaseDate()
public long getLatestLeaseDate()
public boolean verifySignature()
verifySignature クラス内 DatabaseEntry@Deprecated public boolean verifySignature(SigningPublicKey signingKey)
public boolean isCurrent(long fudge)
fudge - milliseconds fudge factor to allow between the current timeprotected byte[] getBytes()
DatabaseEntrygetBytes クラス内 DatabaseEntrypublic void readBytes(java.io.InputStream in)
throws DataFormatException,
java.io.IOException
in - stream to read fromjava.lang.IllegalStateException - if called more than once or Destination already setDataFormatException - if the data is improperly formattedjava.io.IOException - if there was a problem reading the streampublic void writeBytes(java.io.OutputStream out)
throws DataFormatException,
java.io.IOException
out - stream to write toDataFormatException - if the data was incomplete or not yet ready to be writtenjava.io.IOException - if there was a problem writing to the streampublic int size()
public boolean equals(java.lang.Object object)
equals クラス内 java.lang.Objectpublic int hashCode()
hashCode クラス内 java.lang.Objectpublic java.lang.String toString()
toString クラス内 java.lang.Objectpublic void encrypt(SessionKey key)