public static Result Run(Window owner, Cryptor.Type type, bool encrypt) { var dialog = new EncryptDialog(type, encrypt) { Owner = owner }; if (!dialog.ShowDialog()) return null; return dialog.result; }
EncryptDialog(Cryptor.Type type, bool encrypt) { InitializeComponent(); this.type = type; this.encrypt = encrypt; }
public static Result Run(Window owner, Cryptor.Type type, bool sign) { var dialog = new SignVerifyDialog(type, sign) { Owner = owner }; if (!dialog.ShowDialog()) return null; return dialog.result; }
CryptorKeyDialog(Cryptor.Type type, bool encrypt) { InitializeComponent(); this.type = type; this.encrypt = encrypt; if (type.IsSymmetric()) { asymmetricKeyGrid.Visibility = Visibility.Collapsed; symmetricPassword.Focus(); } else { symmetricKeyGrid.Visibility = Visibility.Collapsed; asymmetricKeySize.Focus(); } IEnumerable<int> keySizes; int defaultSize; Cryptor.GetKeySizeInfo(type, out keySizes, out defaultSize); KeySizes = keySizes.ToList(); KeySize = defaultSize; Salt = "AWdSJ9hs72TXUUqaKpYIbU2v/YONdOxf"; }
SignVerifyDialog(Cryptor.Type type, bool sign) { this.type = type; this.sign = sign; InitializeComponent(); Hashes = type.SigningHashes().ToList(); Hash = Hashes.FirstOrDefault(); if (sign) signatureLabel.Visibility = signature.Visibility = Visibility.Collapsed; }