【问题标题】:CXF / XML-Signature: How to change the canonicalization algorithm?CXF / XML-Signature:如何更改规范化算法?
【发布时间】:2014-01-29 15:39:56
【问题描述】:

我正在编写一个带有一点 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#")。

【问题讨论】:

    标签: cxf ws-security xml-signature canonicalization


    【解决方案1】:

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

    可以通过配置标签“signatureC14nAlgorithm”更改签名 c14n 算法(从 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

    【讨论】:

    • 如何在 jboss 7 中设置“signatureC14nAlgorithm”?我写了一个 web 服务提供者并使用了注释:“@EndpointProperty(key = "signatureC14nAlgorithm", value = "w3.org/TR/2001/REC-xml-c14n-20010315")" - 但是 jboss 忽略了注释。
    猜你喜欢
    • 2016-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-07
    • 2014-05-22
    相关资源
    最近更新 更多