3 import businessLogic.SecurityManager;
7 private byte[] username;
8 private byte[] password;
12 private boolean admin = false;
15 public Account(String usr){
16 this.username = SecurityManager.getInstance().calculateHash(usr);
22 public Account(String usr, String pass, boolean isAdmin) {
23 this.username = SecurityManager.getInstance().calculateHash(usr);
24 this.salt = SecurityManager.getInstance().generateSalt();
25 this.password = SecurityManager.getInstance().calculateSaltedHash(pass.toCharArray(), this.salt);
31 public Account(String usr, String pass, Owner ow) {
32 this.username = SecurityManager.getInstance().calculateHash(usr);
33 this.salt = SecurityManager.getInstance().generateSalt();
34 this.password = SecurityManager.getInstance().calculateSaltedHash(pass.toCharArray(),
41 public byte[] getUsername() {
45 public byte[] getPassword() {
49 public Owner getOwner() {
53 public boolean getAdmin() {
57 public void setAdmin(boolean admin) {
61 public byte[] getSalt() {
65 public void setSalt(byte[] salt) {