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

# EdDSAParameterSpec

` public class EdDSAParameterSpec `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/java/security/spec/AlgorithmParameterSpec `

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

<br />

*** ** * ** ***

A class used to specify EdDSA signature and verification parameters. All algorithm modes in [RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA)](https://tools.ietf.org/html/rfc8032) can be specified using combinations of the settings in this class.

- If prehash is true, then the mode is Ed25519ph or Ed448ph
- Otherwise, if a context is present, the mode is Ed25519ctx or Ed448
- Otherwise, the mode is Ed25519 or Ed448

<br />

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/security/spec/EdDSAParameterSpec#EdDSAParameterSpec(boolean)(boolean prehash) ` Construct an `EdDSAParameterSpec` by specifying whether the prehash mode is used. |
| ` https://developer.android.com/reference/java/security/spec/EdDSAParameterSpec#EdDSAParameterSpec(boolean,%20byte[])(boolean prehash, byte[] context) ` Construct an `EdDSAParameterSpec` by specifying a context and whether the prehash mode is used. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/util/Optional<byte[]>` | ` https://developer.android.com/reference/java/security/spec/EdDSAParameterSpec#getContext()() ` Get the context that the signature will use. |
| ` boolean` | ` https://developer.android.com/reference/java/security/spec/EdDSAParameterSpec#isPrehash()() ` Get whether the prehash mode is specified. |

### 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

### EdDSAParameterSpec

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

```
public EdDSAParameterSpec (boolean prehash)
```

Construct an `EdDSAParameterSpec` by specifying whether the prehash mode is used. No context is provided so this constructor specifies a mode in which the context is null. Note that this mode may be different than the mode in which an empty array is used as the context.

<br />

| Parameters ||
|---|---|
| `prehash` | `boolean`: whether the prehash mode is specified. <br /> |

### EdDSAParameterSpec

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

```
public EdDSAParameterSpec (boolean prehash, 
                byte[] context)
```

Construct an `EdDSAParameterSpec` by specifying a context and whether the prehash mode is used. The context may not be null, but it may be an empty array. The mode used when the context is an empty array may not be the same as the mode used when the context is absent.

<br />

| Parameters ||
|---|---|
| `prehash` | `boolean`: whether the prehash mode is specified. <br /> |
| `context` | `byte`: the context is copied and bound to the signature. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if context is null. |
| `https://developer.android.com/reference/java/security/InvalidParameterException` | if context length is greater than 255. |

## Public methods

### getContext

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

```
public Optional<byte[]> getContext ()
```

Get the context that the signature will use.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Optional<byte[]>` | `Optional` contains a copy of the context or empty if context is null. <br /> |

### isPrehash

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

```
public boolean isPrehash ()
```

Get whether the prehash mode is specified.

<br />

| Returns ||
|---|---|
| `boolean` | whether the prehash mode is specified. <br /> |