Top Inners Fields Constructors Methods
sun.security.ec.ed

public Class EdDSASignature

extends SignatureSpi
Class Inheritance
Known Direct Subclasses
sun.security.ec.ed.EdDSASignature.Ed25519, sun.security.ec.ed.EdDSASignature.Ed448
Imports
sun.security.ec.point.AffinePoint, java.io.ByteArrayOutputStream, java.security.AlgorithmParameters, .InvalidAlgorithmParameterException, .InvalidKeyException, .InvalidParameterException, .NoSuchAlgorithmException, .PrivateKey, .ProviderException, .PublicKey, .SecureRandom, .SignatureException, .SignatureSpi, java.security.interfaces.EdECPrivateKey, .EdECPublicKey, java.security.spec.AlgorithmParameterSpec, .EdDSAParameterSpec, .NamedParameterSpec, java.util.function.Function

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class
public static class
private static class
private static interface

Field Summary

Modifier and TypeField and Description
private EdDSAParameters
private EdDSASignature.MessageAccumulator
private EdDSAOperations
private byte[]
private byte[]
private AffinePoint
private EdDSAParameterSpec
Inherited from java.security.SignatureSpi:
appRandom

Constructor Summary

AccessConstructor and Description
public
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static void
private <T extends Throwable> void
protected Object
engineGetParameter(String
the string name of the parameter.
param
)

Implements abstract java.security.SignatureSpi.engineGetParameter.

Deprecated
Gets the value of the specified algorithm parameter.
protected AlgorithmParameters
engineGetParameters()

Overrides java.security.SignatureSpi.engineGetParameters.

Returns the parameters used with this Signature object.
protected void
engineInitSign(PrivateKey
the private key of the identity whose signature will be generated.
privateKey
)

Implements abstract java.security.SignatureSpi.engineInitSign.

Initializes this Signature object with the specified private key for signing operations.
protected void
engineInitSign(PrivateKey
the private key of the identity whose signature will be generated.
privateKey
,
SecureRandom
the source of randomness
random
)

Overrides java.security.SignatureSpi.engineInitSign.

Initializes this Signature object with the specified private key and source of randomness for signing operations.
protected void
engineInitVerify(PublicKey
the public key of the identity whose signature is going to be verified.
publicKey
)

Implements abstract java.security.SignatureSpi.engineInitVerify.

Initializes this Signature object with the specified public key for verification operations.
protected void
engineSetParameter(String
the string identifier of the parameter.
param
,
Object
the parameter value.
value
)

Implements abstract java.security.SignatureSpi.engineSetParameter.

Deprecated
Sets the specified algorithm parameter to the specified value.
protected void
engineSetParameter(AlgorithmParameterSpec
the parameters
params
)

Overrides java.security.SignatureSpi.engineSetParameter.

Initializes this Signature object with the specified parameter values.
protected byte[]
engineSign()

Implements abstract java.security.SignatureSpi.engineSign.

Returns the signature bytes of all the data updated so far.
protected void
engineUpdate(byte
the byte to use for the update.
b
)

Implements abstract java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified using the specified byte.
protected void
engineUpdate(byte[]
the array of bytes
b
,
int
the offset to start from in the array of bytes
off
,
int
the number of bytes to use, starting at offset
len
)

Implements abstract java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
protected boolean
engineVerify(byte[]
the signature bytes to be verified.
sigBytes
)

Implements abstract java.security.SignatureSpi.engineVerify.

Verifies the passed-in signature.
private void
private void
private void
private void
Inherited from java.security.SignatureSpi:
cloneengineSignengineUpdateengineVerify

Field Detail

lockedParamsback to summary
private EdDSAParameters lockedParams
messageback to summary
private EdDSASignature.MessageAccumulator message
opsback to summary
private EdDSAOperations ops
privateKeyback to summary
private byte[] privateKey
publicKeyBytesback to summary
private byte[] publicKeyBytes
publicKeyPointback to summary
private AffinePoint publicKeyPoint
sigParamsback to summary
private EdDSAParameterSpec sigParams

Constructor Detail

EdDSASignatureback to summary
public EdDSASignature()
EdDSASignatureback to summary
pack-priv EdDSASignature(NamedParameterSpec paramSpec)

Method Detail

checkContextLengthback to summary
private static void checkContextLength(EdDSAParameterSpec edDsaParams) throws InvalidAlgorithmParameterException
checkLockedParamsback to summary
private <T extends Throwable> void checkLockedParams(Function<String, T> exception, EdDSAParameters params) throws T
engineGetParameterback to summary
protected Object engineGetParameter(String param) throws InvalidParameterException

Implements abstract java.security.SignatureSpi.engineGetParameter.

Doc from java.security.SignatureSpi.engineGetParameter.

Deprecated

Gets the value of the specified algorithm parameter. This method supplies a general-purpose mechanism through which it is possible to get the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.

Parameters
param:String

the string name of the parameter.

Returns:Object

the object that represents the parameter value, or null if there is none.

Annotations
@Deprecated
@Override
Exceptions
InvalidParameterException:
if param is an invalid parameter for this engine, or another exception occurs while trying to get this parameter.
engineGetParametersback to summary
protected AlgorithmParameters engineGetParameters()

Overrides java.security.SignatureSpi.engineGetParameters.

Doc from java.security.SignatureSpi.engineGetParameters.

Returns the parameters used with this Signature object.

The returned parameters may be the same that were used to initialize this Signature object, or may contain additional default or random parameter values used by the underlying signature scheme. If the required parameters were not supplied and can be generated by the Signature object, the generated parameters are returned; otherwise null is returned.

However, if the signature scheme does not support returning the parameters as AlgorithmParameters, null is always returned.

Returns:AlgorithmParameters

the parameters used with this Signature object, or null

Annotations
@Override
engineInitSignback to summary
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException

Implements abstract java.security.SignatureSpi.engineInitSign.

Doc from java.security.SignatureSpi.engineInitSign.

Initializes this Signature object with the specified private key for signing operations.

Parameters
privateKey:PrivateKey

the private key of the identity whose signature will be generated.

Annotations
@Override
Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, and so on.
engineInitSignback to summary
protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException

Overrides java.security.SignatureSpi.engineInitSign.

Doc from java.security.SignatureSpi.engineInitSign.

Initializes this Signature object with the specified private key and source of randomness for signing operations.

This concrete method has been added to this previously-defined abstract class. (For backwards compatibility, it cannot be abstract.)

Parameters
privateKey:PrivateKey

the private key of the identity whose signature will be generated.

random:SecureRandom

the source of randomness

Annotations
@Override
Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, and so on.
engineInitVerifyback to summary
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException

Implements abstract java.security.SignatureSpi.engineInitVerify.

Doc from java.security.SignatureSpi.engineInitVerify.

Initializes this Signature object with the specified public key for verification operations.

Parameters
publicKey:PublicKey

the public key of the identity whose signature is going to be verified.

Annotations
@Override
Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, and so on.
engineSetParameterback to summary
protected void engineSetParameter(String param, Object value) throws InvalidParameterException

Implements abstract java.security.SignatureSpi.engineSetParameter.

Doc from java.security.SignatureSpi.engineSetParameter.

Deprecated

Sets the specified algorithm parameter to the specified value. This method supplies a general-purpose mechanism through which it is possible to set the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.

Parameters
param:String

the string identifier of the parameter.

value:Object

the parameter value.

Annotations
@Deprecated
@Override
Exceptions
InvalidParameterException:
if param is an invalid parameter for this Signature object, the parameter is already set and cannot be set again, a security exception occurs, and so on.
engineSetParameterback to summary
protected void engineSetParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException

Overrides java.security.SignatureSpi.engineSetParameter.

Doc from java.security.SignatureSpi.engineSetParameter.

Initializes this Signature object with the specified parameter values.

Parameters
params:AlgorithmParameterSpec

the parameters

Annotations
@Override
Exceptions
InvalidAlgorithmParameterException:
if this method is overridden by a provider and the given parameters are inappropriate for this Signature object
engineSignback to summary
protected byte[] engineSign() throws SignatureException

Implements abstract java.security.SignatureSpi.engineSign.

Doc from java.security.SignatureSpi.engineSign.

Returns the signature bytes of all the data updated so far. The format of the signature depends on the underlying signature scheme.

Returns:byte[]

the signature bytes of the signing operation's result.

Annotations
@Override
Exceptions
SignatureException:
if the engine is not initialized properly or if this signature algorithm is unable to process the input data provided.
engineUpdateback to summary
protected void engineUpdate(byte b) throws SignatureException

Implements abstract java.security.SignatureSpi.engineUpdate.

Doc from java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified using the specified byte.

Parameters
b:byte

the byte to use for the update.

Annotations
@Override
Exceptions
SignatureException:
if the engine is not initialized properly.
engineUpdateback to summary
protected void engineUpdate(byte[] b, int off, int len) throws SignatureException

Implements abstract java.security.SignatureSpi.engineUpdate.

Doc from java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.

Parameters
b:byte[]

the array of bytes

off:int

the offset to start from in the array of bytes

len:int

the number of bytes to use, starting at offset

Annotations
@Override
Exceptions
SignatureException:
if the engine is not initialized properly
engineVerifyback to summary
protected boolean engineVerify(byte[] sigBytes) throws SignatureException

Implements abstract java.security.SignatureSpi.engineVerify.

Doc from java.security.SignatureSpi.engineVerify.

Verifies the passed-in signature.

Parameters
sigBytes:byte[]

the signature bytes to be verified.

Returns:boolean

true if the signature was verified, false if not.

Annotations
@Override
Exceptions
SignatureException:
if the engine is not initialized properly, the passed-in signature is improperly encoded or of the wrong type, if this signature algorithm is unable to process the input data provided, etc.
ensureMessageInitback to summary
private void ensureMessageInit() throws SignatureException
initImplback to summary
private void initImpl(EdDSAParameters params) throws InvalidKeyException
initImplback to summary
private void initImpl(NamedParameterSpec paramSpec) throws InvalidKeyException
initMessageback to summary
private void initMessage() throws SignatureException
sun.security.ec.ed back to summary

private Class EdDSASignature.DigestAccumulator

extends Object
implements MessageAccumulator
Class Inheritance
All Implemented Interfaces
sun.security.ec.ed.EdDSASignature.MessageAccumulator

Field Summary

Modifier and TypeField and Description
private final EdDSAParameters.Digester

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
add(byte[] data, int off, int len)

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.add.

public byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digesterback to summary
private final EdDSAParameters.Digester digester

Constructor Detail

DigestAccumulatorback to summary
pack-priv DigestAccumulator(EdDSAParameters.Digester digester)

Method Detail

addback to summary
public void add(byte b)

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.add.

Annotations
@Override
addback to summary
public void add(byte[] data, int off, int len)

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.add.

Annotations
@Override
getMessageback to summary
public byte[] getMessage()

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.getMessage.

Annotations
@Override
sun.security.ec.ed back to summary

public Class EdDSASignature.Ed25519

extends EdDSASignature
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from sun.security.ec.ed.EdDSASignature:
engineGetParameterengineGetParametersengineInitSignengineInitSignengineInitVerifyengineSetParameterengineSetParameterengineSignengineUpdateengineUpdateengineVerify

Constructor Detail

Ed25519back to summary
public Ed25519()
sun.security.ec.ed back to summary

public Class EdDSASignature.Ed448

extends EdDSASignature
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from sun.security.ec.ed.EdDSASignature:
engineGetParameterengineGetParametersengineInitSignengineInitSignengineInitVerifyengineSetParameterengineSetParameterengineSignengineUpdateengineUpdateengineVerify

Constructor Detail

Ed448back to summary
public Ed448()
sun.security.ec.ed back to summary

private Class EdDSASignature.MemoryAccumulator

extends Object
implements MessageAccumulator
Class Inheritance
All Implemented Interfaces
sun.security.ec.ed.EdDSASignature.MessageAccumulator

Field Summary

Modifier and TypeField and Description
pack-priv ByteArrayOutputStream

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public void
add(byte[] data, int off, int len)

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.add.

public byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

messageback to summary
pack-priv ByteArrayOutputStream message

Constructor Detail

MemoryAccumulatorback to summary
private MemoryAccumulator()

Method Detail

addback to summary
public void add(byte b)

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.add.

Annotations
@Override
addback to summary
public void add(byte[] data, int off, int len)

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.add.

Annotations
@Override
getMessageback to summary
public byte[] getMessage()

Implements sun.security.ec.ed.EdDSASignature.MessageAccumulator.getMessage.

Annotations
@Override
sun.security.ec.ed back to summary

private Interface EdDSASignature.MessageAccumulator

Known Direct Implementers
sun.security.ec.ed.EdDSASignature.DigestAccumulator, sun.security.ec.ed.EdDSASignature.MemoryAccumulator

Method Summary

Modifier and TypeMethod and Description
public void
add(byte b)

public void
add(byte[] data, int off, int len)

public byte[]

Method Detail

addback to summary
public void add(byte b)
addback to summary
public void add(byte[] data, int off, int len)
getMessageback to summary
public byte[] getMessage()