XAdES-EPES扩展到XAdES-T,不包括" xmlns:xades141 =" http://uri.etsi.org/01903/v1.4.1#"在QualifyingProperties中

时间:2015-02-04 09:39:17

标签: xades4j

我有一个XAdES-EPES签名,然后我使用XAdES-4j将签名扩展到XAdES-T。问题是在原始签名中QualifyingProperties是:

<xades:QualifyingProperties Id="Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-QualifyingProperties" Target="#Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-Signature" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#">

在扩展签名中,QualifyingProperties是:

<xades:QualifyingProperties Id="Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-QualifyingProperties" Target="#Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-Signature" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#">

如何在不将 xmlns:xades141 =“http://uri.etsi.org/01903/v1.4.1#”添加到QualifyingProperties的情况下扩展签名?

提前致谢!

编辑:在我找到解决方案之前,我正在做:

Element qualifyingProperties = null;
final NodeList nlist = xmlSig.getDocument().getElementsByTagName("xades:QualifyingProperties");
if (nlist.getLength() != 0) {
    qualifyingProperties = (Element) nlist.item(0);
    qualifyingProperties.removeAttribute("xmlns:xades141");
}

1 个答案:

答案 0 :(得分:0)

xades4j当前正在进行XML序列化的方式总是添加该命名空间声明,即使没有任何使用它的元素也是如此。没有办法配置它。我只想在必要时添加它,但这个问题还没有得到解决。