Chat applikasjon
|
Public Member Functions | |
List< User > | getUsers () |
User | getUserByUsername (String username) |
User | addUser (User user) throws NoSuchAlgorithmException, InvalidKeySpecException |
byte[] | generateSalt () |
String | hashPassword (String password, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException |
boolean | editUser (int userId, String username, String password) throws NoSuchAlgorithmException, InvalidKeySpecException |
Data access object for User
|
inline |
Adds a new user to database with default ID
user | User object |
|
inline |
Edits the users username or password
userId | userId as int |
username | Username as String |
password | password as String, if null it should not be updated |
|
inline |
Generates a salt, for hashing
|
inline |
Returns a User object for given username
username | Username as String |
|
inline |
Returns a List of all registered users
|
inline |
Method to hash a password with salt
password | password to be hashed |
salt | salt to use when hashing |