public EntityCredential(Encryption encrypt, Credentials creds) { Id = creds.Id; UserId = creds.UserId; Website = encrypt.EncryptToString(creds.Website); Url = encrypt.EncryptToString(creds.Url); Username = encrypt.EncryptToString(creds.Username); Password = encrypt.EncryptToString(creds.Password); Email = encrypt.EncryptToString(creds.EmailAddress); }
/// <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(); } }
private void SaveBtn_Click(object sender, EventArgs e) { var creds = new Credentials(websiteTextBox.Text, urlTextBox.Text, usernameTextBox.Text, passwordTextBox.Text, emailTextBox.Text); _myApp.CreateCredentials(creds); ClearDetails(); }
/// <summary> /// Method to set the current details object with new Credential's information /// </summary> /// <param name="creds">The credentials to be placed into details</param> public void SetDetails(Credentials creds) { Details = new Details(OnDetailsChanged); Details.Id = creds.Id; Details.UserId = creds.UserId; Details.Title = creds.Website; Details.Url = creds.Url; Details.Username = creds.Username; Details.Password = creds.Password; Details.Email = creds.EmailAddress; }
protected bool Equals(Credentials other) { return UserId == other.UserId && string.Equals(Website, other.Website) && string.Equals(Url, other.Url) && string.Equals(Username, other.Username) && string.Equals(Password, other.Password) && string.Equals(EmailAddress, other.EmailAddress); }
public int CreateCredentials(Credentials creds) { var credsSvc = GetService(Services.CredentialsData) as IPassOneDataSvc; credsSvc.Create(creds); return creds.Id; }