Example #1
0
 public Usuario(string _cuenta, string _nombre, string _apellidos, string _eMail, int _rol)
 {
     Cuenta    = _cuenta;
     Nombre    = _nombre;
     Apellidos = _apellidos;
     Email     = _eMail;
     Rol       = _rol;
     Salt      = CryptoTools.GenerateSalt();
     Password  = CryptoTools.GenerateHash(DefaultPassword, Salt);
 }
Example #2
0
 public int CambiaPassword(string anteriorPassword, string nuevaPassword)
 {
     if (CompruebaPassword(anteriorPassword) && RequisitosPW(nuevaPassword, Cuenta))
     {
         Password = CryptoTools.GenerateHash(nuevaPassword, Salt);
         return(0);
     }
     else
     {
         return(1);
     }
 }
Example #3
0
 public bool CompruebaPassword(string password)
 {
     return(CryptoTools.ValidateHash(password, Password, Salt));
 }
Example #4
0
 public string ResetPassword()
 {
     Password = CryptoTools.GenerateHash(DefaultPassword, Salt);
     return(DefaultPassword);
 }
Example #5
0
 public Usuario(string _cuenta)
 {
     Cuenta   = _cuenta;
     Salt     = CryptoTools.GenerateSalt();
     Password = CryptoTools.GenerateHash(DefaultPassword, Salt);
 }
Example #6
0
 public Usuario()
 {
     Salt     = CryptoTools.GenerateSalt();
     Password = CryptoTools.GenerateHash(DefaultPassword, Salt);
 }