Exemplo n.º 1
0
        private static List <Email> DecryptEmails(List <Email> encryptedEmails)
        {
            List <Email> decryptedEmails = new List <Email>();

            foreach (Email encryptedEmail in encryptedEmails)
            {
                Email decryptedEmail = new Email(encryptedEmail.Unread, encryptedEmail.From, encryptedEmail.Subject,
                                                 encryptedEmail.Date, encryptedEmail.Body, encryptedEmail.UId);
                decryptedEmail.From    = EncryptService.Decrypt(encryptedEmail.From);
                decryptedEmail.Subject = EncryptService.Decrypt(encryptedEmail.Subject);
                decryptedEmail.Body    = EncryptService.Decrypt(encryptedEmail.Body);
                decryptedEmails.Add(decryptedEmail);
            }

            return(decryptedEmails);
        }
Exemplo n.º 2
0
        private static List <Email> EncryptEmails(List <Email> unencryptedEmails)
        {
            List <Email> encryptedEmails = new List <Email>();

            foreach (Email unencryptedEmail in unencryptedEmails)
            {
                Email encryptedEmail = new Email(unencryptedEmail.Unread, unencryptedEmail.From,
                                                 unencryptedEmail.Subject, unencryptedEmail.Date, unencryptedEmail.Body, unencryptedEmail.UId);
                encryptedEmail.From    = EncryptService.Encrypt(unencryptedEmail.From);
                encryptedEmail.Subject = EncryptService.Encrypt(unencryptedEmail.Subject);
                encryptedEmail.Body    = EncryptService.Encrypt(unencryptedEmail.From);
                encryptedEmails.Add(encryptedEmail);
            }

            return(encryptedEmails);
        }