Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.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 XADES(xml)签名的小程序验证_Java_Applet_Digital Signature_Xml Signature - Fatal编程技术网

Java XADES(xml)签名的小程序验证

Java XADES(xml)签名的小程序验证,java,applet,digital-signature,xml-signature,Java,Applet,Digital Signature,Xml Signature,我想创建一个小程序(java),以验证与原始文件关联的分离的XADES签名。 我使用的是一个开源程序,来自“svn://scm.adullact.net/scmrepos/svn/libersign/trunk". 我正确地配置了它,但不幸的是,我在这一行遇到了运行时异常 javax.xml.crypto.dsig.XMLSignature xmlSignature = signatureFactory.unmarshalXMLSignature(validateContext); xmlSi

我想创建一个小程序(java),以验证与原始文件关联的分离的XADES签名。 我使用的是一个开源程序,来自“svn://scm.adullact.net/scmrepos/svn/libersign/trunk". 我正确地配置了它,但不幸的是,我在这一行遇到了运行时异常

javax.xml.crypto.dsig.XMLSignature xmlSignature = signatureFactory.unmarshalXMLSignature(validateContext);
 xmlSignature.validate(validateContext); 
例外情况如下:

javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: It is forbidden to access resolver com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverLocalFilesystem when secure validation is enabled
    at org.jcp.xml.dsig.internal.dom.DOMReference.dereference(Unknown Source)
    at org.jcp.xml.dsig.internal.dom.DOMReference.validate(Unknown Source)
    at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.validate(Unknown Source)
    at org.adullact.XADESVerUtil.verify(XADESVerUtil.java:140)
    at org.adullact.XADESVerUtil.verify(XADESVerUtil.java:169)
    at org.adullact.VerificationApplet$1.actionPerformed(VerificationApplet.java:163)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: It is forbidden to access resolver com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverLocalFilesystem when secure validation is enabled
    at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(Unknown Source)
    at org.adullact.ContextSpecificURIDereferencer.dereference(ContextSpecificURIDereferencer.java:32)
    ... 41 more
Caused by: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: It is forbidden to access resolver com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverLocalFilesystem when secure validation is enabled
    at com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver.getInstance(Unknown Source)
    ... 43 more
javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: It is forbidden to access resolver com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverLocalFilesystem when secure validation is enabled
    at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(Unknown Source)
    at org.adullact.ContextSpecificURIDereferencer.dereference(ContextSpecificURIDereferencer.java:32)
    at org.jcp.xml.dsig.internal.dom.DOMReference.dereference(Unknown Source)
    at org.jcp.xml.dsig.internal.dom.DOMReference.validate(Unknown Source)
    at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.validate(Unknown Source)
    at org.adullact.XADESVerUtil.verify(XADESVerUtil.java:140)
    at org.adullact.XADESVerUtil.verify(XADESVerUtil.java:169)
    at org.adullact.VerificationApplet$1.actionPerformed(VerificationApplet.java:163)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: It is forbidden to access resolver com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverLocalFilesystem when secure validation is enabled
    at com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver.getInstance(Unknown Source)
    ... 43 more
我正在使用jdk1.7.071


有人能帮我吗?

你能不能创建一个包含来源的问题。要求我们从另一个网站下载源代码是违反SO规则的。该网站可能会被删除,原因之一是。感谢您的回复:),我联系了该应用程序的创建者,他说这不适用于XADES。您知道另一个用于验证XADES签名的开放源代码吗?提前谢谢