Class DilithiumSignature
java.lang.Object
java.security.SignatureSpi
com.ibm.crypto.hdwrCCA.provider.DilithiumSignature
This class is a concrete implementation for CRYSTALS-Dilithium signing.
-
Field Summary
Fields inherited from class SignatureSpi
appRandom -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectengineGetParameter(String param) Gets the value of the specified algorithm parameter.protected voidengineInitSign(PrivateKey privateKey) Initialize the signature object with a CRYSTALS-Dilithium private key.protected voidengineInitVerify(PublicKey publicKey) Initialize the signature object with a Dilithium public key.protected voidengineSetParameter(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 voidengineUpdate(byte b) Updates the data to be signed or verified using the specified byte.protected voidengineUpdate(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 booleanengineVerify(byte[] sigBytes) Verifies the passed-in signature.Methods inherited from class SignatureSpi
clone, engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate, engineVerify
-
Constructor Details
-
DilithiumSignature
public DilithiumSignature()Creates a new instance of this class.
-
-
Method Details
-
engineInitVerify
Initialize the signature object with a Dilithium public key.- Specified by:
engineInitVerifyin classSignatureSpi- Parameters:
publicKey- the Dilithium public key- Throws:
InvalidKeyException- ifpublicKeyis not a valid CRYSTALS-Dilithium public key.
-
engineInitSign
Initialize the signature object with a CRYSTALS-Dilithium private key.- Specified by:
engineInitSignin classSignatureSpi- Parameters:
privateKey- the Dilithium private key- Throws:
InvalidKeyException- ifprivateKeyis not a valid CRYSTALS-Dilithium private key.
-
engineUpdate
Updates the data to be signed or verified using the specified byte.- Specified by:
engineUpdatein 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:
engineUpdatein classSignatureSpi- Parameters:
off- the offset to start from in the array of byteslen- the number of bytes to use, starting at offsetbuff- the array of bytes- Throws:
SignatureException
-
engineSign
Returns the signature bytes of all the data updated so far.- Specified by:
engineSignin 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:
engineVerifyin 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:
engineSetParameterin classSignatureSpi- Parameters:
param- the parameter valuekey- the string identifier of the parameter- 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:
engineGetParameterin classSignatureSpi- Parameters:
key- the string name of the parameter- Throws:
UnsupportedOperationException- is always thrown.InvalidParameterException
-