Top Fields Constructors Methods
org.bouncycastle.jcajce.provider.asymmetric.util

public abstract Class BaseDeterministicOrRandomSignature

extends Signature
Class Inheritance
Known Direct Subclasses
org.bouncycastle.jcajce.provider.asymmetric.mldsa.HashSignatureSpi, org.bouncycastle.jcajce.provider.asymmetric.mldsa.SignatureSpi, org.bouncycastle.jcajce.provider.asymmetric.slhdsa.HashSignatureSpi, org.bouncycastle.jcajce.provider.asymmetric.slhdsa.SignatureSpi
Imports
java.security.AlgorithmParameters, .InvalidAlgorithmParameterException, .InvalidKeyException, .PrivateKey, .ProviderException, .PublicKey, .SecureRandom, .Signature, .SignatureException, java.security.spec.AlgorithmParameterSpec, org.bouncycastle.crypto.CipherParameters, org.bouncycastle.crypto.params.AsymmetricKeyParameter, .ParametersWithContext, .ParametersWithRandom, org.bouncycastle.jcajce.spec.ContextParameterSpec, org.bouncycastle.jcajce.util.BCJcaJceHelper, .JcaJceHelper, org.bouncycastle.util.Exceptions

Field Summary

Modifier and TypeField and Description
protected AlgorithmParameters
private final JcaJceHelper
protected boolean
protected AsymmetricKeyParameter
private final AlgorithmParameterSpec
protected ContextParameterSpec
Inherited from java.security.Signature:
SIGNstateUNINITIALIZEDVERIFY

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected final Object
engineGetParameter(String
the string name of the parameter.
param
)

Implements abstract java.security.SignatureSpi.engineGetParameter.

Deprecated replaced with engineGetParameters()

Gets the value of the specified algorithm parameter.

protected final AlgorithmParameters
engineGetParameters()

Overrides java.security.SignatureSpi.engineGetParameters.

Returns the parameters used with this Signature object.

protected final 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 final 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 final 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(AlgorithmParameterSpec
the parameters
params
)

Overrides java.security.SignatureSpi.engineSetParameter.

Initializes this Signature object with the specified parameter values.

protected final void
engineSetParameter(String
the string identifier of the parameter.
param
,
Object
the parameter value.
value
)

Implements abstract java.security.SignatureSpi.engineSetParameter.

Sets the specified algorithm parameter to the specified value.

protected final 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 final 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.

private void
protected abstract void
reInitialize(boolean forSigning, CipherParameters params)

protected abstract void
signInit(PrivateKey privateKey, SecureRandom random)

protected abstract void
updateEngine(byte b)

protected abstract void
updateEngine(byte[] buf, int off, int len)

protected abstract void
verifyInit(PublicKey publicKey)

Inherited from java.security.Signature:
clonegetAlgorithmgetInstancegetInstancegetInstancegetParametergetParametersgetProviderinitSigninitSigninitVerifyinitVerifysetParametersetParametersignsigntoStringupdateupdateupdateupdateverifyverify

Field Detail

engineParamsback to summary
protected AlgorithmParameters engineParams
helperback to summary
private final JcaJceHelper helper
isInitStateback to summary
protected boolean isInitState
keyParamsback to summary
protected AsymmetricKeyParameter keyParams
originalSpecback to summary
private final AlgorithmParameterSpec originalSpec
paramSpecback to summary
protected ContextParameterSpec paramSpec

Constructor Detail

BaseDeterministicOrRandomSignatureback to summary
protected BaseDeterministicOrRandomSignature(String name)

Method Detail

engineGetParameterback to summary
protected final Object engineGetParameter(String param)

Implements abstract java.security.SignatureSpi.engineGetParameter.

Doc from java.security.SignatureSpi.engineGetParameter.

Deprecated

replaced with engineGetParameters()

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.

engineGetParametersback to summary
protected final 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

engineInitSignback to summary
protected final 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.

Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, and so on.
engineInitSignback to summary
protected final 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

Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, and so on.
engineInitVerifyback to summary
protected final 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.

Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, 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

Exceptions
InvalidAlgorithmParameterException:
if this method is overridden by a provider and the given parameters are inappropriate for this Signature object
engineSetParameterback to summary
protected final void engineSetParameter(String param, Object value)

Implements abstract java.security.SignatureSpi.engineSetParameter.

Doc from java.security.SignatureSpi.engineSetParameter.

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.

engineUpdateback to summary
protected final 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.

Exceptions
SignatureException:
if the engine is not initialized properly.
engineUpdateback to summary
protected final 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

Exceptions
SignatureException:
if the engine is not initialized properly
reInitback to summary
private void reInit()
reInitializeback to summary
protected abstract void reInitialize(boolean forSigning, CipherParameters params)
signInitback to summary
protected abstract void signInit(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException
updateEngineback to summary
protected abstract void updateEngine(byte b) throws SignatureException
updateEngineback to summary
protected abstract void updateEngine(byte[] buf, int off, int len) throws SignatureException
verifyInitback to summary
protected abstract void verifyInit(PublicKey publicKey) throws InvalidKeyException