EncryptDialog(Cryptor.Type type, bool encrypt) { InitializeComponent(); this.type = type; this.encrypt = encrypt; }
CryptorKeyDialog(Cryptor.Type type, bool encrypt) { InitializeComponent(); this.type = type; 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"; }
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; }
public static string Run(Window owner, Cryptor.Type type, bool encrypt) { var dialog = new CryptorKeyDialog(type, encrypt) { Owner = owner }; if (!dialog.ShowDialog()) { return(null); } return(dialog.result); }