Package org.opensaml.xml.security

Examples of org.opensaml.xml.security.SecurityException


    /** {@inheritDoc} */
    protected Iterable<Credential> resolveFromSource(CriteriaSet criteriaSet) throws SecurityException {
        KeyInfoCriteria kiCriteria = criteriaSet.get(KeyInfoCriteria.class);
        if (kiCriteria == null) {
            log.error("No KeyInfo criteria supplied, resolver could not process");
            throw new SecurityException("Credential criteria set did not contain an instance of"
                    + "KeyInfoCredentialCriteria");
        }
        KeyInfo keyInfo = kiCriteria.getKeyInfo();

        // This will be the list of credentials to return.
View Full Code Here


        List<X509CRL> crls = null;
        try {
            crls = KeyInfoHelper.getCRLs(x509Data);
        } catch (CRLException e) {
            log.error("Error extracting CRL's from X509Data", e);
            throw new SecurityException("Error extracting CRL's from X509Data", e);
        }
       
        log.debug("Found {} X509CRLs", crls.size());
        return crls;
    }
View Full Code Here

        List<X509Certificate> certs = null;
        try {
            certs = KeyInfoHelper.getCertificates(x509Data);
        } catch (CertificateException e) {
            log.error("Error extracting certificates from X509Data", e);
            throw new SecurityException("Error extracting certificates from X509Data", e);
        }
        log.debug("Found {} X509Certificates", certs.size());
        return certs;
    }
View Full Code Here

        PublicKey pubKey = null;
        try {
            pubKey = KeyInfoHelper.getKey(keyValue);
        } catch (KeyException e) {
            log.error("Error extracting DER-encoded key value", e);
            throw new SecurityException("Error extracting DER-encoded key value", e);
        }
       
        KeyAlgorithmCriteria algorithmCriteria = criteriaSet.get(KeyAlgorithmCriteria.class);
        if (algorithmCriteria != null && algorithmCriteria.getKeyAlgorithm() != null
                && !algorithmCriteria.getKeyAlgorithm().equals(pubKey.getAlgorithm())) {
View Full Code Here

        PublicKey pubKey = null;
        try {
            pubKey = KeyInfoHelper.getRSAKey(keyValue);
        } catch (KeyException e) {
            log.error("Error extracting RSA key value", e);
            throw new SecurityException("Error extracting RSA key value", e);
        }
        BasicCredential cred = new BasicCredential();
        cred.setPublicKey(pubKey);
        if (kiContext != null) {
            cred.getKeyNames().addAll(kiContext.getKeyNames());
View Full Code Here

                        + X509Util.getIdentifiersToken(untrustedCredential, x500DNHandler) + ": " + e.getMessage());
            }
            return false;
        } catch (GeneralSecurityException e) {
            log.error("PKIX validation failure", e);
            throw new SecurityException("PKIX validation failure", e);
        }
    }
View Full Code Here

        Element origDOM = origKeyInfo.getDOM();
        if (origDOM == null) {
            try {
                getMarshaller().marshall(origKeyInfo);
            } catch (MarshallingException e) {
                throw new SecurityException("Error marshalling the original KeyInfo during cloning", e);
            }
        }
       
        KeyInfo newKeyInfo = null;
        try {
            newKeyInfo = (KeyInfo) getUnmarshaller().unmarshall(origKeyInfo.getDOM());
        } catch (UnmarshallingException e) {
            throw new SecurityException("Error unmarshalling the new KeyInfo during cloning", e);
        }
       
        // If the original had no cached DOM, go ahead and drop so this operation doesn't have any side effects.
        // If it did have, then drop it on the new one, so isn't cached by two objects.
        if (origDOM == null) {
View Full Code Here

        if (keyInfoMarshaller != null) {
            return keyInfoMarshaller;
        }
        keyInfoMarshaller = Configuration.getMarshallerFactory().getMarshaller(KeyInfo.DEFAULT_ELEMENT_NAME);
        if (keyInfoMarshaller == null) {
            throw new SecurityException("Could not obtain KeyInfo marshaller from the configuration");
        }
        return keyInfoMarshaller;
    }
View Full Code Here

        if (keyInfoUnmarshaller != null) {
            return keyInfoUnmarshaller;
        }
        keyInfoUnmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(KeyInfo.DEFAULT_ELEMENT_NAME);
        if (keyInfoUnmarshaller == null) {
            throw new SecurityException("Could not obtain KeyInfo unmarshaller from the configuration");
        }
        return keyInfoUnmarshaller;
    }
View Full Code Here

        try {
            //TODO deal with case of incomplete DSAParams, need hook to resolve those
            pubKey = KeyInfoHelper.getDSAKey(keyValue);
        } catch (KeyException e) {
            log.error("Error extracting DSA key value", e);
            throw new SecurityException("Error extracting DSA key value", e);
        }
        BasicCredential cred = new BasicCredential();
        cred.setPublicKey(pubKey);
        if (kiContext != null) {
            cred.getKeyNames().addAll(kiContext.getKeyNames());
View Full Code Here

TOP

Related Classes of org.opensaml.xml.security.SecurityException

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.