Stay organized with collections
Save and categorize content based on your preferences.
EdDSAParameterSpec
open class EdDSAParameterSpec : 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 |
Construct an EdDSAParameterSpec by specifying whether the prehash mode is used.
|
Construct an EdDSAParameterSpec by specifying a context and whether the prehash mode is used.
|
Public methods |
open Optional<ByteArray!>! |
Get the context that the signature will use.
|
open Boolean |
Get whether the prehash mode is specified.
|
Public constructors
EdDSAParameterSpec
EdDSAParameterSpec(prehash: Boolean)
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
EdDSAParameterSpec(
prehash: Boolean,
context: ByteArray!)
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 |
ByteArray!: the context is copied and bound to the signature. |
Exceptions |
java.lang.NullPointerException |
if context is null. |
java.security.InvalidParameterException |
if context length is greater than 255. |
Public methods
getContext
open fun getContext(): Optional<ByteArray!>!
Get the context that the signature will use.
Return |
Optional<ByteArray!>! |
Optional contains a copy of the context or empty if context is null. |
isPrehash
open fun isPrehash(): Boolean
Get whether the prehash mode is specified.
Return |
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nEdDSAParameterSpec\n==================\n\n```\nopen class EdDSAParameterSpec : AlgorithmParameterSpec\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.security.spec.EdDSAParameterSpec](#) |\n\nA 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.\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](#EdDSAParameterSpec(kotlin.Boolean))`(`prehash:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Construct an `EdDSAParameterSpec` by specifying whether the prehash mode is used. |\n| [EdDSAParameterSpec](#EdDSAParameterSpec(kotlin.Boolean,%20kotlin.ByteArray))`(`prehash:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `context:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`)` Construct an `EdDSAParameterSpec` by specifying a context and whether the prehash mode is used. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|\n| open [Optional](../../util/Optional.html#)\\\u003c[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!\\\u003e! | [getContext](#getContext())`()` Get the context that the signature will use. |\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isPrehash](#isPrehash())`()` Get whether the prehash mode is specified. |\n\nPublic constructors\n-------------------\n\n### EdDSAParameterSpec\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nEdDSAParameterSpec(prehash: Boolean)\n```\n\nConstruct 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.\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------------------------------------|\n| `prehash` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): whether the prehash mode is specified. |\n\n### EdDSAParameterSpec\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nEdDSAParameterSpec(\n prehash: Boolean, \n context: ByteArray!)\n```\n\nConstruct 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.\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| `prehash` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): whether the prehash mode is specified. |\n| `context` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!: the context is copied and bound to the signature. |\n\n| Exceptions ||\n|-------------------------------------------|----------------------------------------|\n| `java.lang.NullPointerException` | if context is null. |\n| `java.security.InvalidParameterException` | if context length is greater than 255. |\n\nPublic methods\n--------------\n\n### getContext\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getContext(): Optional\u003cByteArray!\u003e!\n```\n\nGet the context that the signature will use.\n\n| Return ||\n|----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|\n| [Optional](../../util/Optional.html#)\u003c[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!\u003e! | `Optional` contains a copy of the context or empty if context is null. |\n\n### isPrehash\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun isPrehash(): Boolean\n```\n\nGet whether the prehash mode is specified.\n\n| Return ||\n|------------------------------------------------------------------------------------|----------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | whether the prehash mode is specified. |"]]