com.ibm.crypto.hdwrCCA.provider

Class SHA1withDSA

  • java.lang.Object
    • java.security.SignatureSpi
      • com.ibm.crypto.hdwrCCA.provider.SHA1withDSA


  • public class SHA1withDSA
    extends java.security.SignatureSpi
    This class is a concrete implementation for DSA signing with SHA1.
    • Field Summary

      • Fields inherited from class java.security.SignatureSpi

        appRandom
    • Constructor Summary

      Constructors 
      Constructor and Description
      SHA1withDSA()
      Constructs a new instance of this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      protected java.lang.Object engineGetParameter(java.lang.String param)
      Deprecated.  
      protected void engineInitSign(java.security.PrivateKey privateKey)
      Initialize the receiver with the specified private key, to be used for signing purposes.
      protected void engineInitVerify(java.security.PublicKey publicKey)
      Initialize the receiver with the specified public key, to be used for verification purposes.
      protected void engineSetParameter(java.lang.String param, java.lang.Object value)
      Deprecated.  
      protected byte[] engineSign()
      Get message digest for all the data thus far updated, then sign the message digest.
      protected void engineUpdate(byte b)
      Update the bytes signed so far with the extra byte provided.
      protected void engineUpdate(byte[] buffer, int offset, int length)
      Update the bytes signed so far with the extra bytes provided.
      protected boolean engineVerify(byte[] sigBytes)
      Verifies the passed signature.
      java.lang.String toString()
      Answers a string containing a concise, human-readable description of the receiver.
      • Methods inherited from class java.security.SignatureSpi

        clone, engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate, engineVerify
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SHA1withDSA

        public SHA1withDSA()
                    throws java.security.NoSuchAlgorithmException,
                           java.security.NoSuchProviderException
        Constructs a new instance of this class.
        Throws:
        java.security.NoSuchAlgorithmException - is thrown when the Algorithm can not be found.
        java.security.NoSuchProviderException - is thrown when the provider can not be found.
    • Method Detail

      • engineGetParameter

        protected java.lang.Object engineGetParameter(java.lang.String param)
                                               throws java.lang.UnsupportedOperationException
        Deprecated. 
        Have to implement Signature's abstract method engineSetParameter to be a concrete class. However, this method has no meaning for this provider.
        Specified by:
        engineGetParameter in class java.security.SignatureSpi
        Throws:
        java.lang.UnsupportedOperationException - is always thrown.
      • engineInitSign

        protected void engineInitSign(java.security.PrivateKey privateKey)
                               throws java.security.InvalidKeyException
        Initialize the receiver with the specified private key, to be used for signing purposes.
        Specified by:
        engineInitSign in class java.security.SignatureSpi
        Parameters:
        privateKey - the key to be used when signing.
        Throws:
        java.security.InvalidKeyException - if the specified key is not a valid DSA private key (improperly encoded, parameters missing, etc).
      • engineInitVerify

        protected void engineInitVerify(java.security.PublicKey publicKey)
                                 throws java.security.InvalidKeyException
        Initialize the receiver with the specified public key, to be used for verification purposes.
        Specified by:
        engineInitVerify in class java.security.SignatureSpi
        Parameters:
        publicKey - the key to be used when verifying.
        Throws:
        java.security.InvalidKeyException - if the specified key is not valid (improperly encoded, parameters missing, etc).
      • engineSetParameter

        protected void engineSetParameter(java.lang.String param,
                                          java.lang.Object value)
                                   throws java.lang.UnsupportedOperationException
        Deprecated. 
        Have to implement Signature's abstract method engineGetParameter to be a concrete class. However, this method has no meaning for this provider.
        Specified by:
        engineSetParameter in class java.security.SignatureSpi
        Throws:
        java.lang.UnsupportedOperationException - is always thrown.
      • engineSign

        protected byte[] engineSign()
                             throws java.security.SignatureException
        Get message digest for all the data thus far updated, then sign the message digest.
        Specified by:
        engineSign in class java.security.SignatureSpi
        Returns:
        the signature bytes of the data updated so far.
        Throws:
        java.security.SignatureException - if the engine is not initialized properly.
      • engineUpdate

        protected void engineUpdate(byte b)
                             throws java.security.SignatureException
        Update the bytes signed so far with the extra byte provided.
        Specified by:
        engineUpdate in class java.security.SignatureSpi
        Parameters:
        b - the extra byte to be signed.
        Throws:
        java.security.SignatureException - if the receiver is not initialized properly.
      • engineUpdate

        protected void engineUpdate(byte[] buffer,
                                    int offset,
                                    int length)
                             throws java.security.SignatureException
        Update the bytes signed so far with the extra bytes provided.
        Specified by:
        engineUpdate in class java.security.SignatureSpi
        Parameters:
        buffer - the extra bytes to be signed.
        offset - offset in the buffer where to start getting bytes for signing.
        length - how many bytes to get for signing.
        Throws:
        java.security.SignatureException - if the receiver is not initialized properly.
      • engineVerify

        protected boolean engineVerify(byte[] sigBytes)
                                throws java.security.SignatureException
        Verifies the passed signature.
        Specified by:
        engineVerify in class java.security.SignatureSpi
        Parameters:
        sigBytes - the signature bytes to verify.
        Returns:
        returns true if the signature was verified successfully, false otherwise.
        Throws:
        java.security.SignatureException - if the receiver is not initialized properly or if the key is not encoded properly.
      • toString

        public java.lang.String toString()
        Answers a string containing a concise, human-readable description of the receiver.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a printable representation for the receiver.
� Portions Copyright 1997, 2022 IBM Corporation. All rights reserved. � Portions Copyright 1997, 2022, Oracle and/or its affiliates. All rights reserved.