Question

I am writing a simple CXF client and server with a little bit of WS-Security (XML Signature). So far so good.

...
outProps.put("signatureParts",
             "{Element}{" + WSU_NS + "}Timestamp;"
             + "{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body;"
             + "{}{http://www.w3.org/2005/08/addressing}ReplyTo;");
outProps.put("signatureAlgorithm", "http://www.w3.org/2000/09/xmldsig#rsa-sha1");
...
client.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));

What I would like to change is the canonicalization algorithm to EXCLUSIVE (C14N_EXCL_OMIT_COMMENTS aka "http://www.w3.org/2001/10/xml-exc-c14n#").

No correct solution

OTHER TIPS

The default already is "http://www.w3.org/2001/10/xml-exc-c14n#" in CXF.

The signature c14n algorithm can be changed via the configuration tag "signatureC14nAlgorithm" (from WSS4J 1.6.12 onwards).

See: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java?r1=1507331&r2=1513780

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top