Stay organized with collections
Save and categorize content based on your preferences.
EdDSAParameterSpec
public
class
EdDSAParameterSpec
extends Object
implements
AlgorithmParameterSpec
A class used to specify EdDSA signature and verification parameters. All
algorithm modes in RFC 8032:
Edwards-Curve Digital Signature Algorithm (EdDSA) 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
Summary
Public constructors |
EdDSAParameterSpec(boolean prehash)
Construct an EdDSAParameterSpec by specifying whether the prehash mode
is used.
|
EdDSAParameterSpec(boolean prehash, byte[] context)
Construct an EdDSAParameterSpec by specifying a context and whether the
prehash mode is used.
|
Public methods |
Optional<byte[]>
|
getContext()
Get the context that the signature will use.
|
boolean
|
isPrehash()
Get whether the prehash mode is specified.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(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
|
wait(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
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
EdDSAParameterSpec
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.
Parameters |
prehash |
boolean : whether the prehash mode is specified. |
EdDSAParameterSpec
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.
Parameters |
prehash |
boolean : whether the prehash mode is specified. |
context |
byte : the context is copied and bound to the signature. |
Public methods
getContext
public Optional<byte[]> getContext ()
Get the context that the signature will use.
Returns |
Optional<byte[]> |
Optional contains a copy of the context or empty
if context is null. |
isPrehash
public boolean isPrehash ()
Get whether the prehash mode is specified.
Returns |
boolean |
whether the prehash mode is specified. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# EdDSAParameterSpec\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nEdDSAParameterSpec\n==================\n\n\n`\npublic\n\n\nclass\nEdDSAParameterSpec\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\nimplements\n\n`[AlgorithmParameterSpec](/reference/java/security/spec/AlgorithmParameterSpec)`\n\n\n`\n\n|---|---------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | java.security.spec.EdDSAParameterSpec |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA class used to specify EdDSA signature and verification parameters. All\nalgorithm modes in [RFC 8032:\nEdwards-Curve Digital Signature Algorithm (EdDSA)](https://tools.ietf.org/html/rfc8032) can be specified using\ncombinations of the settings in this class.\n\n- If prehash is true, then the mode is Ed25519ph or Ed448ph\n- Otherwise, if a context is present, the mode is Ed25519ctx or Ed448\n- Otherwise, the mode is Ed25519 or Ed448\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[EdDSAParameterSpec](/reference/java/security/spec/EdDSAParameterSpec#EdDSAParameterSpec(boolean))`(boolean prehash) ` Construct an `EdDSAParameterSpec` by specifying whether the prehash mode is used. |\n| ` `[EdDSAParameterSpec](/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. |\n\n| ### Public methods ||\n|--------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| ` `[Optional](/reference/java/util/Optional)`\u003cbyte[]\u003e` | ` `[getContext](/reference/java/security/spec/EdDSAParameterSpec#getContext())`() ` Get the context that the signature will use. |\n| ` boolean` | ` `[isPrehash](/reference/java/security/spec/EdDSAParameterSpec#isPrehash())`() ` Get whether the prehash mode is specified. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/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 `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/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` | ` `[wait](/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` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic constructors\n-------------------\n\n### EdDSAParameterSpec\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic EdDSAParameterSpec (boolean prehash)\n```\n\nConstruct an `EdDSAParameterSpec` by specifying whether the prehash mode\nis used. No context is provided so this constructor specifies a mode\nin which the context is null. Note that this mode may be different\nthan the mode in which an empty array is used as the context.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|----------------------------------------------------------|\n| `prehash` | `boolean`: whether the prehash mode is specified. \u003cbr /\u003e |\n\n### EdDSAParameterSpec\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic EdDSAParameterSpec (boolean prehash, \n byte[] context)\n```\n\nConstruct an `EdDSAParameterSpec` by specifying a context and whether the\nprehash mode is used. The context may not be null, but it may be an\nempty array. The mode used when the context is an empty array may not be\nthe same as the mode used when the context is absent.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|------------------------------------------------------------------|\n| `prehash` | `boolean`: whether the prehash mode is specified. \u003cbr /\u003e |\n| `context` | `byte`: the context is copied and bound to the signature. \u003cbr /\u003e |\n\n| Throws ||\n|---------------------------------------------------------------------------------|----------------------------------------|\n| [NullPointerException](/reference/java/lang/NullPointerException) | if context is null. |\n| [InvalidParameterException](/reference/java/security/InvalidParameterException) | if context length is greater than 255. |\n\nPublic methods\n--------------\n\n### getContext\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Optional\u003cbyte[]\u003e getContext ()\n```\n\nGet the context that the signature will use.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------------|-------------------------------------------------------------------------------|\n| [Optional](/reference/java/util/Optional)`\u003cbyte[]\u003e` | `Optional` contains a copy of the context or empty if context is null. \u003cbr /\u003e |\n\n### isPrehash\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic boolean isPrehash ()\n```\n\nGet whether the prehash mode is specified.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|-----------------------------------------------|\n| `boolean` | whether the prehash mode is specified. \u003cbr /\u003e |"]]