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

Examples of org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor


            inProps.put("encryptionKeyIdentifier", "IssuerSerial");

            inProps.put("signaturePropFile", "etc/Client_Encrypt.properties");
            inProps.put("signatureKeyIdentifier", "DirectReference");

            bus.getInInterceptors().add(new WSS4JInInterceptor(inProps));

            // Check to make sure that the SOAP Body and Timestamp were signed,
            // and that the SOAP Body was encrypted
            DefaultCryptoCoverageChecker coverageChecker = new DefaultCryptoCoverageChecker();
            coverageChecker.setSignBody(true);
View Full Code Here


        inProps.put("encryptionKeyIdentifier", "IssuerSerial");

        inProps.put("signaturePropFile", "etc/Server_SignVerf.properties");
        inProps.put("signatureKeyIdentifier", "DirectReference");

        bus.getInInterceptors().add(new WSS4JInInterceptor(inProps));

        // Check to make sure that the SOAP Body and Timestamp were signed,
        // and that the SOAP Body was encrypted
        DefaultCryptoCoverageChecker coverageChecker = new DefaultCryptoCoverageChecker();
        coverageChecker.setSignBody(true);
View Full Code Here

        DocumentBuilder db = dbf.newDocumentBuilder();
        db.setEntityResolver(new NullResolver());
        doc = StaxUtils.read(db, reader, false);

        WSS4JInInterceptor inHandler = new WSS4JInInterceptor(inProperties);

        SoapMessage inmsg = new SoapMessage(new MessageImpl());
        inmsg.put(SecurityConstants.SAML_ROLE_ATTRIBUTENAME, "role");
        for (String inMessageProperty : inMessageProperties.keySet()) {
            inmsg.put(inMessageProperty, inMessageProperties.get(inMessageProperty));
        }
        ex.setInMessage(inmsg);
        inmsg.setContent(SOAPMessage.class, saajMsg);

        inHandler.handleMessage(inmsg);

        return inmsg;
    }
View Full Code Here

        final Map<String, Object> map = new HashMap<String, Object>();
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            map.put(entry.getKey().toString(), entry.getValue());
        }
        properties.clear();
        return new WSS4JInInterceptor(map);
    }
View Full Code Here

    public static final void setupWSS4JChain(Endpoint endpoint, Map<String, Object> inProps, Map<String, Object> outProps) {

        if (null != inProps && !inProps.isEmpty()) {
            endpoint.getInInterceptors().add(new SAAJInInterceptor());
            endpoint.getInInterceptors().add(new WSS4JInInterceptor(inProps));

            // if WS Security is used with a JAX-WS handler (See EjbInterceptor), we have to deal with mustUnderstand flag
            // in WS Security headers. So, let's add an interceptor
            endpoint.getInInterceptors().add(new WSSPassThroughInterceptor());
        }
View Full Code Here

        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
        endpoint.getOutInterceptors().add(wssOut);

        final Map<String, Object> inProps = new HashMap<String, Object>();
        inProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
        final WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps);
        endpoint.getInInterceptors().add(wssIn);

        assertEquals(12, calc.multiply(3, 4));
    }
View Full Code Here

    Map<String,Object> inProps= new HashMap<String,Object>();
    inProps.put("action", "Timestamp Signature");
    inProps.put("signaturePropFile", "META-INF/alice.properties");
    inProps.put("passwordCallbackClass", "com.redhat.gss.wsse.KeystorePasswordCallback");
    WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps); //response
    cxfEndpoint.getInInterceptors().add(wssIn);
    cxfEndpoint.getInInterceptors().add(new SAAJInInterceptor());
  }
View Full Code Here

      Map<String, Object> inPropertyMap = WSSConfiguration.getWSS4JInterceptorConfiguration(true, true);
      Map<String, Object> outPropertyMap = WSSConfiguration.getWSS4JInterceptorConfiguration(true, false);

      if (inPropertyMap != null && handleSpecialProperties(inPropertyMap))
      {
         WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inPropertyMap);
         client.getInInterceptors().add(inInterceptor);
      }

      if (outPropertyMap != null && handleSpecialProperties(outPropertyMap))
      {
View Full Code Here

            cxfEndpoint.getOutInterceptors().add(wssOut);
        }
       
        if (!wss4jInProps.isEmpty()) {
            // pass the security properties to the WSS4J in interceptor
            WSS4JInInterceptor wssIn = new WSS4JInInterceptor(wss4jInProps);
            cxfEndpoint.getInInterceptors().add(wssIn);
        }
              
    }
View Full Code Here

      Map<String, Object> inPropertyMap = getWSS4JInInterceptorProperties();
      Map<String, Object> outPropertyMap = getWSS4JOutInterceptorProperties();
     
      if (inPropertyMap != null && handleSpecialProperties(inPropertyMap))
      {
         WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inPropertyMap);
         client.getInInterceptors().add(inInterceptor);
      }
     
      if (outPropertyMap != null && handleSpecialProperties(outPropertyMap))
      {
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor

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.