Class SHA224withECDSA

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

public final class SHA224withECDSA extends SignatureSpi
This class provides an implementation of the Service Provider Interface (SPI) for the Signature class, which is used to provide the functionality of a digital signature algorithm. Digital signatures are used for authentication and integrity assurance of digital data. The data will be hashed using the SHA224 Secure Hashing Algorithm prior to signature generation.
  • Constructor Details

    • SHA224withECDSA

      public SHA224withECDSA() throws NoSuchAlgorithmException
      Construct a signature object for the Elliptic Curve digital signature algorithm with SHA224 message digest. It must be initialized before it can be used for signing or verifying.
      Throws:
      NoSuchAlgorithmException - if the message digest algorithm can not be found
  • Method Details

    • engineInitSign

      protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
      Initializes this signature object with the specified Elliptic Curve private key for signing operations.
      Specified by:
      engineInitSign in class SignatureSpi
      Parameters:
      privateKey - the Elliptic Curve private key of the identity whose signature will be generated
      Throws:
      InvalidKeyException - if the key is improperly encoded, parameters are missing, and so on
    • engineInitVerify

      protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
      Initializes this signature object with the specified Elliptic Curve public key for verification operations.
      Specified by:
      engineInitVerify in class SignatureSpi
      Parameters:
      publicKey - the Elliptic Curve public key of the identity whose signature is going to be verified
      Throws:
      InvalidKeyException - if the key is improperly encoded, parameters are missing, and so on
    • 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 - if the engine is not initialized properly
    • 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:
      b - 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:
      NullPointerException - if the array of bytes is null
      IndexOutOfBoundsException - if off and len values are not appropriate for the specified array of bytes
      SignatureException - if the engine is not initialized properly
    • 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:
      sigBytes - the signature bytes to be verified
      Returns:
      true if the signature was verified, false if not
      Throws:
      NullPointerException - if signature bytes to be verified is null
      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
    • engineGetParameter

      @Deprecated protected Object engineGetParameter(String param) throws InvalidParameterException
      Deprecated.
      Gets the value of the specified algorithm parameter. This method has no meaning for this provider.
      Specified by:
      engineGetParameter in class SignatureSpi
      Throws:
      UnsupportedOperationException - is always thrown
      InvalidParameterException
    • engineSetParameter

      @Deprecated protected void engineSetParameter(String param, Object value) throws InvalidParameterException
      Deprecated.
      Sets the specified algorithm parameter to the specified value. This method has no meaning for this provider.
      Specified by:
      engineSetParameter in class SignatureSpi
      Throws:
      UnsupportedOperationException - is always thrown
      InvalidParameterException