Class SHA1withDSA_SignatureImpl

java.lang.Object
java.security.SignatureSpi
java.security.Signature
org.apache.harmony.security.provider.crypto.SHA1withDSA_SignatureImpl

public class SHA1withDSA_SignatureImpl
extends Signature
  • Constructor Details

  • Method Details

    • engineGetParameter

      protected Object engineGetParameter​(String param) throws InvalidParameterException
      Deprecated method.
      Specified by:
      engineGetParameter in class SignatureSpi
      Parameters:
      param - the name of the requested parameter value.
      Returns:
      null
      Throws:
      InvalidParameterException - if param is not a valid parameter for this SignatureSpi or an other error occurs.
    • engineInitSign

      protected void engineInitSign​(PrivateKey privateKey) throws InvalidKeyException
      Initializes this signature object with PrivateKey object passed as argument to the method.
      Specified by:
      engineInitSign in class SignatureSpi
      Parameters:
      privateKey - the private key.
      Throws:
      InvalidKeyException - if privateKey is not DSAPrivateKey object
    • engineInitVerify

      protected void engineInitVerify​(PublicKey publicKey) throws InvalidKeyException
      Initializes this signature object with PublicKey object passed as argument to the method.
      Specified by:
      engineInitVerify in class SignatureSpi
      Parameters:
      publicKey - the public key.
      Throws:
      InvalidKeyException - if publicKey is not DSAPublicKey object
    • engineSetParameter

      protected void engineSetParameter​(String param, Object value) throws InvalidParameterException
      Description copied from class: SignatureSpi
      Sets the specified parameter to the given value.
      Specified by:
      engineSetParameter in class SignatureSpi
      Parameters:
      param - the name of the parameter.
      value - the parameter value.
      Throws:
      InvalidParameterException - if the parameter is invalid, already set or is not allowed to be changed.
    • engineSign

      protected byte[] engineSign() throws SignatureException
      Returns signature bytes as byte array containing ASN1 representation for two BigInteger objects which is SEQUENCE of two INTEGERS. Length of sequence varies from less than 46 to 48. Resets object to the state it was in when previous call to either "initSign" method was called.
      Specified by:
      engineSign in class SignatureSpi
      Returns:
      byte array containing signature in ASN1 representation
      Throws:
      SignatureException - if object's state is not SIGN or signature algorithm cannot process data
    • engineUpdate

      protected void engineUpdate​(byte b) throws SignatureException
      Updates data to sign or to verify.
      Specified by:
      engineUpdate in class SignatureSpi
      Parameters:
      b - the byte to update with.
      Throws:
      SignatureException - if object was not initialized for signing or verifying
    • engineUpdate

      protected void engineUpdate​(byte[] b, int off, int len) throws SignatureException
      Updates data to sign or to verify.
      Specified by:
      engineUpdate in class SignatureSpi
      Parameters:
      b - the byte array to update with.
      off - the start index in b of the data.
      len - the number of bytes to use.
      Throws:
      SignatureException - if object was not initialized for signing or verifying
    • engineVerify

      protected boolean engineVerify​(byte[] sigBytes) throws SignatureException
      Verifies the signature bytes.
      Specified by:
      engineVerify in class SignatureSpi
      Parameters:
      sigBytes - the signature to verify.
      Returns:
      true if signature bytes were verified, false otherwise
      Throws:
      SignatureException - if object's state is not VERIFY or signature format is not ASN1 representation or signature algorithm cannot process data
    • engineVerify

      protected boolean engineVerify​(byte[] sigBytes, int offset, int length) throws SignatureException
      Verifies the signature bytes.
      Overrides:
      engineVerify in class SignatureSpi
      Parameters:
      sigBytes - the byte[] containing the signature to verify.
      offset - the start index in sigBytes of the signature
      length - the number of bytes allocated for the signature.
      Returns:
      true if signature bytes were verified, false otherwise
      Throws:
      SignatureException - if object's state is not VERIFY or signature format is not ASN1 representation or signature algorithm cannot process data