private boolean validateSender(Document signedDocument, PublicKey publicKey) throws ProcessingException { try { return XMLSignatureUtil.validate(signedDocument, publicKey); } catch (Exception e) { log.error("Error validating signature:", e); throw new ProcessingException(ErrorCodes.INVALID_DIGITAL_SIGNATURE + "Error validating signature."); } }
private boolean validateSender(Document signedDocument, PublicKey publicKey) throws ProcessingException { try { return XMLSignatureUtil.validate(signedDocument, publicKey); } catch (Exception e) { log.error("Error validating signature:", e); throw new ProcessingException(ErrorCodes.INVALID_DIGITAL_SIGNATURE + "Error validating signature."); } }
/** * Given an assertion element, validate the signature * @param assertionElement * @param publicKey the {@link PublicKey} * @return */ public static boolean isSignatureValid(Element assertionElement, PublicKey publicKey) { try { Document doc = DocumentUtil.createDocument(); Node n = doc.importNode(assertionElement, true); doc.appendChild(n); return XMLSignatureUtil.validate(doc, publicKey); } catch (Exception e) { log.error("Cannot validate signature of assertion", e); } return false; }
/** * Given an assertion element, validate the signature * @param assertionElement * @param publicKey the {@link PublicKey} * @return */ public static boolean isSignatureValid(Element assertionElement, PublicKey publicKey) { try { Document doc = DocumentUtil.createDocument(); Node n = doc.importNode(assertionElement, true); doc.appendChild(n); return XMLSignatureUtil.validate(doc, publicKey); } catch (Exception e) { log.error("Cannot validate signature of assertion", e); } return false; }
public void validateSignatureForPostBinding(SamlIdentityProvider idp, Document document) throws InvalidRequestException { boolean signatureValid; try { signatureValid = XMLSignatureUtil.validate(document, idp.getPublicKey()); } catch (MarshalException e) { throw new RuntimeException(e); } catch (XMLSignatureException e) { throw new RuntimeException(e); } if (!signatureValid) { throw new InvalidRequestException("Invalid signature"); } }
if (trace) log.trace("Going to verify signature in the saml response from IDP"); boolean sigResult = XMLSignatureUtil.validate(samlResponse, publicKey); if (trace) log.trace("Signature verification=" + sigResult);
if (trace) log.trace("Going to verify signature in the saml response from IDP"); boolean sigResult = XMLSignatureUtil.validate(samlResponse, publicKey); if (trace) log.trace("Signature verification=" + sigResult);
PublicKey publicKey = keyManager.getValidatingKey(issuerURL.getHost()); log.trace("Going to verify signature in the saml response from IDP"); //$NON-NLS-1$ boolean sigResult = XMLSignatureUtil.validate(samlResponse, publicKey); log.trace("Signature verification=" + sigResult); //$NON-NLS-1$ return sigResult;
PublicKey publicKey = keyManager.getValidatingKey(issuerURL.getHost()); log.trace("Going to verify signature in the saml response from IDP"); boolean sigResult = XMLSignatureUtil.validate(samlResponse, publicKey); log.trace("Signature verification=" + sigResult); return sigResult;
boolean sigResult = XMLSignatureUtil.validate(samlResponse, publicKey); log.trace("Signature verification=" + sigResult); return sigResult;
boolean sigResult = XMLSignatureUtil.validate(samlResponse, publicKey); log.trace("Signature verification=" + sigResult); return sigResult;
/** * Validate the SAML2 Document * @param signedDocument * @param publicKey * @return * @throws ProcessingException */ public boolean validate(Document signedDocument, PublicKey publicKey) throws ProcessingException { try { return XMLSignatureUtil.validate(signedDocument, publicKey); } catch (MarshalException me) { throw new ProcessingException(me.getLocalizedMessage()); } catch (XMLSignatureException xse) { throw new ProcessingException(xse.getLocalizedMessage()); } } }
/** * Validate the SAML2 Document * * @param signedDocument * @param publicKey * @return * @throws ProcessingException */ public boolean validate(Document signedDocument, PublicKey publicKey) throws ProcessingException { try { configureIdAttribute(signedDocument); return XMLSignatureUtil.validate(signedDocument, publicKey); } catch (MarshalException me) { throw new ProcessingException(logger.signatureError(me)); } catch (XMLSignatureException xse) { throw new ProcessingException(logger.signatureError(xse)); } }
/** * Validate the SAML2 Document * * @param signedDocument * @param publicKey * * @return * * @throws ProcessingException */ public boolean validate(Document signedDocument, PublicKey publicKey) throws ProcessingException { try { configureIdAttribute(signedDocument); return XMLSignatureUtil.validate(signedDocument, publicKey); } catch (MarshalException me) { throw new ProcessingException(logger.signatureError(me)); } catch (XMLSignatureException xse) { throw new ProcessingException(logger.signatureError(xse)); } }
/** * Validate the SAML2 Document * * @param signedDocument * @param publicKey * * @return * * @throws ProcessingException */ public boolean validate(Document signedDocument, PublicKey publicKey) throws ProcessingException { try { configureIdAttribute(signedDocument); return XMLSignatureUtil.validate(signedDocument, publicKey); } catch (MarshalException me) { throw new ProcessingException(logger.signatureError(me)); } catch (XMLSignatureException xse) { throw new ProcessingException(logger.signatureError(xse)); } }
Document tokenDocument = DocumentUtil.createDocument(); tokenDocument.appendChild(tokenDocument.importNode(tokenElement, true)); logger.trace("valid=" + XMLSignatureUtil.validate(tokenDocument, keyPair.getPublic()));
Document tokenDocument = DocumentUtil.createDocument(); tokenDocument.appendChild(tokenDocument.importNode(tokenElement, true)); logger.trace("valid=" + XMLSignatureUtil.validate(tokenDocument, keyPair.getPublic()));
tokenDocument.appendChild(importedNode); XMLSignatureUtil.propagateIDAttributeSetup(securityToken, tokenDocument.getDocumentElement()); if (!XMLSignatureUtil.validate(tokenDocument, keyPair.getPublic())) { status = new StatusType(); status.setCode(WSTrustConstants.STATUS_CODE_INVALID);
tokenDocument.appendChild(importedNode); XMLSignatureUtil.propagateIDAttributeSetup(securityToken, tokenDocument.getDocumentElement()); if (!XMLSignatureUtil.validate(tokenDocument, keyPair.getPublic())) { status = new StatusType(); status.setCode(WSTrustConstants.STATUS_CODE_INVALID);
tokenDocument.appendChild(importedNode); XMLSignatureUtil.propagateIDAttributeSetup(securityToken, tokenDocument.getDocumentElement()); if (!XMLSignatureUtil.validate(tokenDocument, keyPair.getPublic())) throw new WSTrustException(logger.signatureInvalidError("Validation failure during renewal", null)); } catch (Exception e) {