![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
He descubierto que no hay que definir el Namespace. El comando quedaría así:
Cita:
|
|
#2
|
|||
|
|||
|
Cita:
Es raro que no hayan metido políticas de firma. |
|
#3
|
|||
|
|||
|
Lo el alias lo puedes simplificar, hay un parámetro más fácil y menos dado a errores.
Te lo miro mañana. |
|
#4
|
|||
|
|||
|
Hola, prueba algo así, en vez de alias es mejor esto subject.contains:XXXXXXXX donde XXXXXXXXX es el cif,nif,o nie del certificado, y así no va a fallar.
Pero no sé si falta o sobra algo. De momento no voy a trabajar en las firmas. Pero creo que te faltan las politicas de firma tambien: Código:
AutoFirmaCommandLine.exe sign -i c:\...\Fichero_vfactu_3_2-1-110.xml -o c:\...\Fichero_vfactu_3_2-1-110.xml.sign -format facturae -store pkcs12:"C:\...\fichero.pt2 o fichero.pfx" -password pepito -filter subject.contains:A29XXXXX -format xades -xml -config "format=XAdES Enveloped \npolicyIdentifier=urn:oid:2.16.724.1.3.1.1.2.1.9 \npolicyIdentifierHash=Dkx2R3nMv8kWo7iSAh+/1SQ70hfseOEaQbpJnURk+pg= \npolicyIdentifierHashAlgorithm=http://www.w3.org/2001/04/xmlenc#sha256 \npolicyQualifier=https://sede.administracion.gob.es/politica_de_firma_anexo_1.pdf" |
|
#5
|
|||
|
|||
|
Sí, he mandado varios XML firmados así a VeriFactu y los ha tomado sin problemas.
|
|
#6
|
|||
|
|||
|
Con los parámetros que te he puesto?
|
|
#7
|
|||
|
|||
|
No. Lo he probado con los parámetros de mi primer mensaje.
|
|
#8
|
|||
|
|||
|
Cita:
Código:
<xades:SignedDataObjectProperties> <xades:DataObjectFormat ObjectReference="#Reference-f90e12c9-a8c8-4705-ac51-4ada280e7e32"> <xades:Description/> <xades:ObjectIdentifier> <xades:Identifier Qualifier="OIDAsURN">urn:oid:1.2.840.10003.5.109.10</xades:Identifier> <xades:Description/> </xades:ObjectIdentifier> <xades:MimeType>text/xml</xades:MimeType> <xades:Encoding/> </xades:DataObjectFormat> </xades:SignedDataObjectProperties> Código:
<xades:SigningCertificate><xades:Cert><xades:CertDigest><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/> Código:
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> También dentro del nodo <ds:SignedInfo> debería hacer mención a sha256, pero está poniendo sha512 en todas. Dentro de <ds:Reference><ds:Transforms> se añade: Código:
<ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> <ds:XPath xmlns:ds="http://www.w3.org/2000/09/xmldsig#">not(ancestor-or-self::ds:Signature)</ds:XPath> </ds:Transform> |
|
#9
|
|||
|
|||
|
Cita:
¿Alguien sabe de dónde se saca el parámetro de configuración policyIdentifierHash? |
|
#10
|
|||
|
|||
|
Para la politica de firmas debes tener esto en el signature:
Código:
<ds:Object> <xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="#Signature-356076609"> <xades:SignedProperties Id="SignedProperties-896717916"> <xades:SignedSignatureProperties> <xades:SigningTime>2025-01-09T09:06:03.661Z</xades:SigningTime> <xades:SigningCertificate> <xades:Cert> <xades:CertDigest> <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> <ds:DigestValue>GonBTW0Kj+S7ul49CizLsozDclU28uKhzNqqIGHkuRs=</ds:DigestValue> </xades:CertDigest> <xades:IssuerSerial> <ds:X509IssuerName>CN=AC Representación, OU=CERES, O=FNMT-RCM, C=ES</ds:X509IssuerName> <ds:X509SerialNumber>60125478927655539147584317276501208423</ds:X509SerialNumber> </xades:IssuerSerial> </xades:Cert> </xades:SigningCertificate> <xades:SignaturePolicyIdentifier> <xades:SignaturePolicyId> <xades:SigPolicyId> <xades:Identifier>urn:oid:2.16.724.1.3.1.1.2.1.9</xades:Identifier> </xades:SigPolicyId> <xades:SigPolicyHash> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>G7roucf600+f03r/o0bAOQ6WAs0=</ds:DigestValue> </xades:SigPolicyHash> <xades:SigPolicyQualifiers> <xades:SigPolicyQualifier> <xades:SPURI>https://sede.administracion.gob.es/politica_de_firma_anexo_1.pdf</xades:SPURI> </xades:SigPolicyQualifier> </xades:SigPolicyQualifiers> </xades:SignaturePolicyId> </xades:SignaturePolicyIdentifier> </xades:SignedSignatureProperties> <xades:SignedDataObjectProperties> <xades:DataObjectFormat ObjectReference="#xmldsig-5cf63553-8a48-4ceb-83f8-861d341a4d67-ref0"> <xades:ObjectIdentifier> <xades:Identifier>urn:oid:1.2.840.10003.5.109.10</xades:Identifier> </xades:ObjectIdentifier> <xades:MimeType>text/xml</xades:MimeType> <xades:Encoding>UTF8</xades:Encoding> </xades:DataObjectFormat> </xades:SignedDataObjectProperties> </xades:SignedProperties> </xades:QualifyingProperties> </ds:Object> Última edición por delphiGar fecha: 09-01-2025 a las 10:44:50. |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Firmar XML | CrazySoft | Varios | 6 | 19-09-2022 15:54:19 |
| Autofirma (alias del certificado) | keys | Internet | 38 | 26-02-2022 17:12:06 |
| Firmar XML | pepesoft | Varios | 1 | 23-11-2018 09:32:25 |
| Firmar XML | johan | Varios | 4 | 20-03-2018 13:57:21 |
| Firmar PDF | keys | Varios | 1 | 06-05-2010 10:11:37 |
|