Click or drag to resize

TfdAddSignedTfd Method

Add a signed Timbre Fiscal Digital (TFD) element to a CFDI document.

Namespace: FirmaSAT
Assembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntax
public static int AddSignedTfd(
	string newFile,
	string inputFile,
	string keyFile,
	string password,
	string certFile
)

Parameters

newFile  String
Name of new file to be created
inputFile  String
Name of existing CFDI file
keyFile  String
Name of PAC's private key file
password  String
Password for private key
certFile  String
Name of PAC's X.509 certificate that matches the keyFile

Return Value

Int32
Zero (0) if successful or non-zero error code if failed
Remarks
The inputFile must be a version 4.0/3.3 CFDi document already signed with a sello field and no existing TFD element. The TFD will be timestamped using the system clock and a fresh UUID will be generated. No other XML processing is carried out except inserting the TFD element.
Example
C#
int n = Tfd.AddSignedTfd(newname, fname, keyfile, password, certfile);
Console.WriteLine("Tfd.AddSignedTfd returns {0}", n);  // 0
string s = Sat.GetXmlAttribute("cfdv40-ejemplo_signed.xml", "SelloSAT", "TimbreFiscalDigital");
// SelloSat=Qncw19SZ0w/uxkwCYkf/7V3DF3j28Jp1XyNVyqiyOreq0S ...
See Also