public void SaveAndEncrypt()
 {
     if (passwordManager.Passwords != null)
     {
         passwordManager.Encrypt();
         passwordManager.Save(PswFileName);
     }
 }
 public void CreateEncryptedFile(string login, string password)
 {
     passwordManager = new PasswordProvider(
         new Passwords(login, password,
                       Encoding.UTF8.GetString(CryptographyService.GenerateKey()),
                       Encoding.UTF8.GetString(CryptographyService.GenerateKey())));
     passwordManager.Encrypt();
     passwordManager.Save(PswFileName);
 }