FirmaSAT


Introduction | Features | BUY NOW | Download Trial | How to get started | Read the Manual | Troubleshooting | FAQ

Licensed Users | Technical Details | Error Codes | Manuals | Programming interfaces & examples | Other interfaces | Command-line | Test certificates | Checking passwords | Known issues | 2012 changes | SAT Validador Site | Legal Bits | Acknowledgments | References | Contact us | Revision History

Introduction

FirmaSAT 5 is a stand-alone product which enables you to create and read digital tax receipts (Comprobantes Fiscal Digital) as specified by the Servicio de Administración Tributaria* (SAT) in Mexico. FirmaSAT works with CFD versions 2.0 and 2.2 and CFDi versions 3.0 and 3.2 SAT XML files as per the regulations for January 2012. See New in the Latest Version.

You can run FirmaSAT from the command-line, or call it using the "system" command of another program (for example, using ColdFusion or SQL Server), or call its underlying functions and methods using one of many programming language interfaces. The supported programming language interfaces are VB2005+, C#, VB6/VBA and C/C++. There is an (unsupported) interface for Delphi and a user-supplied interface to Clarion (thanks, Peter). See also Writing an interface in another programming language.

New version 5.1.1: Released 11 May 2012. For more information, see New in the Latest Version. Existing FirmaSAT 5 licence holders may download this for free.

Download

Download the latest Trial Edition of FirmaSAT 5 now. Use one of

Either unzip the zip file and run the setup.exe program inside it, or download the exe program directly and run it.

Please note it is a breach of copyright to put a copy of these installation files on another server or to distribute them in any manner except by providing a link to this page.

The Trial Edition is fully-functional. You need administrator privileges to install the program. Please read the licence conditions for the Trial Edition. The trial period is 60 days from the date first installed on your system.

You can purchase a licensed version here. Existing licence holders can download the latest Developer Edition here.

How to get started

  1. Download and install FirmaSAT using the setup.exe file.
  2. Open a command-prompt window in the FirmaSAT directory by using the menu options Start > Programs > FirmaSAT > FirmaSAT-open.

    This opens in the directory %ALLUSERSPROFILE%\FirmaSAT, typically C:\ProgramData\FirmaSAT.

  3. Type FirmaSAT LIBINFO. If correctly installed, the output should be similar to:
    >FirmaSAT LIBINFO
    FirmaSAT.exe Version 5.1.0 (32-bit) last updated Mar 23 2012 11:36:47.
    diFirmaSAT2 DLL:
      Version:  510
      Module:   C:\Windows\system32\diFirmaSAT2.dll
      Platform: Win32
      Compiled: Mar 23 2012 10:23:45
      Licence:  T
    
    If you get an error message that says
    the application has failed to start because diFirmaSat2.dll was not found
    
    then the installation is not correct. Repeat from step 1 above.

    If you get an error message

    'FirmaSAT' is not recognized as an internal or external command, operable program or batch file.
    
    then you need to set the path to the program which is in the %ProgramFiles%\FirmaSAT directory (or %ProgramFiles(x86)%\FirmaSAT in 64-bit Windows).
    SET PATH=%ProgramFiles%\FirmaSAT;%PATH%
    
    See the batch file SetupForFirmaSAT.bat provided in the reference files. If you are not using the FirmaSAT-open menu option, then run this first in your command-prompt window to make sure the path is correct. (We find it easier to use the FirmaSAT-open menu option and then CD to the correct folder.)
  4. Run the batch file DoTests.bat. This runs a set of tests on the sample files provided. If these work correctly, then the installation is OK.
    C:\ProgramData\FirmaSAT>dotests
    
    DOING TESTS WITH FIRMASAT...
    
    >FirmaSAT LIBINFO
    ...
    >FirmaSAT ATTRIBUTE -d -a sello -e Comprobante -i Muestra_v2_signed2011.xml
    Attribute=[sello] Element=[Comprobante]
    kvR2+fcKKvkAeyI4m0bfew3qzlAfJO0IUXdi8VXU8WYUjFf7fw2p2l75nR31GlkCGsnlA58mxOlbTWeq
    JvvtiQvBcU40PGG2S+7dPd5X2RtyP3MLKy7vKawJgcisppeVFN/PQ06i/d+n1lpmBcsHRSjzds5byoI+
    +ENaPklwChA=
    
    >FirmaSAT NUMBERCERT Muestra_v2_signed2011.xml
    30001000000100000800
    
    >FirmaSAT DATENOTAFTER aaa010101aaa_CSD_01.cer
    2012-07-29T16:58:40Z
    
    >FirmaSAT DATENOTAFTER -b aaa010101aaa_CSD_01.cer
    2010-07-30T16:58:40Z
    
    ===[cut]===
    
    SIGN A V3 (CFDI) DOCUMENT THEN VERIFY IT...
    
    >FirmaSAT SIGNXML -s @ -k aaa010101aaa_csd_01.key -p a0123456789 -c aaa010101aaa
    _csd_01.cer -i ejemplo_v3_base2011.xml -o ejemplo_v3-new_signed.xml
    STATUS: 0
    ERRORDESCRIPTION: OK
    DATETIMECREATED: Tue Jul 05 18:02:00 2011
    
    >FirmaSAT VERIFYSIG ejemplo_v3-new_signed.xml
    OK
    
    ===[cut]===
    
    USE NEW QUERYCERT COMMAND...
    
    >FirmaSAT QUERYCERT -q rfc aaa010101aaa_csd_01.cer
    AAA010101AAA
    
    >FirmaSAT QUERYCERT -q organizationName -w aaa010101aaa_csd_01.cer
    Servicio de Administración Tributaria
    
    ALL DONE.
    

For a more detailed description of the command-line options in FirmaSAT, see the FirmaSAT command-line utility page.

Programming interfaces and examples

The following source-code files are all included in the FirmaSAT 5 distribution.

C/C++
diFirmaSat2.h - interface for C/C++ programmers (and reference for Delphi/FoxPro/Clarion, etc)
diFirmaSat2.h File Reference - a detailed reference to the C/C++ interface to the diFirmaSAT2.dll library (created by Doxygen)
TestFirmaSat.c - some tests using the FirmaSAT C/C++ interface
VB6/VBA
basFirmaSAT.bas - declaration statements, constants and wrapper functions for VB6/VBA interface
TestFirmaSat.bas - some tests using the FirmaSAT VB6/VBA interface
VB.NET/VB2005+
TestFirmaSat.vb - some tests using the FirmaSAT .NET interface in VB.NET/VB2005+
C#
TestFirmaSat.cs - some tests using the FirmaSAT .NET interface in C#

Interfaces to other programming languages

See Writing an interface in another programming language for advice and examples in how to use FirmaSAT with other programming languages.

Manuals

You can browse the main manual on-line in HTML form. There is a more detailed table of contents and an index.

Dot-NET programmers using VB.NET or C# can browse the FirmaSAT Namespace manual (uses scripts and frames).

Test certificates

2010-08-23: SAT has issued some new test certificates and keys to replace the ones that expired 21 August 2010. These new certificates are valid until July 2012. You can also download via FTP from ftp://ftp2.sat.gob.mx/asistencia_ftp/publicaciones/solcedi/Cer_Sellos.zip (use FireFTP with Firefox).

NOTE: these will expire in July this year and then all the tests in the current FirmaSAT 5 distribution will fail!

Frequently Asked Questions

Why do strange characters like é appear in my output?
All output (except help and error messages) is in UTF-8. On the command-line console or in an old text editor that is not UTF-8-aware, the accented characters (áéíóúñ) will appear as two "funny" characters. For example, "México" will appear as "México". The solution is always to output to a text file and use a text editor that can cope with UTF-8.
Why does my XML file not validate?
Probably because the input to the signature function is not correct. There are so many possible errors we cannot list them. Try following the suggestions under Troubleshooting.
How can I check that the password for my key file is valid?
See Checking the key password with FirmaSAT.
But I bought CryptoSys PKI and downloaded FirmaSAT in 2007/8/9 - where is my licence?
Your licence for CryptoSys PKI is still valid. The Licence ID should be 12 characters long and begin with 'F'. This will enable you download the latest version of CryptoSys PKI, not FirmaSAT. We used to give away the earlier version 1 of FirmaSAT for free. That free version is superseded and out of date. You need to purchase a separate licence for the latest version of FirmaSAT.
Why is this in English? Why is your Spanish so bad?
Sorry, we're Australian and not Spanish speakers. We have tried our best with what knowledge we have and the help of our trusty assistant, Miss Google Translate. Please provide us with feedback if you think our Spanish is wrong. And, yes, the Monty Python quote in the Help was a deliberate joke (see Monty Python - Dirty Hungarian Phrasebook).

SAT Validador Site

There are two validator sites for CFD documents:

2012-01-01: There are still no official SAT validator sites for the new versions 2.2 and 3.2!

See the results of uploading some of our test files created with FirmaSAT to the SAT Validador Site.

Please read our analysis of the sample v3 file ejemplo1 cfdv3.xml, dated 21 September 2010 provided by SAT and why we think it's wrong.

Known Issues

2012-05-11:
The Comprobante/@SerieFolioFiscalOrig node is required in the pipe string (cadena original) for SAT versión 3.2, but this was erronously omitted in preliminary regulations issued by SAT, which we used to design the program. This has been fixed in FirmaSAT version 5.1.1 released 11 May 2012. Thanks to Rodrigo Tarrats for pointing this out.
2012-03-22:
You use the XMLOK command (or its equivalent function) to validate a SAT version 2.0 XML file and get an error like
...expected at most 2 fraction digits
but you know you can have up to six. This has been fixed in version 5.1.0 released 23 March 2012.

The initial schema for SAT versión 2.0 in 2006 restricted t_Importe types to 2 fraction digits. Sometime in 2009 they sneaked in a change to allow 6 decimal places without changing the version number or the URI for the schema. (Thanks to Alonso Cervantes Farfán for pointing us in the right direction on this.)

2012-01-07:
There was an error in the initial release version 5.0.0 of FirmaSAT with the Emisor/@nombre node in the cadena original for the new SAT templates 2.2 and 3.2. This has been fixed in version 5.0.1 released 7 January 2012.
2012-01-01:
FirmaSAT 5 introduces much stricter tests for XML validation, including checking that nodes are the correct data type and of permissible length. If you get an error like
Error code -28: XML restriction is violated/XML restricción es violada: 
Bad attribute/atributo mal [Comprobante/@noCertificado]: 
'' is too short/es demasiado corto, minimum length/longitud mínima=20
then see the page ValidateXml and XMLOK in FirmaSAT 5, which explains how to solve it.
2011-07-12:
SAT have updated both their CFD and CFDi validator sites with stricter requirements for UTF-8 files. If you do not have a UTF-8 byte-order mark (BOM) at the beginning of your XML file, you will get this error:
Resumen del análisis del XML

Se presentaron errores al leer el comprobante: xxxxxxxxx.xml
Error: CFD no codificado en: UTF-8.
Codificado en: ANSI (No Unicode).

More on this ridiculous requirement at UTF-8 byte-order mark problem .

Anyway, this has been addressed in FirmaSAT 4.1.0, released 14 July 2011. XML files created by the SignXML functions will now include this BOM. There are also new functions and methods provided to add the BOM to an existing file (any file, not just an XML document, provided it actually is UTF-8). See Fix UTF-8 BOM.

Thanks to Oscar Escamilla and Marco Osorio for bringing this to our attention.

2011-06-05:
There is a problem on the SAT validator site with missing, optional nodes in a detallista element. See Errors on the SAT validator site.

Changes in 2012 - Latest News

As far as we know, the new SAT CFD version 2.2 and 3.2 schemas will become compulsory from June or July 2012, and the old versions 2.0 and 3.0 will no longer be permitted.

The latest information we have is here.

Legal Bits

Acknowledgments

References

  1. Modificación al Anexo 20 de la Resolución Miscelánea Fiscal para 2006, Servicio de Administración Tributaria, Mexico, 22 June 2006, <ftp-link-original>.
  2. Modificación al Anexo 20 de la Resolución Miscelánea Fiscal para 2009, Servicio de Administración Tributaria, Mexico (PDF document created 2009-06-11), <ftp-link-original>.
  3. Anteproyecto de Modificación al Anexo 20 de la Resolución Miscelánea Fiscal para 2010. Draft Amendment to Annex 20 of the Omnibus 2010 Tax, dated 27 July 2010, released 3 September 2010, <ftp-link-original>.
  4. Anexo_Folio_3-2.pdf. Modificación al Anexo 20 de la Resolución Miscelánea Fiscal para 2011, (draft PDF document created 2011-11-18).
  5. Ajustes-Anexo-20.pdf. Proyecto de reforma al CFF. Impactos al Anexo 20: Estándar del CFDI/CFD, (PDF document created 2011-11-03).
  6. ANEXO 20 de la Resolución Miscelánea Fiscal para 2012 (PDF 1.21 MB), publicada el 28 de diciembre de 2011.

Contact us

For more information about FirmaSAT, please send us a message.

If you have a problem with your purchase from Kagi, or a question on payment methods, please contact Kagi directly.

Revision History

This page last updated 11 May 2012