Top Description Fields Constructors Methods
java.security.spec

public Class EdDSAParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Imports
java.security.InvalidParameterException, java.util.Objects, .Optional

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.
Since
15

Field Summary

Modifier and TypeField and Description
private final byte[]
private final boolean

Constructor Summary

AccessConstructor and Description
public
EdDSAParameterSpec(boolean
whether the prehash mode is specified.
prehash
)

Construct an EdDSAParameterSpec by specifying whether the prehash mode is used.

public
EdDSAParameterSpec(boolean
whether the prehash mode is specified.
prehash
,
byte[]
the context is copied and bound to the signature.
context
)

Construct an EdDSAParameterSpec by specifying a context and whether the prehash mode is used.

Method Summary

Modifier and TypeMethod and Description
public Optional<byte[]>

Returns:

Optional contains a copy of the context or empty if context is null.
getContext
()

Get the context that the signature will use.

public boolean

Returns:

whether the prehash mode is specified.
isPrehash
()

Get whether the prehash mode is specified.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private final byte[] context
prehashback to summary
private final boolean prehash

Constructor Detail

EdDSAParameterSpecback to summary
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 from the mode in which an empty array is used as the context.

Parameters
prehash:boolean

whether the prehash mode is specified.

EdDSAParameterSpecback to summary
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.

Exceptions
NullPointerException:
if context is null.
InvalidParameterException:
if context length is greater than 255.

Method Detail

getContextback to summary
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.

isPrehashback to summary
public boolean isPrehash()

Get whether the prehash mode is specified.

Returns:boolean

whether the prehash mode is specified.