Click or drag to resize

SatInsertCertToBytes(Byte, String) Method

Insert certificate information into an XML document (as a byte array) 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(
	byte[] xmlData,
	string certFile
)

Parameters

xmlData  Byte
Byte array containing XML data
certFile  String
X.509 certificate file

Return Value

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