APIdia Launch Partner
Top Description Fields Constructors Methods
java.security.spec

public final Class EdECPrivateKeySpec

extends Object
implements KeySpec
Class Inheritance
All Implemented Interfaces
java.security.spec.KeySpec
Imports
java.util.Objects

A class representing elliptic curve private keys as defined in RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA), including the curve and other algorithm parameters. The private key is a bit string represented using a byte array. This class only supports bit string lengths that are a multiple of 8.
Since
15
External Specification
https://www.rfc-editor.org/info/rfc8032

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
EdECPrivateKeySpec(NamedParameterSpec
the algorithm parameters.
params
,
byte[]
the key as a byte array. This array is copied to protect against subsequent modification.
bytes
)

Construct a private key spec using the supplied parameters and bit string.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the private key as a byte array.
getBytes
()

Get the byte array representing the private key.

public NamedParameterSpec

Returns:

the algorithm parameters.
getParams
()

Get the algorithm parameters that define the curve and other settings.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesback to summary
private final byte[] bytes
paramsback to summary
private final NamedParameterSpec params

Constructor Detail

EdECPrivateKeySpecback to summary
public EdECPrivateKeySpec(NamedParameterSpec params, byte[] bytes)

Construct a private key spec using the supplied parameters and bit string.

Parameters
params:NamedParameterSpec

the algorithm parameters.

bytes:byte[]

the key as a byte array. This array is copied to protect against subsequent modification.

Exceptions
NullPointerException:
if params or bytes is null.

Method Detail

getBytesback to summary
public byte[] getBytes()

Get the byte array representing the private key. A new copy of the array is returned each time this method is called.

Returns:byte[]

the private key as a byte array.

getParamsback to summary
public NamedParameterSpec getParams()

Get the algorithm parameters that define the curve and other settings.

Returns:NamedParameterSpec

the algorithm parameters.