Announcement

Collapse
No announcement yet.

gSOAP Client für Apache CFX Service

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • gSOAP Client für Apache CFX Service

    Hi Com,

    Ich bin momentan dabei einen gSOAP Client für einen Apache CXF Service zu erstellen, der sich über RSA-Verschlüsselung authentifizieren soll.

    Leider weis ich nicht so ganz, wie ich von der Clientseite aus die Optionen für die Security-Header einstellen muss, damit sie der Server auch versteht.

    In Java sieht das etwa so aus:
    Code:
    Map<String,Object> inProps= new HashMap<String,Object>();
    inProps.put(WSHandlerConstants.ACTION, "Timestamp Signature Encrypt");
    inProps.put(WSHandlerConstants.SIG_PROP_FILE, "wss-server-public.properties");
    // only wss-client has private key and can read incoming messages
    inProps.put(WSHandlerConstants.DEC_PROP_FILE, "wss-client.properties");
    inProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ClientCallbackHandler.class.getName());
    
    Map<String,Object> inProps= new HashMap<String,Object>();
    outProps.put(WSHandlerConstants.ACTION, "Timestamp Signature Encrypt");
    // only wss-client has private key and can sign outgoing messages
    outProps.put(WSHandlerConstants.USER, "wss-client");
    outProps.put(WSHandlerConstants.SIG_PROP_FILE, "wss-client.properties");
    outProps.put(WSHandlerConstants.ENC_PROP_FILE, "wss-server-public.properties");
    outProps.put(WSHandlerConstants.ENCRYPTION_USER, "wss-server");
    outProps.put(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
    outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ClientCallbackHandler.class.getName());
    outProps.put(WSHandlerConstants.SIGNATURE_PARTS, "{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body");
    outProps.put(WSHandlerConstants.ENCRYPTION_PARTS, "{Element}{http://www.w3.org/2000/09/xmldsig#}Signature;{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body");
    outProps.put(WSHandlerConstants.ENC_SYM_ALGO, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc");
    
    
    WSS4JInInterceptor wssIn = new WSS4JInInterceptor(InProps);
    cxfEndpoint.getInInterceptors().add(wssIn);
    cxfEndpoint.getInInterceptors().add(new SAAJInInterceptor());
    
    WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(OutProps);
    cxfEndpoint.getOutInterceptors().add(wssOut);
    xfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());
    wsse Plugin habe ich in mein C-Client mit gSOAP schon importiert, aber ich weis eben nicht so ganz wie ich damit nun eine solche Header wie in Java nachbaue.

    Zudem befinden sich die keys in ein jks, das von der CFX-API automatisch gelesen wird.

    Weis jemand näheres darüber, bzw gibt es hierführ etwas besseres als gSOAP?

    Danke im Voraus

    Temesh
Working...
X