Package org.apache.wss4j.common.crypto

Examples of org.apache.wss4j.common.crypto.PasswordEncryptor


        }
        return crypto;
    }
   
    protected PasswordEncryptor getPasswordEncryptor() {
        PasswordEncryptor passwordEncryptor =
            (PasswordEncryptor)message.getContextualProperty(
                SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE
            );
        if (passwordEncryptor != null) {
            return passwordEncryptor;
View Full Code Here


    }
   
    protected PasswordEncryptor getPasswordEncryptor(
        SoapMessage soapMessage, WSSSecurityProperties securityProperties
    ) {
        PasswordEncryptor passwordEncryptor =
            (PasswordEncryptor)soapMessage.getContextualProperty(
                SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE
            );
        if (passwordEncryptor != null) {
            return passwordEncryptor;
View Full Code Here

                LOG.fine("Cannot find Crypto Encryption properties: " + e);
                Exception ex = new Exception("Cannot find Crypto Encryption properties: " + e);
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
            }
           
            PasswordEncryptor passwordEncryptor = getPasswordEncryptor(message, requestData);
            encrCrypto = CryptoFactory.getInstance(props, Loader.getClassLoader(CryptoFactory.class),
                                                   passwordEncryptor);

            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
            synchronized (info) {
View Full Code Here

        }
        return encrCrypto;
    }
   
    private PasswordEncryptor getPasswordEncryptor(SoapMessage soapMessage, RequestData requestData) {
        PasswordEncryptor passwordEncryptor =
            (PasswordEncryptor)soapMessage.getContextualProperty(
                SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE
            );
        if (passwordEncryptor != null) {
            return passwordEncryptor;
View Full Code Here

                LOG.fine("Cannot find Crypto Signature properties: " + s);
                Exception ex = new Exception("Cannot find Crypto Signature properties: " + s);
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
            }
           
            PasswordEncryptor passwordEncryptor = getPasswordEncryptor(message, requestData);
            signCrypto = CryptoFactory.getInstance(props, Loader.getClassLoader(CryptoFactory.class),
                                                   passwordEncryptor);

            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
            synchronized (info) {
View Full Code Here

            List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
            actions.add(WSSConstants.SIGNATURE);
            securityProperties.setActions(actions);
            Properties properties =
                CryptoFactory.getProperties("transmitter-crypto-enc.properties", this.getClass().getClassLoader());
            PasswordEncryptor passwordEncryptor =
                new JasyptPasswordEncryptor(new CallbackHandlerImpl());
            securityProperties.setSignatureCryptoProperties(properties, passwordEncryptor);
            securityProperties.setSignatureUser("transmitter");
            securityProperties.setCallbackHandler(new CallbackHandlerImpl());
View Full Code Here

            List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
            actions.add(WSSConstants.ENCRYPT);
            securityProperties.setActions(actions);
            Properties properties =
                CryptoFactory.getProperties("transmitter-crypto-enc.properties", this.getClass().getClassLoader());
            PasswordEncryptor passwordEncryptor =
                new JasyptPasswordEncryptor(new CallbackHandlerImpl());
            securityProperties.setEncryptionCryptoProperties(properties, passwordEncryptor);
            securityProperties.setEncryptionUser("receiver");

            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
View Full Code Here

        Map<String, Object> config,
        WSSSecurityProperties properties
    ) {
        Object passwordEncryptorObj =
            config.get(ConfigurationConstants.PASSWORD_ENCRYPTOR_INSTANCE);
        PasswordEncryptor passwordEncryptor = null;
        if (passwordEncryptorObj instanceof PasswordEncryptor) {
            passwordEncryptor = (PasswordEncryptor)passwordEncryptorObj;
        }
        if (passwordEncryptor == null) {
            CallbackHandler callbackHandler = properties.getCallbackHandler();
View Full Code Here

            WSSSecurityProperties securityProperties = new WSSSecurityProperties();
            WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.SIGNATURE};
            securityProperties.setOutAction(actions);
            Properties properties =
                CryptoFactory.getProperties("transmitter-crypto-enc.properties", this.getClass().getClassLoader());
            PasswordEncryptor passwordEncryptor =
                new JasyptPasswordEncryptor(new CallbackHandlerImpl());
            securityProperties.setSignatureCryptoProperties(properties, passwordEncryptor);
            securityProperties.setSignatureUser("transmitter");
            securityProperties.setCallbackHandler(new CallbackHandlerImpl());
View Full Code Here

            WSSSecurityProperties securityProperties = new WSSSecurityProperties();
            WSSConstants.Action[] actions = new WSSConstants.Action[]{WSSConstants.ENCRYPT};
            securityProperties.setOutAction(actions);
            Properties properties =
                CryptoFactory.getProperties("transmitter-crypto-enc.properties", this.getClass().getClassLoader());
            PasswordEncryptor passwordEncryptor =
                new JasyptPasswordEncryptor(new CallbackHandlerImpl());
            securityProperties.setEncryptionCryptoProperties(properties, passwordEncryptor);
            securityProperties.setEncryptionUser("receiver");

            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
View Full Code Here

TOP

Related Classes of org.apache.wss4j.common.crypto.PasswordEncryptor

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.