FileDocCategorySizeDatePackage
ECParameterSpec.javaAPI DocAndroid 1.5 API4074Wed May 06 22:41:06 BST 2009java.security.spec

ECParameterSpec

public class ECParameterSpec extends Object implements AlgorithmParameterSpec
The parameter specification used with Elliptic Curve Cryptography (ECC).
since
Android 1.0

Fields Summary
private final EllipticCurve
curve
private final ECPoint
generator
private final BigInteger
order
private final int
cofactor
Constructors Summary
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.

param
curve the elliptic curve.
param
generator the generator (or base point).
param
order the order of the generator.
param
cofactor the co-factor.
throws
IllegalArgumentException if {@code order <= zero} or {@code cofactor <= zero}.
since
Android 1.0

        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$
        }
    
Methods Summary
public intgetCofactor()
Returns the {@code cofactor}.

return
the {@code cofactor}.
since
Android 1.0

        return cofactor;
    
public java.security.spec.EllipticCurvegetCurve()
Returns the elliptic curve.

return
the elliptic curve.
since
Android 1.0

        return curve;
    
public java.security.spec.ECPointgetGenerator()
Returns the generator (or base point).

return
the generator (or base point).
since
Android 1.0

        return generator;
    
public java.math.BigIntegergetOrder()
Returns the order of the generator.

return
the order of the generator.
since
Android 1.0

        return order;