|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.xml.ElementState
ecologylab.services.authentication.AuthenticationListEntry
public class AuthenticationListEntry
An entry for an AuthenticationList. Contains a username matched with a password (which is stored and checked as a SHA-256 hash). This class can be extended to include other pieces of information, such as real names and email addresses; if desired.
| Nested Class Summary |
|---|
| Field Summary |
|---|
| Fields inherited from class ecologylab.xml.ElementState |
|---|
CDATA, NORMAL, UTF16, UTF16_LE, UTF8 |
| Fields inherited from interface ecologylab.services.authentication.AuthLevels |
|---|
ADMINISTRATOR, NORMAL_USER |
| Fields inherited from interface ecologylab.xml.XMLTranslationExceptionTypes |
|---|
FILE_NOT_FOUND, IO_EXCEPTION, NULL_PURL, UNKNOWN |
| Constructor Summary | |
|---|---|
AuthenticationListEntry()
No-argument constructor for serialization. |
|
AuthenticationListEntry(java.lang.String username,
java.lang.String plaintextPassword)
Creates a new AuthenticationListEntry with the given username and password. |
|
| Method Summary | |
|---|---|
boolean |
compareHashedPassword(java.lang.String hashedPassword)
Compares the given hashed password (such as the kind from the getPassword() method) to the one contained in this object. |
boolean |
comparePassword(java.lang.String plaintextPassword)
Compares the given unhashed password against the one stored here by hashing it, then comparing it. |
int |
getLevel()
|
java.lang.String |
getUsername()
|
int |
hashCode()
Returns hashCode() called on username. |
java.lang.String |
key()
|
void |
setAndHashPassword(java.lang.String plaintextPassword)
Uses SHA-256 encryption to store the password passed to it. |
void |
setLevel(int level)
|
void |
setUsername(java.lang.String username)
Sets the username of the AuthenticationListEntry. |
java.lang.String |
toString()
|
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AuthenticationListEntry()
public AuthenticationListEntry(java.lang.String username,
java.lang.String plaintextPassword)
username - -
the name of the user.plaintextPassword - -
the password; will be hashed before it is stored.| Method Detail |
|---|
public void setUsername(java.lang.String username)
username - -
the username to set.public void setAndHashPassword(java.lang.String plaintextPassword)
plaintextPassword - -
the password to hash and store.public boolean compareHashedPassword(java.lang.String hashedPassword)
hashedPassword - -
the password to check.
public boolean comparePassword(java.lang.String plaintextPassword)
plaintextPassword - -
the unhashed password to check.
public java.lang.String getUsername()
public int hashCode()
hashCode in class java.lang.Objectpublic int getLevel()
public void setLevel(int level)
level - the level to setpublic java.lang.String toString()
toString in class DebugDebug.toString()public java.lang.String key()
key in interface Mappable<java.lang.String>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||