public boolean isValid() {
		NodeList nodes = xmlDoc.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature");

		if (nodes == null || nodes.getLength() == 0) {
			logger.debug("Can't find signature in document");
			return false;
		}

		if (setIdAttributeExists()) {
			tagIdAttributes(xmlDoc);
		}

		X509Certificate cert = certificate.getX509Cert();
		DOMValidateContext ctx = new DOMValidateContext(cert.getPublicKey(), nodes.item(0));
		XMLSignatureFactory sigF = XMLSignatureFactory.getInstance("DOM");

		XMLSignature xmlSignature;
		try {
			xmlSignature = sigF.unmarshalXMLSignature(ctx);
		} catch (Exception e) {
			logger.debug("Could not unmarshalXMLSignature", e);
			xmlSignature = null;
		}
		if (xmlSignature == null) {
			return false;
		}
		try {
			return xmlSignature.validate(ctx);
		} catch (XMLSignatureException e) {
			logger.debug("Could not validate signature", e);
		}
		return false;
	}
public boolean isValid ( ) { NodeList nodes = xmlDoc . getElementsByTagNameNS ( XMLSignature . XMLNS , "Signature" ) ; if ( nodes == null || nodes . getLength ( ) == 0 ) { logger . debug ( "Can't find signature in document" ) ; return false ; } if ( setIdAttributeExists ( ) ) { tagIdAttributes ( xmlDoc ) ; } X509Certificate cert = certificate . getX509Cert ( ) ; DOMValidateContext ctx = new DOMValidateContext ( cert . getPublicKey ( ) , nodes . item ( 0 ) ) ; XMLSignatureFactory sigF = XMLSignatureFactory . getInstance ( "DOM" ) ; XMLSignature xmlSignature ; try { xmlSignature = sigF . unmarshalXMLSignature ( ctx ) ; } catch ( Exception e ) { logger . debug ( "Could not unmarshalXMLSignature" , e ) ; xmlSignature = null ; } if ( xmlSignature == null ) { return false ; } try { return xmlSignature . validate ( ctx ) ; } catch ( XMLSignatureException e ) { logger . debug ( "Could not validate signature" , e ) ; } return false ; }
Check if the XML response provided by the IDP is valid or not

@return boolean whether the response is valid or not
@throws Exception