Пример #1
0
		EncryptDialog(Cryptor.Type type, bool encrypt)
		{
			InitializeComponent();

			this.type = type;
			this.encrypt = encrypt;
		}
Пример #2
0
        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";
        }
Пример #3
0
		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";
		}
Пример #4
0
		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;
		}
Пример #5
0
        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);
        }