public void Import ()
		{
			string encxml = new StreamReader ("Test/resources/rupert.crds").ReadToEnd ();
			string xml = new IdentityCardEncryption ().Decrypt (
				encxml, "monkeydance");
			XmlDocument doc = new XmlDocument ();
			doc.LoadXml (xml);
		}
Exemple #2
0
		protected IdentityCard ProcessImport (string filename, string password)
		{
			string xml = new IdentityCardEncryption ().Decrypt (
				new StreamReader (filename).ReadToEnd (), password);
			IdentityCard card = new IdentityCard ();
			card.Load (XmlReader.Create (new StringReader (xml)));
			return card;
		}
Exemple #3
0
        protected IdentityCard ProcessImport(string filename, string password)
        {
            string xml = new IdentityCardEncryption().Decrypt(
                new StreamReader(filename).ReadToEnd(), password);
            IdentityCard card = new IdentityCard();

            card.Load(XmlReader.Create(new StringReader(xml)));
            return(card);
        }
		public void Export ()
		{
			byte [] salt = Convert.FromBase64String ("ofkHGOy0pioOd7++N2a52w==");
			byte [] iv = Convert.FromBase64String ("OzFSoAlrfj11g246TM4How==");
			XmlDocument doc = new XmlDocument ();
			doc.Load ("Test/resources/rupert.xml");
			doc.RemoveChild (doc.FirstChild);
			byte [] result = new IdentityCardEncryption ().Encrypt (doc.OuterXml, "monkeydance", salt, iv);
			string resultText = Encoding.UTF8.GetString (result);

			string roundtrip = new IdentityCardEncryption ().Decrypt (resultText, "monkeydance");
			doc = new XmlDocument ();
			doc.LoadXml (roundtrip);
		}