|
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
public abstract class AbstractSecurityToken
Implements a security token that can write itself to an output stream and queries for its validity.
Subclasses must implement
getFromMAC(byte[], org.limewire.security.SecurityToken.TokenData).
getFromMAC returns the payload of
the security token as it will appear on the network.
See message authentication code, MAC, for more information.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.limewire.security.SecurityToken |
|---|
SecurityToken.AddressSecurityTokenProvider, SecurityToken.TokenData, SecurityToken.TokenProvider |
| Constructor Summary | |
|---|---|
protected |
AbstractSecurityToken(byte[] network,
MACCalculatorRepositoryManager mgr)
|
protected |
AbstractSecurityToken(SecurityToken.TokenData data,
MACCalculatorRepositoryManager mgr)
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Should not be used if it is possible to call isFor(org.limewire.security.SecurityToken.TokenData) which
takes all possible MACCalculatorRepositories
into account. |
byte[] |
getBytes()
Returns the SecurityToken as byte array. |
protected abstract byte[] |
getFromMAC(byte[] MAC,
SecurityToken.TokenData data)
|
int |
hashCode()
|
boolean |
isFor(SecurityToken.TokenData data)
Validates that a SecurityToken was generated for the given
TokenData. |
protected boolean |
isValidBytes(byte[] network)
Determines if the given data bytes are valid. |
protected boolean |
isValidTokenData(SecurityToken.TokenData data)
Determines if the given TokenData is valid for this
SecurityToken. |
void |
write(OutputStream os)
Writes the SecurityToken to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractSecurityToken(SecurityToken.TokenData data,
MACCalculatorRepositoryManager mgr)
protected AbstractSecurityToken(byte[] network,
MACCalculatorRepositoryManager mgr)
throws InvalidSecurityTokenException
InvalidSecurityTokenException| Method Detail |
|---|
public final boolean isFor(SecurityToken.TokenData data)
SecurityTokenSecurityToken was generated for the given
TokenData.
isFor in interface SecurityTokenprotected boolean isValidTokenData(SecurityToken.TokenData data)
TokenData is valid for this
SecurityToken. By default, all TokenDatas are
valid.
public final void write(OutputStream os)
throws IOException
SecurityTokenSecurityToken to the output stream.
write in interface SecurityTokenIOExceptionpublic final byte[] getBytes()
SecurityTokenSecurityToken as byte array.
getBytes in interface SecurityToken
protected abstract byte[] getFromMAC(byte[] MAC,
SecurityToken.TokenData data)
MAC - the calculated cryptographic MACdata - the TokenData this security token is created from.
protected boolean isValidBytes(byte[] network)
public boolean equals(Object obj)
isFor(org.limewire.security.SecurityToken.TokenData) which
takes all possible MACCalculatorRepositories
into account.
equals in class Objectpublic int hashCode()
hashCode in class Object
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||