public boolean isSignatureValid(String signature,String data){
  if (!signature.isEmpty()) {
    RSATool tool=RSAToolFactory.getRSATool();
    RSAKey thePublicKey=new RSAKeyImpl(theCertificate.getPublicKey());
    try {
      String hash=DigestUtils.sha256Hex(data);
      return tool.verifyWithKey(StringUtils.getBytesUtf8(hash),Base64.decode(signature),thePublicKey);
    }
 catch (    Exception e) {
      log.error("Unable to verify signature",e);
    }
  }
  return false;
}

public boolean isSignatureValid ( String signature , String data ) { if ( ! signature . isEmpty ( ) ) { RSATool tool = RSAToolFactory . getRSATool ( ) ; RSAKey thePublicKey = new RSAKeyImpl ( theCertificate . getPublicKey ( ) ) ; try { String hash = DigestUtils . sha256Hex ( data ) ; return tool . verifyWithKey ( StringUtils . getBytesUtf8 ( hash ) , Base64 . decode ( signature ) , thePublicKey ) ; } catch ( Exception e ) { log . error ( "Unable to verify signature" , e ) ; } } return false ; }
checks given signature for given data against this certificate , ensuring it is properly signed
