|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.security.AbstractSecurityToken
org.limewire.security.AddressSecurityToken
public final class AddressSecurityToken
A token that embeds an IP address and port, allowing one side to generate a token for a specific IP address/port pair that cannot be easily guessed.
| Nested Class Summary | |
|---|---|
static class |
AddressSecurityToken.AddressTokenData
Converts the IP address and port into an encrypted byte[]. |
| Nested classes/interfaces inherited from interface org.limewire.security.SecurityToken |
|---|
SecurityToken.AddressSecurityTokenProvider, SecurityToken.TokenData, SecurityToken.TokenProvider |
| Field Summary | |
|---|---|
static int |
MAX_QK_SIZE_IN_BYTES
As detailed by the GUESS specification. |
static int |
MIN_QK_SIZE_IN_BYTES
As detailed by the GUESS specification ( Gnutella UDP Extension for Scalable Searches ). |
| Constructor Summary | |
|---|---|
AddressSecurityToken(AddressSecurityToken.AddressTokenData data,
MACCalculatorRepositoryManager mgr)
|
|
AddressSecurityToken(byte[] key,
MACCalculatorRepositoryManager mgr)
|
|
AddressSecurityToken(InetAddress ip,
int port,
MACCalculatorRepositoryManager mgr)
Generates an AddressSecurityToken for a given IP:Port combo. |
|
AddressSecurityToken(SocketAddress address,
MACCalculatorRepositoryManager mgr)
Generates a AddressSecurityToken for a given
SocketAddress. |
|
| Method Summary | |
|---|---|
protected byte[] |
getFromMAC(byte[] key,
SecurityToken.TokenData ignored)
|
int |
hashCode()
|
boolean |
isFor(InetAddress ip,
int port)
|
boolean |
isFor(SocketAddress address)
|
protected boolean |
isValidBytes(byte[] key)
Determines if the given data bytes are valid. |
static boolean |
isValidSecurityTokenBytes(byte[] key)
Determines if the bytes are valid for a key. |
String |
toString()
Returns a String with the AddressSecurityToken represented
in hexadecimal. |
| Methods inherited from class org.limewire.security.AbstractSecurityToken |
|---|
equals, getBytes, isFor, isValidTokenData, write |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MIN_QK_SIZE_IN_BYTES
public static final int MAX_QK_SIZE_IN_BYTES
| Constructor Detail |
|---|
public AddressSecurityToken(SocketAddress address,
MACCalculatorRepositoryManager mgr)
AddressSecurityToken for a given
SocketAddress. For a given SocketAddress,
using a different SecretKey and/or SecretPad will result in a different
AddressSecurityToken.
public AddressSecurityToken(InetAddress ip,
int port,
MACCalculatorRepositoryManager mgr)
AddressSecurityToken for a given IP:Port combo.
For a given IP:Port combo, using a different SecretKey and/or SecretPad
will result in a different AddressSecurityToken.
ip - the IP address of the other nodeport - the port of the other node
public AddressSecurityToken(AddressSecurityToken.AddressTokenData data,
MACCalculatorRepositoryManager mgr)
public AddressSecurityToken(byte[] key,
MACCalculatorRepositoryManager mgr)
throws InvalidSecurityTokenException
InvalidSecurityTokenException| Method Detail |
|---|
protected byte[] getFromMAC(byte[] key,
SecurityToken.TokenData ignored)
getFromMAC in class AbstractSecurityTokenkey - the calculated cryptographic MACignored - the TokenData this security token is created from.
public boolean isFor(SocketAddress address)
public boolean isFor(InetAddress ip,
int port)
public int hashCode()
hashCode in class AbstractSecurityTokenpublic String toString()
AddressSecurityToken represented
in hexadecimal.
toString in class Objectpublic static boolean isValidSecurityTokenBytes(byte[] key)
key.
protected boolean isValidBytes(byte[] key)
AbstractSecurityToken
isValidBytes in class AbstractSecurityToken
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||