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);
        }
Beispiel #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;
        }
Beispiel #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();
        }
Beispiel #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();
        }
Beispiel #6
0
 public DSASigner(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain = domain;
 }
Beispiel #7
0
 public DSAKeyGenerator(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain = domain;
     GenerateKeys();
 }
Beispiel #8
0
 public DSAKeyGenerator(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain  = domain;
     GenerateKeys();
 }
Beispiel #9
0
 public DSASigner(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain  = domain;
 }
Beispiel #10
0
 public Schnorr(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain  = domain;
     T       = GenerateT();
 }
Beispiel #11
0
 public Schnorr(DomainParameters domain)
 {
     numbers = new RandomNumberGenerator();
     Domain = domain;
     T = GenerateT();
 }