ctt-gob-es / clienteafirma

Cliente @firma
http://administracionelectronica.gob.es/ctt/clienteafirma
254 stars 119 forks source link

Ubuntu 18 Firmar en formato XADES desde línea de comandos #304

Open eescrihuela opened 1 year ago

eescrihuela commented 1 year ago

Saludos, utilizo ubuntu 18 y he probado con Oracle java (versiones 1.8, 11, 17) y no hay manera de poder firmar con formato XADES un pdf y falla. En cambio con CADES no falla (Tampoco falla si utilizamos el GUI)

el comando que uso es:

/usr/bin/AutoFirma sign -i /home/yo/doc1.pdf -o /home/yo/firma.xsig -format xades -store pkcs12:/home/yo/micert.p12 -alias epn1 -password mipassword

y da este error _[Fatal Error] :1:1: Content is not allowed in prolog. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by net.sf.jmimemagic.MagicParser (file:/usr/lib/AutoFirma/AutoFirma.jar) to constructor com.sun.org.apache.xerces.internal.parsers.SAXParser() WARNING: Please consider reporting this to the maintainers of net.sf.jmimemagic.MagicParser WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release de gen. 12, 2023 11:00:32 A. M. es.gob.afirma.signers.xades.XAdESUtil SEVERE: No se ha podido establecer la propiedad de seguridad en la factoria XML java.lang.IllegalArgumentException: Property 'http://javax.xml.xmlconstants/property/accessExternalStylesheet' is not recognized. at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:114) at es.gob.afirma.signers.xades.XAdESUtil.(XAdESUtil.java:97) at es.gob.afirma.signers.xades.XAdESSigner.sign(XAdESSigner.java:602) at es.gob.afirma.signers.xades.AOXAdESSigner.sign(AOXAdESSigner.java:405) at es.gob.afirma.standalone.CommandLineLauncher.sign(CommandLineLauncher.java:797) at es.gob.afirma.standalone.CommandLineLauncher.signByCommandLine(CommandLineLauncher.java:624) at es.gob.afirma.standalone.CommandLineLauncher.processCommandLine(CommandLineLauncher.java:152) at es.gob.afirma.standalone.CommandLineLauncher.main(CommandLineLauncher.java:1006) at es.gob.afirma.standalone.SimpleAfirma.main(SimpleAfirma.java:573)

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details._