Example #1
0
 public Credentials(Encryption encrypt, EncryptedCredentials encrypeted)
 {
     Id = encrypeted.Id;
     UserId = encrypeted.UserId;
     Website = encrypt.DecryptString(encrypeted.Website);
     Url = encrypt.DecryptString(encrypeted.Url);
     Username = encrypt.DecryptString(encrypeted.Username);
     Password = encrypt.DecryptString(encrypeted.Password);
     EmailAddress = encrypt.DecryptString(encrypeted.EmailAddress);
 }
 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);
 }