Exemplo n.º 1
0
 public EntityUser(User user)
 {
     Id = user.Id;
     FirstName = user.FirstName;
     LastName = user.LastName;
     Username = user.Username;
     Password = user.Password;
     k = user.K;
     v = user.V;
 }
 /// <summary>
 /// Method for updating the contents of a saved set of credentials
 /// </summary>
 /// <param name="user">The user whose list contains the credentials in question</param>
 /// <param name="creds">The credentials to be updated</param>
 /// <param name="path">The directory path to where the app can find the PassOne data files</param>
 public void UpdateCredentials(User user, Credentials creds)
 {
     try
     {
         GetService().Edit(creds);
     }
     catch (CryptographicException)
     {
         throw new EncryptionException();
     }
 }
 /// <summary>
 /// Method for deleting a credentials entry
 /// </summary>
 /// <param name="creds">The credentials to be deleted</param>
 /// <param name="user">The user whose list contains the credentials in question</param>
 /// <param name="path">The directory path to where the app can find the PassOne data files</param>
 public void DeleteCredentials(Credentials creds, User user)
 {
     try
     {
         GetService().Delete(creds);
     }
     catch (CryptographicException)
     {
         throw new EncryptionException();
     }
 }
Exemplo n.º 4
0
 public PassOneModel(User user, Dictionary<string, int> dictionary)
 {
     _user = user;
        CredentialsList = dictionary;
        Details = new Details(OnDetailsChanged);
 }
 private User ConvertToEntity(PassOneObject obj)
 {
     var user = (PassOneUser) obj;
     var newUser = new User
         {
             Id = user.Id,
             FirstName = user.FirstName,
             LastName = user.LastName,
             Username = user.Username,
             Password = user.Password,
             k = user.K,
             v = user.V
         };
     return newUser;
 }
 private PassOneUser ConvertToDomainObject(User entity)
 {
     return new PassOneUser(entity.Id, entity.FirstName, entity.LastName, entity.Username, entity.Password, entity.k, entity.v);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Method to update user information contained in the user.bin file
 /// </summary>
 /// <param name="user">The new user data</param>
 /// <param name="path">The directory path to where the app can find the PassOne data files</param>
 public void UpdateUser(User user)
 {
     GetService().Edit(user);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Method to create a new user in the user.bin file, takes a preconstructed User object
 /// </summary>
 /// <param name="user">The user to be created</param>
 /// <param name="path">The directory path to where the app can find the PassOne data files</param>
 public void CreateUser(User user)
 {
     GetService().Create(user);
 }
Exemplo n.º 9
0
 protected bool Equals(User other)
 {
     return string.Equals(FirstName, other.FirstName) && string.Equals(LastName, other.LastName) && string.Equals(Username, other.Username) && string.Equals(Password, other.Password) && Equals(K, other.K) && Equals(V, other.V);
 }
 private Credentials ConvertToDomainObject(User user, EntityCredential entity)
 {
     var encrypted = new EncryptedCredentials()
         {
             Id = entity.Id,
             UserId = entity.UserId,
             Website = entity.Website,
             Url = entity.Url,
             Username = entity.Username,
             EmailAddress = entity.Email,
             Password = entity.Password
         };
     return new Credentials(new Encryption(user.K, user.V), encrypted);
 }