public final class PasswordService extends Object
| Constructor and Description |
|---|
PasswordService()
Create an instance of PasswordService
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(User user) |
boolean |
authenticate(String username,
String pass)
Take a user name and unencrypted password and compare it to an
existing collection of users with encrypted passwords.
|
String |
encrypt(String plaintext)
Encrypts a string with a deterministic algorithm.
|
static PasswordService |
getInstance() |
User |
getUser(String username) |
static void |
main(String[] args) |
void |
updateUser(User user) |
boolean |
userExists(String username) |
void |
writeUserFile() |
public static PasswordService getInstance()
public boolean authenticate(String username, String pass)
public void writeUserFile()
throws IOException
IOExceptionpublic boolean userExists(String username)
public void updateUser(User user)
public void addUser(User user)
public static void main(String[] args)
Copyright © 2015. All rights reserved.