Exemple #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;
        }
Exemple #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);
        }
Exemple #3
0
        private void Generate()
        {
            int minQ = (int)sbMinQ.Value;
            int maxQ = (int)sbMaxQ.Value;

            Domain     = DomainParameters.GenerateDomainParameters(minQ, maxQ);
            generator  = new DSAKeyGenerator(Domain);
            PrivateKey = generator.PrivateKey;
            PublicKey  = generator.PublicKey;
        }
Exemple #4
0
        private void btnGenerateSchnorr_Click(object sender, EventArgs e)
        {
            domain  = DomainParameters.GenerateDomainParameters(100000, 999999);
            schnorr = new Schnorr(domain);

            tbP.Text = domain.P.ToString();
            tbQ.Text = domain.Q.ToString();
            tbH.Text = domain.H.ToString();
            tbG.Text = domain.G.ToString();
            tbT.Text = schnorr.T.ToString();

            ResetForm();
        }
Exemple #5
0
        private void btnGenerateSchnorr_Click(object sender, EventArgs e)
        {
            domain = DomainParameters.GenerateDomainParameters(100000, 999999);
            schnorr = new Schnorr(domain);

            tbP.Text = domain.P.ToString();
            tbQ.Text = domain.Q.ToString();
            tbH.Text = domain.H.ToString();
            tbG.Text = domain.G.ToString();
            tbT.Text = schnorr.T.ToString();

            ResetForm();
        }
Exemple #6
0
 public DSASigner(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain = domain;
 }
Exemple #7
0
 public DSAKeyGenerator(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain = domain;
     GenerateKeys();
 }
Exemple #8
0
 public DSAKeyGenerator(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain  = domain;
     GenerateKeys();
 }
Exemple #9
0
 public DSASigner(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain  = domain;
 }
Exemple #10
0
 public Schnorr(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain  = domain;
     T       = GenerateT();
 }
Exemple #11
0
 public Schnorr(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain = domain;
     T = GenerateT();
 }