Examples of SignatureValidator


Examples of org.opensaml.xml.signature.SignatureValidator

                            public Class<? extends Credential> getCredentialType() {
                                return null;
                            }
                        }
                        // validate the signature
                        SignatureValidator signatureValidator = new SignatureValidator(
                                new X509CredentialImpl(x509Certificate));
                        signatureValidator.validate(assertion.getSignature());
                    }
                    else{
                        throw new WSSecurityException(WSSecurityException.FAILURE, "SAMLTokenUntrustedSignatureKey");
                    }
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

                throw new WSSecurityException(
                    WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
                    "cannot get certificate or key"
                );
            }
            SignatureValidator sigValidator = new SignatureValidator(credential);
            try {
                sigValidator.validate(sig);
            } catch (ValidationException ex) {
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                        "empty", ex, "SAML signature validation failed");
            }
            signatureKeyInfo = samlKeyInfo;
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

                throw new WSSecurityException(
                        WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
                        "cannot get certificate or key"
                );
            }
            SignatureValidator sigValidator = new SignatureValidator(credential);
            try {
                sigValidator.validate(signature);
            } catch (ValidationException ex) {
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                        "empty", ex, "SAML signature validation failed");
            }
        }
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

        if(response.getSignature() == null){
            log.warn("SAML Response is not signed. So authentication process will be terminated.");
        }
        else {
            try {
                SignatureValidator validator = new SignatureValidator(Util.getX509CredentialImplForTenant(domainName));
                validator.validate(response.getSignature());
                isSignatureValid = true;
            } catch (SAML2SSOAuthenticatorException e) {
                String errorMsg = "Error when creating an X509CredentialImpl instance";
                log.error(errorMsg, e);
            } catch (ValidationException e) {
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

     * @param signature the signature on which to attempt verification
     * @param credential the credential containing the candidate validation key
     * @return true if the signature can be verified using the key from the credential, otherwise false
     */
    protected boolean verifySignature(Signature signature, Credential credential) {
        SignatureValidator validator = new SignatureValidator(credential);
        try {
            validator.validate(signature);
        } catch (ValidationException e) {
            log.debug("Signature validation using candidate validation credential failed", e);
            return false;
        }
       
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

                throw new WSSecurityException(
                    WSSecurityException.FAILURE, "invalidSAMLsecurity",
                    new Object[]{"cannot get certificate or key"}
                );
            }
            SignatureValidator sigValidator = new SignatureValidator(credential);
            try {
                sigValidator.validate(sig);
            } catch (ValidationException ex) {
                throw new WSSecurityException("SAML signature validation failed", ex);
            }
            signatureKeyInfo = samlKeyInfo;
        } else {
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

                throw new WSSecurityException(
                    WSSecurityException.FAILURE, "invalidSAMLsecurity",
                    new Object[]{"cannot get certificate or key"}
                );
            }
            SignatureValidator sigValidator = new SignatureValidator(credential);
            try {
                sigValidator.validate(sig);
            } catch (ValidationException ex) {
                throw new WSSecurityException("SAML signature validation failed", ex);
            }
            signatureKeyInfo = samlKeyInfo;
        } else {
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

     * @param signature the signature on which to attempt verification
     * @param credential the credential containing the candidate validation key
     * @return true if the signature can be verified using the key from the credential, otherwise false
     */
    protected boolean verifySignature(Signature signature, Credential credential) {
        SignatureValidator validator = new SignatureValidator(credential);
        try {
            validator.validate(signature);
        } catch (ValidationException e) {
            log.debug("Signature validation using candidate validation credential failed", e);
            return false;
        }
       
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

            credential.setPublicKey(samlKeyInfo.getPublicKey());
        } else {
            LOG.fine("Can't get X509Certificate or PublicKey to verify signature");
            throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
        }
        SignatureValidator sigValidator = new SignatureValidator(credential);
        try {
            sigValidator.validate(signature);
        } catch (ValidationException ex) {
            LOG.log(Level.FINE, "Error in validating the SAML Signature: " + ex.getMessage(), ex);
            throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
        }
    }
View Full Code Here

Examples of org.opensaml.xml.signature.SignatureValidator

            credential.setPublicKey(samlKeyInfo.getPublicKey());
        } else {
            LOG.fine("Can't get X509Certificate or PublicKey to verify signature");
            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity");
        }
        SignatureValidator sigValidator = new SignatureValidator(credential);
        try {
            sigValidator.validate(signature);
        } catch (ValidationException ex) {
            LOG.log(Level.FINE, "Error in validating the SAML Signature: " + ex.getMessage(), ex);
            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.