Esempio n. 1
0
        private DHDomainParameters(Asn1Sequence seq)
        {
            if (seq.Count < 3 || seq.Count > 5)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
            }

            IEnumerator e = seq.GetEnumerator();

            this.p = DerInteger.GetInstance(GetNext(e));
            this.g = DerInteger.GetInstance(GetNext(e));
            this.q = DerInteger.GetInstance(GetNext(e));

            Asn1Encodable next = GetNext(e);

            if (next != null && next is DerInteger)
            {
                this.j = DerInteger.GetInstance(next);
                next   = GetNext(e);
            }

            if (next != null)
            {
                this.validationParms = DHValidationParms.GetInstance(next.ToAsn1Object());
            }
        }
Esempio n. 2
0
        public DHDomainParameters(DerInteger p, DerInteger g, DerInteger q, DerInteger j,
                                  DHValidationParms validationParms)
        {
            if (p == null)
            {
                throw new ArgumentNullException("p");
            }
            if (g == null)
            {
                throw new ArgumentNullException("g");
            }
            if (q == null)
            {
                throw new ArgumentNullException("q");
            }

            this.p = p;
            this.g = g;
            this.q = q;
            this.j = j;
            this.validationParms = validationParms;
        }