java.lang.Object
java.security.SignatureSpi
com.ibm.crypto.hdwrCCA.provider.MLDSASignature
This class is a concrete implementation for ML-DSA signing.
-
Field Summary
Fields inherited from class java.security.SignatureSpi
appRandom
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
engineGetParameter
(String param) Gets the value of the specified algorithm parameter.protected void
engineInitSign
(PrivateKey privateKey) Initialize the signature object with a ML-DSA private key.protected void
engineInitVerify
(PublicKey publicKey) Initialize the signature object with a ML-DSA public key.protected void
engineSetParameter
(String param, Object value) Sets the specified algorithm parameter to the specified value.protected byte[]
Returns the signature bytes of all the data updated so far.protected void
engineUpdate
(byte b) Updates the data to be signed or verified using the specified byte.protected void
engineUpdate
(byte[] b, int off, int len) Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.protected boolean
engineVerify
(byte[] sigBytes) Verifies the passed-in signature.Methods inherited from class java.security.SignatureSpi
clone, engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate, engineVerify
-
Constructor Details
-
MLDSASignature
public MLDSASignature()Creates a new instance of this class.
-
-
Method Details
-
engineInitSign
Initialize the signature object with a ML-DSA private key.- Specified by:
engineInitSign
in classSignatureSpi
- Parameters:
privateKey
- the ML-DSA private key- Throws:
InvalidKeyException
- ifprivateKey
is not a valid ML-DSA private key.
-
engineInitVerify
Initialize the signature object with a ML-DSA public key.- Specified by:
engineInitVerify
in classSignatureSpi
- Parameters:
publicKey
- the ML-DSA public key- Throws:
InvalidKeyException
- ifpublicKey
is not a valid ML-DSA public key.
-
engineUpdate
Updates the data to be signed or verified using the specified byte.- Specified by:
engineUpdate
in classSignatureSpi
- Parameters:
b
- the byte to use for the update- Throws:
SignatureException
-
engineUpdate
Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.- Specified by:
engineUpdate
in classSignatureSpi
- Parameters:
buff
- the array of bytesoff
- the offset to start from in the array of byteslen
- the number of bytes to use, starting at offset- Throws:
SignatureException
-
engineSign
Returns the signature bytes of all the data updated so far.- Specified by:
engineSign
in classSignatureSpi
- Returns:
- the signature bytes of the signing operation's result.
- Throws:
SignatureException
- if the engine is not initialized properly or if this signature algorithm is unable to process the input data provided.
-
engineVerify
Verifies the passed-in signature.- Specified by:
engineVerify
in classSignatureSpi
- Parameters:
signature
- the signature bytes to be verified- Returns:
- true if the signature was verified, false if not.
- Throws:
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.
-
engineSetParameter
Sets the specified algorithm parameter to the specified value. Please note that this method has no meaning for this provider and has been deprecated.- Specified by:
engineSetParameter
in classSignatureSpi
- Parameters:
key
- the string identifier of the parameterparam
- the parameter value- Throws:
UnsupportedOperationException
- is always thrown.InvalidParameterException
-
engineGetParameter
Gets the value of the specified algorithm parameter. Please note that this method has no meaning for this provider, and has been deprecated.- Specified by:
engineGetParameter
in classSignatureSpi
- Parameters:
key
- the string name of the parameter- Throws:
UnsupportedOperationException
- is always thrown.InvalidParameterException
-