我正在编写一个简单的CXF客户机和服务器,并使用一点WS-Security (XML签名)。到目前一切尚好。
...
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也称为"http://www.w3.org/2001/10/xml-exc-c14n#")的规范化算法。
发布于 2014-02-05 22:23:55
在CXF中,默认值已经是"http://www.w3.org/2001/10/xml-exc-c14n#“。
签名c14n算法可以通过配置标签"signatureC14nAlgorithm“进行更改(从WSS4J 1.6.12开始)。
请参阅: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
https://stackoverflow.com/questions/21435709
复制相似问题