public ECParameterSpec(EllipticCurve curve, ECPoint generator, BigInteger order, int cofactor)Creates a new {@code ECParameterSpec} with the specified elliptic curve,
the base point, the order of the generator (or base point) and the
co-factor.
this.curve = curve;
this.generator = generator;
this.order = order;
this.cofactor = cofactor;
// throw NullPointerException if curve, generator or order is null
if (this.curve == null) {
throw new NullPointerException(Messages.getString("security.83", "curve")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (this.generator == null) {
throw new NullPointerException(Messages.getString("security.83", "generator")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (this.order == null) {
throw new NullPointerException(Messages.getString("security.83", "order")); //$NON-NLS-1$ //$NON-NLS-2$
}
// throw IllegalArgumentException if order or cofactor is not positive
if (!(this.order.compareTo(BigInteger.ZERO) > 0)) {
throw new
IllegalArgumentException(Messages.getString("security.86", "order")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!(this.cofactor > 0)) {
throw new
IllegalArgumentException(Messages.getString("security.86", "cofactor")); //$NON-NLS-1$ //$NON-NLS-2$
}
|