java.security.spec
Class EllipticCurve

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.spec.EllipticCurve

public class EllipticCurve
extends Object sample code for java.lang.Object definition code for java.lang.Object

This immutable class holds the necessary values needed to represent an elliptic curve.

Since:
1.5
See Also:
ECField sample code for java.security.spec.ECField definition code for java.security.spec.ECField , ECFieldFp sample code for java.security.spec.ECFieldFp definition code for java.security.spec.ECFieldFp , ECFieldF2m sample code for java.security.spec.ECFieldF2m definition code for java.security.spec.ECFieldF2m

Constructor Summary
EllipticCurve sample code for java.security.spec.EllipticCurve.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger) definition code for java.security.spec.EllipticCurve.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger) (ECField sample code for java.security.spec.ECField definition code for java.security.spec.ECField  field, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  a, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  b)
          Creates an elliptic curve with the specified elliptic field field and the coefficients a and b.
EllipticCurve sample code for java.security.spec.EllipticCurve.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger, byte[]) definition code for java.security.spec.EllipticCurve.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger, byte[]) (ECField sample code for java.security.spec.ECField definition code for java.security.spec.ECField  field, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  a, BigInteger sample code for java.math.BigInteger definition code for java.math.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.
 
Method Summary
 boolean equals sample code for java.security.spec.EllipticCurve.equals(java.lang.Object) definition code for java.security.spec.EllipticCurve.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Compares this elliptic curve for equality with the specified object.
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getA sample code for java.security.spec.EllipticCurve.getA() definition code for java.security.spec.EllipticCurve.getA() ()
          Returns the first coefficient a of the elliptic curve.
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getB sample code for java.security.spec.EllipticCurve.getB() definition code for java.security.spec.EllipticCurve.getB() ()
          Returns the second coefficient b of the elliptic curve.
 ECField sample code for java.security.spec.ECField definition code for java.security.spec.ECField getField sample code for java.security.spec.EllipticCurve.getField() definition code for java.security.spec.EllipticCurve.getField() ()
          Returns the finite field field that this elliptic curve is over.
 byte[] getSeed sample code for java.security.spec.EllipticCurve.getSeed() definition code for java.security.spec.EllipticCurve.getSeed() ()
          Returns the seeding bytes seed used during curve generation.
 int hashCode sample code for java.security.spec.EllipticCurve.hashCode() definition code for java.security.spec.EllipticCurve.hashCode() ()
          Returns a hash code value for this elliptic curve.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

EllipticCurve sample code for java.security.spec.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger) definition code for java.security.spec.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger)

public EllipticCurve(ECField sample code for java.security.spec.ECField definition code for java.security.spec.ECField  field,
                     BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  a,
                     BigInteger sample code for java.math.BigInteger definition code for java.math.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 sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if field, a, or b is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if a or b is not null and not in field.

EllipticCurve sample code for java.security.spec.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger, byte[]) definition code for java.security.spec.EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger, byte[])

public EllipticCurve(ECField sample code for java.security.spec.ECField definition code for java.security.spec.ECField  field,
                     BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  a,
                     BigInteger sample code for java.math.BigInteger definition code for java.math.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 sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if field, a, or b is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if a or b is not null and not in field.
Method Detail

getField sample code for java.security.spec.EllipticCurve.getField() definition code for java.security.spec.EllipticCurve.getField()

public ECField sample code for java.security.spec.ECField definition code for java.security.spec.ECField  getField()
Returns the finite field field that this elliptic curve is over.

Returns:
the field field that this curve is over.

getA sample code for java.security.spec.EllipticCurve.getA() definition code for java.security.spec.EllipticCurve.getA()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getA()
Returns the first coefficient a of the elliptic curve.

Returns:
the first coefficient a.

getB sample code for java.security.spec.EllipticCurve.getB() definition code for java.security.spec.EllipticCurve.getB()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getB()
Returns the second coefficient b of the elliptic curve.

Returns:
the second coefficient b.

getSeed sample code for java.security.spec.EllipticCurve.getSeed() definition code for java.security.spec.EllipticCurve.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 sample code for java.security.spec.EllipticCurve.equals(java.lang.Object) definition code for java.security.spec.EllipticCurve.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Compares this elliptic curve for equality with the specified object.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the object to be compared.
Returns:
true if obj is an instance of EllipticCurve and the field, A, B, and seeding bytes match, false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for java.security.spec.EllipticCurve.hashCode() definition code for java.security.spec.EllipticCurve.hashCode()

public int hashCode()
Returns a hash code value for this elliptic curve.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable