Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Xades4j验证包络签名_Java_Xml_Verification_Xades4j - Fatal编程技术网

Java Xades4j验证包络签名

Java Xades4j验证包络签名,java,xml,verification,xades4j,Java,Xml,Verification,Xades4j,我无法验证用xades4j签名的封装xml 我得到的错误是“URI数据的引用没有XMLSignatureInput” 其中“#data”是我的签名xml的uri c#验证的验证通过 这是xml: <?xml version="1.0" encoding="UTF-8"?><Envelope xmlns="urn:Zahtev"><root Id="data"><Identifikacija><IDZahteva>D1CC353F-6F0

我无法验证用xades4j签名的封装xml 我得到的错误是“URI数据的引用没有XMLSignatureInput” 其中“#data”是我的签名xml的uri c#验证的验证通过

这是xml:

<?xml version="1.0" encoding="UTF-8"?><Envelope xmlns="urn:Zahtev"><root Id="data"><Identifikacija><IDZahteva>D1CC353F-6F04-47A4-B900-31944E2A1D53</IDZahteva></Identifikacija></root><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Potpis_RA_Agenta">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#data">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>IWMyfvcgZm3ElP6TfWtqTtGjEos=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#SignedPropertiesId" Type="http://uri.etsi.org/01903#SignedProperties">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>WBLe3LJ12+hQ3OyTClnQcK2crF0=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue Id="Vrednost_za_Potpis_RA_Agenta">
...
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
..
</ds:X509Certificate>
</ds:X509Data>
<ds:KeyValue>
<ds:RSAKeyValue>
<ds:Modulus>
....
</ds:Modulus>
<ds:Exponent>AQAB</ds:Exponent>
</ds:RSAKeyValue>
</ds:KeyValue>
</ds:KeyInfo>
<ds:Object Id="XadesObject">.....</ds:Object>
</ds:Signature></Envelope>
D1CC353F-6F04-47A4-B900-31944E2A1D53
IWMyfvcgZm3ElP6TfWtqTtGjEos=
WBLe3LJ12+hQ3OyTClnQcK2crF0=
...
..
....
AQAB
.....
谢谢

Apache Santuario(由xades4j使用)没有使用“Id”属性作为开箱即用的XML Id。您必须显式地设置它。此行为是在上引入的。看看这个。具有用于定义XML ID的帮助器方法

作为旁注:该签名不是封装的签名,因为它不是签名元素的“内部”。这是一个独立的签名。不需要包络签名变换