Examples of CryptoLoader


Examples of org.apache.cxf.rs.security.common.CryptoLoader

            cryptoKey = SecurityConstants.SIGNATURE_CRYPTO;
            propKey = SecurityConstants.SIGNATURE_PROPERTIES;   
        }
       
        try {
            return new CryptoLoader().getCrypto(message, cryptoKey, propKey);
        } catch (Exception ex) {
            throwFault("Crypto can not be loaded", ex);
            return null;
        }
    }
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

            propKey = SecurityConstants.SIGNATURE_PROPERTIES;   
        }
       
        Crypto crypto = null;
        try {
            CryptoLoader loader = new CryptoLoader();
            crypto = loader.getCrypto(message, cryptoKey, propKey);
        } catch (Exception ex) {
            throwFault("Crypto can not be loaded", ex);
        }
        boolean valid = false;
        Reference ref = null;
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

       
        try {
            SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
            if (samlCallback.isSignAssertion()) {
                //--- This code will be moved to a common utility class
                Crypto crypto = new CryptoLoader().getCrypto(message,
                                          SecurityConstants.SIGNATURE_CRYPTO,
                                          SecurityConstants.SIGNATURE_PROPERTIES);
               
                String user =
                    SecurityUtils.getUserName(message, crypto, SecurityConstants.SIGNATURE_USERNAME);
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

            if (assertion.isSigned()) {
                WSSConfig cfg = WSSConfig.getNewInstance();
                data.setWssConfig(cfg);
                data.setCallbackHandler(SecurityUtils.getCallbackHandler(message, this.getClass()));
                try {
                    data.setSigVerCrypto(new CryptoLoader().getCrypto(message,
                                                SecurityConstants.SIGNATURE_CRYPTO,
                                                SecurityConstants.SIGNATURE_PROPERTIES));
                } catch (IOException ex) {
                    throwFault("Crypto can not be loaded", ex);
                }
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

                    final List<SecurityEvent> incomingSecurityEventList =
                        (List<SecurityEvent>) message.getExchange().get(SecurityEvent.class.getName() + ".in");
                    sendingCert = getUseReqSigCert(incomingSecurityEventList);
                }
            } else {
                CryptoLoader loader = new CryptoLoader();
                Crypto crypto = loader.getCrypto(message,
                                          SecurityConstants.ENCRYPT_CRYPTO,
                                          SecurityConstants.ENCRYPT_PROPERTIES);
               
                userName = SecurityUtils.getUserName(crypto, userName);
                if (StringUtils.isEmpty(userName)) {
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

    private void configureSignature(
        Message message, XMLSecurityProperties properties
    ) throws Exception {
        String userNameKey = SecurityConstants.SIGNATURE_USERNAME;
       
        CryptoLoader loader = new CryptoLoader();
        Crypto crypto = loader.getCrypto(message,
                                         SecurityConstants.SIGNATURE_CRYPTO,
                                         SecurityConstants.SIGNATURE_PROPERTIES);
        String user = SecurityUtils.getUserName(message, crypto, userNameKey);
        
        if (StringUtils.isEmpty(user) || SecurityUtils.USE_REQUEST_SIGNATURE_CERT.equals(user)) {
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

                XMLSignature sig = message.getExchange().getInMessage().getContent(XMLSignature.class);
                if (sig != null) {
                    receiverCert = sig.getKeyInfo().getX509Certificate();
                }
            } else {
                CryptoLoader loader = new CryptoLoader();
                Crypto crypto = loader.getCrypto(message,
                                          SecurityConstants.ENCRYPT_CRYPTO,
                                          SecurityConstants.ENCRYPT_PROPERTIES);
               
                userName = SecurityUtils.getUserName(crypto, userName);
                if (StringUtils.isEmpty(userName)) {
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

                        subjectName, subjectQualifier, confirmationMethod
                    );
                if (SAML2Constants.CONF_HOLDER_KEY.equals(confirmationMethod)) {
                   
                    try {
                        CryptoLoader loader = new CryptoLoader();
                        Crypto crypto = loader.getCrypto(m,
                                                         SecurityConstants.SIGNATURE_CRYPTO,
                                                         SecurityConstants.SIGNATURE_PROPERTIES);
                        X509Certificate cert =
                            SecurityUtils.getCertificates(crypto,
                                SecurityUtils.getUserName(m, crypto, "ws-security.signature.username"))[0];
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

            throwFault("XML Signature is not available", null);
        }
       
        Crypto crypto = null;
        try {
            CryptoLoader loader = new CryptoLoader();
            crypto = loader.getCrypto(message,
                               SecurityConstants.SIGNATURE_CRYPTO,
                               SecurityConstants.SIGNATURE_PROPERTIES);
            if (crypto == null) {
                crypto = loader.getCrypto(message,
                                   SecurityConstants.ENCRYPT_CRYPTO,
                                   SecurityConstants.ENCRYPT_PROPERTIES);
            }
        } catch (Exception ex) {
            throwFault("Crypto can not be loaded", ex);
View Full Code Here

Examples of org.apache.cxf.rs.security.common.CryptoLoader

            throw new IllegalStateException("Enveloping XMLSignature can not have custom envelope names");
        }
       
        String userNameKey = SecurityConstants.SIGNATURE_USERNAME;
       
        CryptoLoader loader = new CryptoLoader();
        Crypto crypto = loader.getCrypto(message,
                                         SecurityConstants.SIGNATURE_CRYPTO,
                                         SecurityConstants.SIGNATURE_PROPERTIES);
        if (crypto == null) {
            crypto = loader.getCrypto(message,
                                      SecurityConstants.ENCRYPT_CRYPTO,
                                      SecurityConstants.ENCRYPT_PROPERTIES);
            userNameKey = SecurityConstants.ENCRYPT_USERNAME;
        }
        String user = SecurityUtils.getUserName(message, crypto, userNameKey);
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.