0

我正在编写一个带有一点 WS-Security(XML 签名)的简单 CXF 客户端和服务器。到目前为止,一切都很好。

...
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));

我想更改的是规范化算法EXCLUSIVE(C14N_EXCL_OMIT_COMMENTS aka “ http://www.w3.org/2001/10/xml-exc-c14n# ”)。

4

1 回答 1

0

CXF 中的默认值已经是“ http://www.w3.org/2001/10/xml-exc-c14n# ”。

可以通过配置标签“signatureC14nAlgorithm”(从 WSS4J 1.6.12 开始)更改签名 c14n 算法。

见: 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

于 2014-02-05T14:23:54.773 回答