Beispiel #1
0
        public override void SaveAs(string path)
        {
            using (MemoryStream ms = new MemoryStream())
            {
                XmlSerializer s = new XmlSerializer(this.GetType());
                Encode(this);
                s.Serialize(ms, this);
                Decode(this);

                Byte[] file = ms.ToArray();
                ms.Close();
                file = RijndaelSimple.EncryptFile(file, password, saltValue, AesHashType.MD5.ToString(), passwordIterations, initVector, (int)AesKeySize.Size128);

                FileStream fs = new FileStream(path, FileMode.CreateNew);
                fs.Write(file, 0, file.Length);
                fs.Close();
            }
        }