Package java.security.spec
Class ECParameterSpec
java.lang.Object
java.security.spec.ECParameterSpec
- All Implemented Interfaces:
AlgorithmParameterSpec
- Direct Known Subclasses:
ECNamedCurveSpec
public class ECParameterSpec extends Object implements AlgorithmParameterSpec
The parameter specification used with Elliptic Curve Cryptography (ECC).
-
Constructor Summary
Constructors Constructor Description ECParameterSpec(EllipticCurve curve, ECPoint generator, BigInteger order, int cofactor)Creates a newECParameterSpecwith the specified elliptic curve, the base point, the order of the generator (or base point) and the co-factor.ECParameterSpec(EllipticCurve curve, ECPoint generator, BigInteger order, int cofactor, String curveName)Creates a newECParameterSpecwith the specified named curve and all of its parameters. -
Method Summary
Modifier and Type Method Description intgetCofactor()Returns thecofactor.EllipticCurvegetCurve()Returns the elliptic curve.StringgetCurveName()Returns the name of the curve if this is a named curve.ECPointgetGenerator()Returns the generator (or base point).BigIntegergetOrder()Returns the order of the generator.
-
Constructor Details
-
ECParameterSpec
Creates a newECParameterSpecwith the specified elliptic curve, the base point, the order of the generator (or base point) and the co-factor.- Parameters:
curve- the elliptic curve.generator- the generator (or base point).order- the order of the generator.cofactor- the co-factor.- Throws:
IllegalArgumentException- iforder <= zeroorcofactor <= zero.
-
ECParameterSpec
public ECParameterSpec(EllipticCurve curve, ECPoint generator, BigInteger order, int cofactor, String curveName)Creates a newECParameterSpecwith the specified named curve and all of its parameters.
-
-
Method Details
-
getCofactor
public int getCofactor()Returns thecofactor.- Returns:
- the
cofactor.
-
getCurve
Returns the elliptic curve.- Returns:
- the elliptic curve.
-
getGenerator
Returns the generator (or base point).- Returns:
- the generator (or base point).
-
getOrder
Returns the order of the generator.- Returns:
- the order of the generator.
-
getCurveName
Returns the name of the curve if this is a named curve. Returnsnullif this is not known to be a named curve.
-