Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/java/security/spec/EllipticCurve#pubctors) \| [Methods](https://developer.android.com/reference/java/security/spec/EllipticCurve#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/security/spec/EllipticCurve#inhmethods)

# EllipticCurve

` public class EllipticCurve `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.security.spec.EllipticCurve |

<br />

*** ** * ** ***

This immutable class holds the necessary values needed to represent an elliptic curve.
**See also:**

- `https://developer.android.com/reference/java/security/spec/ECField`
- `https://developer.android.com/reference/java/security/spec/ECFieldFp`
- `https://developer.android.com/reference/java/security/spec/ECFieldF2m`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/security/spec/EllipticCurve#EllipticCurve(java.security.spec.ECField,%20java.math.BigInteger,%20java.math.BigInteger)(https://developer.android.com/reference/java/security/spec/ECField field, https://developer.android.com/reference/java/math/BigInteger a, https://developer.android.com/reference/java/math/BigInteger b) ` Creates an elliptic curve with the specified elliptic field `field` and the coefficients `a` and `b`. |
| ` https://developer.android.com/reference/java/security/spec/EllipticCurve#EllipticCurve(java.security.spec.ECField,%20java.math.BigInteger,%20java.math.BigInteger,%20byte[])(https://developer.android.com/reference/java/security/spec/ECField field, https://developer.android.com/reference/java/math/BigInteger a, https://developer.android.com/reference/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. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/java/security/spec/EllipticCurve#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Compares this elliptic curve for equality with the specified object. |
| ` https://developer.android.com/reference/java/math/BigInteger` | ` https://developer.android.com/reference/java/security/spec/EllipticCurve#getA()() ` Returns the first coefficient `a` of the elliptic curve. |
| ` https://developer.android.com/reference/java/math/BigInteger` | ` https://developer.android.com/reference/java/security/spec/EllipticCurve#getB()() ` Returns the second coefficient `b` of the elliptic curve. |
| ` https://developer.android.com/reference/java/security/spec/ECField` | ` https://developer.android.com/reference/java/security/spec/EllipticCurve#getField()() ` Returns the finite field `field` that this elliptic curve is over. |
| ` byte[]` | ` https://developer.android.com/reference/java/security/spec/EllipticCurve#getSeed()() ` Returns the seeding bytes `seed` used during curve generation. |
| ` int` | ` https://developer.android.com/reference/java/security/spec/EllipticCurve#hashCode()() ` Returns a hash code value for this elliptic curve. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### EllipticCurve

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public EllipticCurve (ECField field, 
                BigInteger a, 
                BigInteger b)
```

Creates an elliptic curve with the specified elliptic field `field` and the coefficients `a` and `b`.

<br />

| Parameters ||
|---|---|
| `field` | `ECField`: the finite field that this elliptic curve is over. <br /> |
| `a` | `BigInteger`: the first coefficient of this elliptic curve. <br /> |
| `b` | `BigInteger`: the second coefficient of this elliptic curve. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `a` or `b` is not null and not in `field`. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `field`, `a`, or `b` is null. |

### EllipticCurve

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `field` | `ECField`: the finite field that this elliptic curve is over. <br /> |
| `a` | `BigInteger`: the first coefficient of this elliptic curve. <br /> |
| `b` | `BigInteger`: the second coefficient of this elliptic curve. <br /> |
| `seed` | `byte`: the bytes used during curve generation for later validation. Contents of this array are copied to protect against subsequent modification. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `a` or `b` is not null and not in `field`. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `field`, `a`, or `b` is null. |

## Public methods

### equals

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object obj)
```

Compares this elliptic curve for equality with the specified object.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: the object to be compared. <br /> |

| Returns ||
|---|---|
| `boolean` | true if `obj` is an instance of EllipticCurve and the field, A, and B match, false otherwise. <br /> |

### getA

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BigInteger getA ()
```

Returns the first coefficient `a` of the elliptic curve.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/math/BigInteger` | the first coefficient `a`. <br /> |

### getB

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BigInteger getB ()
```

Returns the second coefficient `b` of the elliptic curve.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/math/BigInteger` | the second coefficient `b`. <br /> |

### getField

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ECField getField ()
```

Returns the finite field `field` that this elliptic curve is over.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/spec/ECField` | the field `field` that this curve is over. <br /> |

### getSeed

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte[] getSeed ()
```

Returns the seeding bytes `seed` used during curve generation. May be null if not specified.

<br />

| Returns ||
|---|---|
| `byte[]` | the seeding bytes `seed`. A new array is returned each time this method is called. <br /> |

### hashCode

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns a hash code value for this elliptic curve.

<br />

| Returns ||
|---|---|
| `int` | a hash code value computed from the hash codes of the field, A, and B, as follows: (field.hashCode() << 6) + (a.hashCode() << 4) + (b.hashCode() << 2) <br /> |