Class EdDSAParameterSpec
java.lang.Object
org.bouncycastle.jcajce.spec.EdDSAParameterSpec
- All Implemented Interfaces:
AlgorithmParameterSpec
ParameterSpec for EdDSA signature algorithms.
As well as selecting the curve (for key pair generation) the spec can carry the RFC 8032 instance selectors used when signing or verifying: the prehash flag (Ed25519ph / Ed448ph) and an optional context (Ed25519ctx, or the context permitted by Ed448 / the prehash variants). A context, when supplied, must be at most 255 bytes (RFC 8032 sec. 5.1 / 5.2). When neither prehash nor a non-empty context is supplied the spec selects the pure variant, matching BC's historical behaviour for the curve-name-only constructor.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEdDSAParameterSpec(String curveName) Base constructor - pure variant, no context.EdDSAParameterSpec(String curveName, boolean prehash) Constructor specifying the prehash (Ed25519ph / Ed448ph) selector.EdDSAParameterSpec(String curveName, boolean prehash, byte[] context) Constructor specifying the prehash selector and a context. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Return the RFC 8032 context, or null if none was specified.Return the curve name specified by this parameterSpec.booleanReturn whether the prehash (ph) variant is selected.toString()Return the RFC 8032 name of the variant these parameters select (Ed25519, Ed25519ctx, Ed25519ph, Ed448 or Ed448ph), followed by the context length when there is a context, for example "Ed448ph [context=5 bytes]".
-
Field Details
-
Ed25519
- See Also:
-
Ed448
- See Also:
-
-
Constructor Details
-
EdDSAParameterSpec
Base constructor - pure variant, no context.- Parameters:
curveName- name of the curve to specify.
-
EdDSAParameterSpec
Constructor specifying the prehash (Ed25519ph / Ed448ph) selector.- Parameters:
curveName- name of the curve to specify.prehash- true to select the prehash (ph) variant.
-
EdDSAParameterSpec
Constructor specifying the prehash selector and a context.- Parameters:
curveName- name of the curve to specify.prehash- true to select the prehash (ph) variant.context- the RFC 8032 context (at most 255 bytes), or null for none.
-
-
Method Details
-
getCurveName
Return the curve name specified by this parameterSpec.- Returns:
- the name of the curve this parameterSpec specifies.
-
isPrehash
public boolean isPrehash()Return whether the prehash (ph) variant is selected.- Returns:
- true if Ed25519ph / Ed448ph is selected, false for the pure / ctx variant.
-
getContext
public byte[] getContext()Return the RFC 8032 context, or null if none was specified.- Returns:
- a copy of the context, or null.
-
toString
-