|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.guess.QueryKey
Abstraction for a Query Key as detailed in the GUESS protocol spec. Provides: - encapsulation of (all, LW and non-LW) Query Keys - generation of Query Keys (hence, it contains the LimeWire QK Algorithm) A Query Key is a credential necessary to perform a GUESS Query. A Query Key instance is immutable. If you want to change the underlying generation algorithm, you need to change getQueryKey(ip, port, ....) and the two Secret inner classes (SecretKey and SecretPad).
Nested Class Summary | |
static class |
QueryKey.SecretKey
The Key used in generating a QueryKey. |
static class |
QueryKey.SecretPad
Depending on the algorithm, this may be needed to derive a QueryKey (in addition to a SecretKey). |
Field Summary | |
int |
MAX_QK_SIZE_IN_BYTES
As detailed by the GUESS spec. |
int |
MIN_QK_SIZE_IN_BYTES
As detailed by the GUESS spec. |
Method Summary | |
boolean |
equals(java.lang.Object o)
|
static QueryKey.SecretKey |
generateSecretKey()
Returns a new SecretKey to be used in generation of QueryKeys. |
static QueryKey.SecretPad |
generateSecretPad()
Returns a new SecretPad to be used in generation of QueryKeys. |
static QueryKey |
getQueryKey(byte[] networkQK,
boolean prepareForNet)
Use this method to construct Query Keys that you get from network commerce. |
static QueryKey |
getQueryKey(java.net.InetAddress ip,
int port)
Generates a QueryKey for a given IP:Port combo. |
static QueryKey |
getQueryKey(java.net.InetAddress ip,
int port,
QueryKey.SecretKey secretKey,
QueryKey.SecretPad secretPad)
Generates a QueryKey for a given IP:Port combo. |
int |
hashCode()
|
void |
prepareForNetwork()
QueryKey's not generated by the static method getQueryKey(4) may not be prepared for network transport. |
java.lang.String |
toString()
Returns a String with the QueryKey represented as a BigInteger. |
void |
write(java.io.OutputStream out)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public final int MIN_QK_SIZE_IN_BYTES
public final int MAX_QK_SIZE_IN_BYTES
Method Detail |
public void prepareForNetwork()
public static QueryKey.SecretKey generateSecretKey()
public static QueryKey.SecretPad generateSecretPad()
public boolean equals(java.lang.Object o)
public int hashCode()
public void write(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
public static QueryKey getQueryKey(byte[] networkQK, boolean prepareForNet) throws java.lang.IllegalArgumentException
networkQK
- the bytes you want to make a QueryKey.prepareForNet
- true to prepare the QueryKey for net transport.
java.lang.IllegalArgumentException
public static QueryKey getQueryKey(java.net.InetAddress ip, int port)
ip
- the IP address of the other nodeport
- the port of the other nodepublic static QueryKey getQueryKey(java.net.InetAddress ip, int port, QueryKey.SecretKey secretKey, QueryKey.SecretPad secretPad)
ip
- the IP address of the other nodeport
- the port of the other node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |