Class MLDSASignature

java.lang.Object
java.security.SignatureSpi
com.ibm.crypto.hdwrCCA.provider.MLDSASignature

public class MLDSASignature extends SignatureSpi
This class is a concrete implementation for ML-DSA signing.
  • Constructor Details

    • MLDSASignature

      public MLDSASignature()
      Creates a new instance of this class.
  • Method Details

    • engineInitSign

      protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
      Initialize the signature object with a ML-DSA private key.
      Specified by:
      engineInitSign in class SignatureSpi
      Parameters:
      privateKey - the ML-DSA private key
      Throws:
      InvalidKeyException - if privateKey is not a valid ML-DSA private key.
    • engineInitVerify

      protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
      Initialize the signature object with a ML-DSA public key.
      Specified by:
      engineInitVerify in class SignatureSpi
      Parameters:
      publicKey - the ML-DSA public key
      Throws:
      InvalidKeyException - if publicKey is not a valid ML-DSA public key.
    • engineUpdate

      protected void engineUpdate(byte b) throws SignatureException
      Updates the data to be signed or verified using the specified byte.
      Specified by:
      engineUpdate in class SignatureSpi
      Parameters:
      b - the byte to use for the update
      Throws:
      SignatureException
    • engineUpdate

      protected void engineUpdate(byte[] b, int off, int len) throws SignatureException
      Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
      Specified by:
      engineUpdate in class SignatureSpi
      Parameters:
      buff - the array of bytes
      off - the offset to start from in the array of bytes
      len - the number of bytes to use, starting at offset
      Throws:
      SignatureException
    • engineSign

      protected byte[] engineSign() throws SignatureException
      Returns the signature bytes of all the data updated so far.
      Specified by:
      engineSign in class SignatureSpi
      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

      protected boolean engineVerify(byte[] sigBytes) throws SignatureException
      Verifies the passed-in signature.
      Specified by:
      engineVerify in class SignatureSpi
      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

      protected void engineSetParameter(String param, Object value) throws InvalidParameterException
      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 class SignatureSpi
      Parameters:
      key - the string identifier of the parameter
      param - the parameter value
      Throws:
      UnsupportedOperationException - is always thrown.
      InvalidParameterException
    • engineGetParameter

      protected Object engineGetParameter(String param) throws InvalidParameterException
      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 class SignatureSpi
      Parameters:
      key - the string name of the parameter
      Throws:
      UnsupportedOperationException - is always thrown.
      InvalidParameterException