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.
-
Method Summary
All Methods Instance Methods Concrete Methods 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.voidsetCurveName(String curveName)Used to set the curve name if available.
-
-
-
Constructor Detail
-
ECParameterSpec
public 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.- 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.
-
-
Method Detail
-
getCofactor
public int getCofactor()
Returns thecofactor.- Returns:
- the
cofactor.
-
getCurve
public EllipticCurve getCurve()
Returns the elliptic curve.- Returns:
- the elliptic curve.
-
getGenerator
public ECPoint getGenerator()
Returns the generator (or base point).- Returns:
- the generator (or base point).
-
getOrder
public BigInteger getOrder()
Returns the order of the generator.- Returns:
- the order of the generator.
-
setCurveName
public void setCurveName(String curveName)
Used to set the curve name if available.
-
getCurveName
public String getCurveName()
Returns the name of the curve if this is a named curve. Returnsnullif this is not known to be a named curve.
-
-