Class EllipticCurve
java.lang.Object
java.security.spec.EllipticCurve
public class EllipticCurve extends Object
This immutable class holds the necessary values needed to represent an elliptic curve.
- Since:
- 1.5
- See Also:
Constructor Summary
Constructor | Description |
---|---|
EllipticCurve |
Creates an elliptic curve with the specified elliptic field field and the coefficients a and b . |
EllipticCurve |
Creates an elliptic curve with the specified elliptic field field , the coefficients a and b , and the seed used for curve generation. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals |
Compares this elliptic curve for equality with the specified object. |
BigInteger |
getA() |
Returns the first coefficient a of the elliptic curve. |
BigInteger |
getB() |
Returns the second coefficient b of the elliptic curve. |
ECField |
getField() |
Returns the finite field field that this elliptic curve is over. |
byte[] |
getSeed() |
Returns the seeding bytes seed used during curve generation. |
int |
hashCode() |
Returns a hash code value for this elliptic curve. |
Constructor Details
EllipticCurve
public EllipticCurve(ECField field, BigInteger a, BigInteger b)
Creates an elliptic curve with the specified elliptic field
field
and the coefficients a
and b
.- Parameters:
-
field
- the finite field that this elliptic curve is over. -
a
- the first coefficient of this elliptic curve. -
b
- the second coefficient of this elliptic curve. - Throws:
-
NullPointerException
- iffield
,a
, orb
is null. -
IllegalArgumentException
- ifa
orb
is not null and not infield
.
EllipticCurve
public EllipticCurve(ECField field, BigInteger a, BigInteger b, byte[] seed)
Creates an elliptic curve with the specified elliptic field
field
, the coefficients a
and b
, and the seed
used for curve generation.- Parameters:
-
field
- the finite field that this elliptic curve is over. -
a
- the first coefficient of this elliptic curve. -
b
- the second coefficient of this elliptic curve. -
seed
- the bytes used during curve generation for later validation. Contents of this array are copied to protect against subsequent modification. - Throws:
-
NullPointerException
- iffield
,a
, orb
is null. -
IllegalArgumentException
- ifa
orb
is not null and not infield
.
Method Details
getField
public ECField getField()
Returns the finite field
field
that this elliptic curve is over.- Returns:
- the field
field
that this curve is over.
getA
public BigInteger getA()
Returns the first coefficient
a
of the elliptic curve.- Returns:
- the first coefficient
a
.
getB
public BigInteger getB()
Returns the second coefficient
b
of the elliptic curve.- Returns:
- the second coefficient
b
.
getSeed
public byte[] getSeed()
Returns the seeding bytes
seed
used during curve generation. May be null if not specified.- Returns:
- the seeding bytes
seed
. A new array is returned each time this method is called.
equals
public boolean equals(Object obj)
Compares this elliptic curve for equality with the specified object.
hashCode
public int hashCode()
Returns a hash code value for this elliptic curve.
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/security/spec/EllipticCurve.html