-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypeablePasswordConfig.cs
57 lines (47 loc) · 1.37 KB
/
TypeablePasswordConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using KeePassLib.Utility;
using KeePassLib.Cryptography.PasswordGenerator;
namespace TypeablePasswordGenerator
{
public class TypeablePasswordConfig
{
public List<string> l_charsets;
public List<char> l_separators;
public int i_password_length;
public int i_min_sep_lenght;
public int i_max_sep_lenght;
public bool b_remove_separator;
/// <summary>
/// Empty constructor, use default values
/// </summary>
public TypeablePasswordConfig()
{
l_charsets = new List<string>();
l_separators = new List<char>();
l_charsets.Add(PwCharSet.UpperCase);
l_charsets.Add(PwCharSet.LowerCase);
l_charsets.Add(PwCharSet.Digits);
l_charsets.Add("#@$()&_=+-?!/%:'\" *");
l_charsets.Add("£€¥¢©®™~¿[] {} <>^¡`;÷\\|¦¬×§¶°");
l_separators.Add(' ');
l_separators.Add('.');
l_separators.Add('-');
l_separators.Add('_');
i_password_length = 50;
i_min_sep_lenght = 2;
i_max_sep_lenght = 3;
b_remove_separator = true;
}
public static TypeablePasswordConfig FromFile(System.IO.Stream input_file)
{
return XmlUtilEx.Deserialize<TypeablePasswordConfig>(input_file);
}
public void ToFile(System.IO.Stream output_file)
{
XmlUtilEx.Serialize(output_file, this);
}
}
}