java.lang.Object
net.i2p.i2pcontrol.security.AuthToken
Authentication token for I2PControl API access. Provides time-limited authentication tokens for secure API access.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SecurityManagerThe manager that issued this token.private final DateWhen the token stops being accepted.private static final ThreadLocal<DateFormat> Format for writing and reading the expiry date.private final StringIdentifies the user the token belongs to.(package private) static final intThe VALIDITY_TIME.Constructor Summary
ConstructorsConstructorDescriptionAuthToken(SecurityManager secMan, String password) Creates a token from a password hash.Method Summary
Field Details
VALIDITY_TIME
EXPIRY_FORMAT
Format for writing and reading the expiry date._secMan
The manager that issued this token.id
Identifies the user the token belongs to.expiry
When the token stops being accepted.
Constructor Details
AuthToken
Creates a token from a password hash.- Parameters:
secMan- the security managerpassword- the password to hash
Method Details
getId
isValid
public boolean isValid()Checks whether the AuthToken has expired.- Returns:
- True if AuthToken hasn't expired. False in any other case.
getExpiryTime
toString
hashCode
equals