public X9ECParameters(
Asn1Sequence seq)
{
if (!(seq[0] is DerInteger) ||
!((DerInteger)seq[0]).Value.Equals(BigInteger.One))
{
throw new ArgumentException("bad version in X9ECParameters");
}
X9Curve x9c = new X9Curve(
X9FieldID.GetInstance(seq[1]),
Asn1Sequence.GetInstance(seq[2]));
this.curve = x9c.Curve;
object p = seq[3];
if (p is X9ECPoint)
{
this.g = ((X9ECPoint)p);
}
else
{
this.g = new X9ECPoint(curve, (Asn1OctetString)p);
}
this.n = ((DerInteger)seq[4]).Value;
this.seed = x9c.GetSeed();
if (seq.Count == 6)
{
this.h = ((DerInteger)seq[5]).Value;
}
}