-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SymmetricKeyControl.xaml.cs
70 lines (56 loc) · 2.78 KB
/
SymmetricKeyControl.xaml.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
58
59
60
61
62
63
64
65
66
67
68
69
70
using System.Windows;
using System.Windows.Controls;
using System.Collections.ObjectModel;
namespace Leosac.KeyManager.Library.UI
{
/// <summary>
/// Interaction logic for SymmetricKeyControl.xaml
/// </summary>
public partial class SymmetricKeyControl : UserControl
{
public SymmetricKeyControl()
{
InitializeComponent();
Key = new KeyManager.Library.Key();
KeyChecksumAlgorithms.Add(new KeyGen.CRC32Checksum());
KeyChecksumAlgorithms.Add(new KeyGen.KCV());
KeyChecksumAlgorithms.Add(new KeyGen.Sha256Checksum());
SelectedKeyChecksumAlgorithm = KeyChecksumAlgorithms[0];
}
public Key Key
{
get { return (Key)GetValue(KeyProperty); }
set { SetValue(KeyProperty, value); }
}
public static readonly DependencyProperty KeyProperty = DependencyProperty.Register(nameof(Key), typeof(Key), typeof(SymmetricKeyControl),
new FrameworkPropertyMetadata());
public KeyGen.KeyChecksum SelectedKeyChecksumAlgorithm
{
get { return (KeyGen.KeyChecksum)GetValue(SelectedKeyChecksumAlgorithmProperty); }
set { SetValue(SelectedKeyChecksumAlgorithmProperty, value); }
}
public static readonly DependencyProperty SelectedKeyChecksumAlgorithmProperty = DependencyProperty.Register(nameof(SelectedKeyChecksumAlgorithm), typeof(KeyManager.Library.KeyGen.KeyChecksum), typeof(SymmetricKeyControl));
public string? KeyChecksumIV
{
get { return (string)GetValue(KeyChecksumIVProperty); }
set { SetValue(KeyChecksumIVProperty, value); }
}
public static readonly DependencyProperty KeyChecksumIVProperty = DependencyProperty.Register(nameof(KeyChecksumIV), typeof(string), typeof(SymmetricKeyControl),
new FrameworkPropertyMetadata(""));
public bool ShowKCV
{
get { return (bool)GetValue(ShowKCVProperty); }
set { SetValue(ShowKCVProperty, value); }
}
public static readonly DependencyProperty ShowKCVProperty = DependencyProperty.Register(nameof(ShowKCV), typeof(bool), typeof(SymmetricKeyControl),
new FrameworkPropertyMetadata(true));
public bool ShowKeyLink
{
get { return (bool)GetValue(ShowKeyLinkProperty); }
set { SetValue(ShowKeyLinkProperty, value); }
}
public static readonly DependencyProperty ShowKeyLinkProperty = DependencyProperty.Register(nameof(ShowKeyLink), typeof(bool), typeof(SymmetricKeyControl),
new FrameworkPropertyMetadata(true));
public ObservableCollection<KeyGen.KeyChecksum> KeyChecksumAlgorithms { get; set; } = new ObservableCollection<KeyGen.KeyChecksum>();
}
}