Ejemplo n.º 1
0
        public static IPasswordInformation Load(this IPasswordInformation passwordInfo, string path)
        {
            using (var stream = new FileStream(path, FileMode.Open))
            {
                var result    = default(PasswordInformation);
                var formatter = new BinaryFormatter();

                stream.Position = 0;
                result          = formatter.Deserialize(stream) as PasswordInformation;
                stream.Close();

                return(result);
            }
        }
Ejemplo n.º 2
0
        public static void Create(this IPasswordInformation passwordInfo, string path, string password, uint hashIterations)
        {
            var result = new PasswordInformation(password, hashIterations);

            result.Save(path);
        }