EcParameterSpecWithName
insteadpublic class ECParameters
extends java.lang.Object
implements java.security.spec.AlgorithmParameterSpec
ECParameters class provides a representation of elliptic
curve parameters as defined in ANSI X9.62, sections 7.3 and 7.4.
The ASN1 structure is as follows:
Parameters ::= CHOICE {
ecParameters ECParameters,
namedCurve CURVES.&id({CurveNames}),
implicitlyCA NULL
}
where namedCurve is given as an OBJECT IDENTIFIER,
and ECParameters is given by
ECParameters ::= SEQUENCE {
version INTEGER { ecpVer1(1) } (ecpVer1),
fieldID FieldID {{FieldTypes}},
curve Curve,
base ECPoint,
order INTEGER,
cofactor INTEGER OPTIONAL,
...
}
and
Curve ::= SEQUENCE {
a FieldElement,
b FieldElement,
seed BIT STRING OPTIONAL
}
ECPoint and FieldElement are fixed as
OCTET STRINGs.
The fieldID is given as an OBJECT IDENTIFIER,
either as a prime-field OID or as a characteristic-two-field OID, where
ansi-X9-62 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) 10045 }
id-fieldType OBJECT IDENTIFIER ::= { ansi-X9-62 fieldType(1) }
prime-field OBJECT IDENTIFIER ::= { id-fieldType 1 }
characteristic-two-field OBJECT IDENTIFIER ::= { id-fieldType 2 }
NamedCurveFactory| Constructor and Description |
|---|
ECParameters(ASN1Object object)
Deprecated.
Constructor that requires a suitable ASN1 structure as an argument.
|
ECParameters(ECPoint base,
java.math.BigInteger order,
java.math.BigInteger cofactor)
Deprecated.
Constructor that requires an elliptic curve point, the order
of the curve, and the co-factor (can be
null)
as arguments. |
| Modifier and Type | Method and Description |
|---|---|
ECPoint |
getBase()
Deprecated.
Returns the base point.
|
java.math.BigInteger |
getCofactor()
Deprecated.
Returns the cofactor of the curve, if known otherwise returns
null. |
EllipticCurve |
getCurve()
Deprecated.
Returns the elliptic curve.
|
Field |
getField()
Deprecated.
Returns the field.
|
ObjectID |
getNamedCurve()
Deprecated.
Returns the named curve OID, if known otherwise returns
null. |
java.math.BigInteger |
getOrder()
Deprecated.
Returns the order of the curve.
|
int |
getVersion()
Deprecated.
Returns the version number.
|
void |
setNamedCurve(ObjectID namedCurve)
Deprecated.
Sets the named curve OID.
|
ASN1Object |
toASN1Object()
Deprecated.
Returns an ASN.1 structure representing the calling
ECParamater object. |
java.lang.String |
toString()
Deprecated.
Returns the calling object represented as a
String. |
public ECParameters(ECPoint base, java.math.BigInteger order, java.math.BigInteger cofactor) throws java.lang.IllegalArgumentException
null)
as arguments.base - an ECPoint object that contains an elliptic curveorder - a BigInteger object that is the order of the base
point on the curvecofactor - a BigInteger object that equals the number of points
on the curve divided by the order (can be null, if
this value is not known)
null, must
be equal to the number of points on the curve divided by the
order.java.lang.IllegalArgumentException - if base power raised to the order is not equal to the point at
infinity on the given curve contained in basepublic ECParameters(ASN1Object object) throws CodingException
object - an ASN1Object object that must be formed as described in X9.62
ASN1object contains a non-null cofactor,
the cofactor must be equal to the number of points on the curve divided by the
order.CodingException - if any of the following conditions is satisfied:
ASN1Object is not in the expected formatpublic ASN1Object toASN1Object()
ECParamater object.
If a named curve OID is known, it is used for encoding, otherwise the values are encoded explicitly. In other words, the Parameters structure as defined in ANSI X9.62, section 7.4 is returned.
public int getVersion()
public Field getField()
Field objectpublic EllipticCurve getCurve()
EllipticCurve object.public void setNamedCurve(ObjectID namedCurve)
Enables the encoding of the calling ECParameter object
in ASN1 notation by wrapping the OID.
namedCurve - the named curve OID as an ObjectID object
namedCurve MUST
be a valid OID of the calling ECParameter object.public ObjectID getNamedCurve()
null.ObjectID object.public ECPoint getBase()
ECPoint object.public java.math.BigInteger getOrder()
BigInteger object.public java.math.BigInteger getCofactor()
null.BigInteger object.public java.lang.String toString()
String.toString in class java.lang.Object