You can add a signed TimbreFiscalDigital (TFD) element to a signed CFDI document using the key and certificate of a PAC.
Agrega una TimbreFiscalDigital (TFD) Elemento firmado a un documento firmado CFDI utilizando la clave y el certificado de un PAC.
The existing CFDI document must already have been signed by the issuer with a sello
field.
The new TFD element will have a new UUID (different each time) and be timestamped with the system clock.
The selloSAT
signature is created using the supplied key and certificate pair, either for a genuine PAC or for testing purposes.
Only version 3.2/3.3 CFDI documents with full `cfdi:` namespace prefixes can be used.
Use the "-f
" option in the SIGNXML
command.
FirmaSAT SIGNXML -f -s @ -k pac.key -p 12345678a -c pac.cer -i V3_2-signed.xml -o V3_2-tfd.xml
Use the SAT_TFD
option with the SAT_SignXml function.
printf("\nADD A TFD ELEMENT TO A SIGNED CFDI DOCUMENT USING PAC KEY: \n"); fname = "V3_2-signed.xml"; newname = "V3_2-tfd.xml"; certfile = "pac.cer"; keyfile = "pac.key"; password = "12345678a"; n = SAT_SignXml(newname, fname, keyfile, password, certfile, SAT_TFD); printf("SAT_SignXml(SAT_TFD, '%s'-->'%s') returns %ld\n", fname, newname, n); assert(n == 0);
Debug.Print (vbLf & "ADD A TFD ELEMENT TO A SIGNED CFDI DOCUMENT USING PAC KEY:") fname = "V3_2-signed.xml" newname = "V3_2-tfd.xml" certfile = "pac.cer" keyfile = "pac.key" password = "12345678a" ' CAUTION: DO NOT HARD-CODE REAL PASSWORDS! n = SAT_SignXml(newname, fname, keyfile, password, certfile, SAT_TFD) Debug.Print "SAT_SignXml(SAT_TFD, '" & fname & "'-->'" & newname & "') returns " & n