Beispiel #1
0
        public Signer GetSigner(Mode mode = Mode.Sign)
        {
            Signer result = null;
            String input = inputText.Text;

            switch (algorithmDrowdown.Text)
            {
                case "Цифровая подпись DSA":
                    if (dsaForm == null)
                    {
                        dsaForm = new DSAForm();
                    }
                    if (dsaForm.ShowDialog() == DialogResult.OK)
                    {
                        signKey = mode == Mode.Sign ? dsaForm.PrivateKey : dsaForm.PublicKey;
                        domain = dsaForm.Domain;
                        result = new DSASigner(dsaForm.Domain);
                    }
                    break;
                default:
                    throw new ArgumentException("Выберите метод подписи");
            }

            return result;
        }
Beispiel #2
0
        public Signer GetSigner(Mode mode = Mode.Sign)
        {
            Signer result = null;
            String input  = inputText.Text;

            switch (algorithmDrowdown.Text)
            {
            case "Цифровая подпись DSA":
                if (dsaForm == null)
                {
                    dsaForm = new DSAForm();
                }
                if (dsaForm.ShowDialog() == DialogResult.OK)
                {
                    signKey = mode == Mode.Sign ? dsaForm.PrivateKey : dsaForm.PublicKey;
                    domain  = dsaForm.Domain;
                    result  = new DSASigner(dsaForm.Domain);
                }
                break;

            default:
                throw new ArgumentException("Выберите метод подписи");
            }

            return(result);
        }