Package org.apache.cxf.ws.security.wss4j

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor$WSS4JStaxOutInterceptorInternal


            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the Timestamp");
View Full Code Here


        bus.getOutInterceptors().add(outInterceptor);
        port.doubleIt(25);
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
        port.doubleIt(25);
       
        ((java.io.Closeable)port).close();
        bus.shutdown(true);
View Full Code Here

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the Timestamp");
View Full Code Here

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the Timestamp");
View Full Code Here

        bus.getOutInterceptors().add(outInterceptor);
        port.doubleIt(25);
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
        port.doubleIt(25);
       
        ((java.io.Closeable)port).close();
        bus.shutdown(true);
View Full Code Here

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not encrypting the SOAP Body");
View Full Code Here

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the WS-Addressing headers");
        } catch (Exception ex) {
            // expected
        }
        bus.getOutInterceptors().remove(staxOutInterceptor);
       
        // Now sign the WS-Addressing headers
        outProps.put("signatureParts",
                "{}{http://schemas.xmlsoap.org/soap/envelope/}Body;"
                + "{}{http://docs.oasis-open.org/wss/2004/01/oasis-"
                + "200401-wss-wssecurity-utility-1.0.xsd}Timestamp;"
                + "{}{http://www.w3.org/2005/08/addressing}ReplyTo;");
       
        // DOM
        outInterceptor = new WSS4JOutInterceptor(outProps);
        bus.getOutInterceptors().add(outInterceptor);
       
        port.doubleIt(25);
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        port.doubleIt(25);
       
        ((java.io.Closeable)port).close();
View Full Code Here

        properties.addSignaturePart(
            new SecurePart(new QName(WSSConstants.NS_SOAP11, "Body"), SecurePart.Modifier.Content)
        );
        properties.setCallbackHandler(new UTPasswordCallback());
       
        WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(properties);
        bus.getOutInterceptors().add(ohandler);
       
        WSSSecurityProperties inProperties = new WSSSecurityProperties();
        inProperties.setCallbackHandler(new UTPasswordCallback());
        inProperties.setDecryptionCryptoProperties(decCryptoProperties);
View Full Code Here

        Client client = ClientProxy.getClient(greeter);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("action", "UsernameToken");
        props.put("user", "alice");
        props.put("passwordType", "PasswordText");
        WSS4JStaxOutInterceptor wss4jOut = new WSS4JStaxOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
       
        try {
            greeter.greetMe("CXF");
            fail("should fail because of password text instead of digest");
        } catch (Exception ex) {
            //expected
        }
        client.getOutInterceptors().remove(wss4jOut);
       
        props.put("passwordType", "PasswordDigest");
        wss4jOut = new WSS4JStaxOutInterceptor(props);
        client.getOutInterceptors().add(wss4jOut);
        String s = greeter.greetMe("CXF");
        assertEquals("Hello CXF", s);
        client.getOutInterceptors().remove(wss4jOut);
       
        try {
            ((BindingProvider)greeter).getRequestContext().put("password", "foo");
            wss4jOut = new WSS4JStaxOutInterceptor(props);
            client.getOutInterceptors().add(wss4jOut);
            greeter.greetMe("CXF");
            fail("should fail");
        } catch (Exception ex) {
            //expected
        }
        client.getOutInterceptors().remove(wss4jOut);
        try {
            props.put("passwordType", "PasswordText");
            wss4jOut = new WSS4JStaxOutInterceptor(props);
            client.getOutInterceptors().add(wss4jOut);
            ((BindingProvider)greeter).getRequestContext().put("password", "password");
            greeter.greetMe("CXF");
            fail("should fail");
        } catch (Exception ex) {
View Full Code Here

        if (test.isStreaming()) {
            SecurityTestUtil.enableStreaming(port);
        }
       
        if (test.isStreaming()) {
            WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
            bus.getOutInterceptors().add(staxOutInterceptor);
        } else {
            WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outProps);
            bus.getOutInterceptors().add(outInterceptor);
        }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor$WSS4JStaxOutInterceptorInternal

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.