Пример #1
0
 private void EncryptData()
 {
     try
     {
         // put data into XML doc
         CreateXml();
         // encrypt data
         encryptedData =
             StringEncryptor.Encrypt(xmlCardData.OuterXml);
         // set encrypted flag
         isEncrypted = true;
     }
     catch
     {
         throw new SecureCardException("Unable to encrypt data.");
     }
 }
Пример #2
0
 private void DecryptData()
 {
     try
     {
         // decrypt data
         xmlCardData          = new XmlDocument();
         xmlCardData.InnerXml =
             StringEncryptor.Decrypt(encryptedData);
         // extract data from XML
         ExtractXml();
         // set decrypted flag
         isDecrypted = true;
     }
     catch
     {
         throw new SecureCardException("Unable to decrypt data.");
     }
 }