Package org.opensaml.xml.validation

Examples of org.opensaml.xml.validation.ValidationException


     * @param evidence
     * @throws ValidationException
     */
    protected void validateEvidence(Evidence evidence) throws ValidationException {
        if (evidence.getEvidence().size() == 0) {
            throw new ValidationException("At least one Assertion or AssertionIDReference is required");
        }   
    }
View Full Code Here


        XMLSignature xmlSig = buildSignature(signature);

        Key validationKey = SecurityHelper.extractVerificationKey(validationCredential);
        if (validationKey == null) {
            log.debug("Supplied credential contained no key suitable for signature validation");
            throw new ValidationException("No key available to validate signature");
        }
       
        log.debug("Validating signature with signature algorithm URI: {}", signature.getSignatureAlgorithm());
        log.debug("Validation credential key algorithm '{}', key instance class '{}'",
                validationKey.getAlgorithm(), validationKey.getClass().getName());

        try {
            if (xmlSig.checkSignatureValue(validationKey)) {
                log.debug("Signature validated with key from supplied credential");
                return;
            }
        } catch (XMLSignatureException e) {
            throw new ValidationException("Unable to evaluate key against signature", e);
        }

        log.debug("Signature did not validate against the credential's key");

        throw new ValidationException("Signature did not validate against the credential's key");
    }
View Full Code Here

     * @throws ValidationException thrown if the content of the Base64Binary object is invalid
     */
    protected void validateIntegerContent(T xmlObject) throws ValidationException {
        if (! isAllowEmptyContent()) {
            if (xmlObject.getValue() == null) {
                throw new ValidationException("Integer content may not be empty");
            }
        }
    }
View Full Code Here

     * @throws ValidationException thrown if the content of the Base64Binary object is invalid
     */
    protected void validateBase64BinaryContent(T xmlObject) throws ValidationException {
        if (! isAllowEmptyContent()) {
            if (DatatypeHelper.isEmpty(xmlObject.getValue())) {
                throw new ValidationException("Base64Binary content may not be empty");
            }
        }
    }
View Full Code Here

     * @throws ValidationException thrown if the content of the Base64Binary object is invalid
     */
    protected void validateStringContent(T xmlObject) throws ValidationException {
        if (! isAllowEmptyContent()) {
            if (DatatypeHelper.isEmpty(xmlObject.getValue())) {
                throw new ValidationException("String content may not be empty");
            }
        }
    }
View Full Code Here

     * @param xmlObject the object to evaluate
     * @throws ValidationException thrown if the content of the object is invalid
     */
    protected void validateDateTimeContent(T xmlObject) throws ValidationException{
        if(!allowEmptyContent && xmlObject.getValue() == null){
            throw new ValidationException("dateTime content may not be empty");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateTransforms(Transforms xmlObject) throws ValidationException {
        if (xmlObject.getTransforms().isEmpty()) {
            throw new ValidationException("No Transform children were present in the Transforms object");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateTransforms(Transforms xmlObject) throws ValidationException {
        if (xmlObject.getTransforms().isEmpty()) {
            throw new ValidationException("No Transform children were present in the Transforms object");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateURI(CipherReference xmlObject) throws ValidationException {
        if (DatatypeHelper.isEmpty(xmlObject.getURI())) {
            throw new ValidationException("CipherReference URI was empty");
        }
    }
View Full Code Here

     * @param request
     * @throws ValidationException
     */
    protected void validateVersion(RequestAbstractType request) throws ValidationException {
        if ((request.getMajorVersion() != 1) && (request.getMinorVersion() != 0 || request.getMinorVersion() != 1)) {
            throw new ValidationException("Invalid Version");
        }
    }
View Full Code Here

TOP

Related Classes of org.opensaml.xml.validation.ValidationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.