public boolean verifySignature(byte[] signature){
  if (forSigning) {
    throw new IllegalStateException("GenericSigner not initialised for verification");
  }
  byte[] hash=new byte[digest.getDigestSize()];
  digest.doFinal(hash,0);
  try {
    byte[] sig=engine.processBlock(signature,0,signature.length);
    if (sig.length < hash.length) {
      byte[] tmp=new byte[hash.length];
      System.arraycopy(sig,0,tmp,tmp.length - sig.length,sig.length);
      sig=tmp;
    }
    return Arrays.constantTimeAreEqual(sig,hash);
  }
 catch (  Exception e) {
    return false;
  }
}

public boolean verifySignature ( byte [ ] signature ) { if ( forSigning ) { throw new IllegalStateException ( "GenericSigner not initialised for verification" ) ; } byte [ ] hash = new byte [ digest . getDigestSize ( ) ] ; digest . doFinal ( hash , 0 ) ; try { byte [ ] sig = engine . processBlock ( signature , 0 , signature . length ) ; if ( sig . length < hash . length ) { byte [ ] tmp = new byte [ hash . length ] ; System . arraycopy ( sig , 0 , tmp , tmp . length - sig . length , sig . length ) ; sig = tmp ; } return Arrays . constantTimeAreEqual ( sig , hash ) ; } catch ( Exception e ) { return false ; } }
return true if the internal state represents the signature described in the passed in array .
