I'm trying to encrypt a serialized XML document and store it in the registry. I was wondering on how to accomplish that? I am able to store a non-serialized XML document in the registry by converting the XMLdoc to a byte array, but I'm not sure on how to do it for a serialized XML.
My XML serialization example:
using System.Xml.Serialization;
namespace Common.XMLs
{
[XmlRoot("MyDatabase")]
public class MyDatabase
{
[XmlElement("Item")]
public Items[] Item;
}
public class Items
{
[XmlElement()]
public string Number;
[XmlElement()]
public string Revision;
[XmlElement()]
public string DateTimeSet;
[XmlElement()]
public string User;
}
}
From this, I would use the XML serialization and deserialization to read and write the file, except that this isn't going to a file, I need to encrypt it and store it in the registry.