Click or drag to resize

SatInsertCertToBytes(String, String) Method

Insert certificate information into an XML document (as a file) and output to memory.

Namespace: FirmaSAT
Assembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntax
public static byte[] InsertCertToBytes(
	string xmlFile,
	string certFile
)

Parameters

xmlFile  String
Name of input XML file to be processed (or a string containing XML data)
certFile  String
X.509 certificate file

Return Value

Byte
XML data as a byte array.
Remarks
(file) --> (bytes)
Example
C#
// Pass input XML data as a string
string xmlStr = File.ReadAllText("cfdv40-ejemplo-nocertnum.xml");
string cerStr = Sat.GetCertAsString("emisor.cer");
byte[] b = Sat.InsertCertToBytes(xmlStr, cerStr);
Console.WriteLine(System.Text.Encoding.UTF8.GetString(b)); 
// <cfdi:Comprobante 
// ...
// NoCertificado="30001000000300023708" Sello="" Certificado="MIIF+TCCA+GgAwIBAgIU ...
See Also