Verify the signature (sello) in an XML file.

Namespace:  FirmaSAT
Assembly:  diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.50.0.29531

Syntax

C#
public static int VerifySignature(
	string xmlFile,
	string certFile
)
Visual Basic (Declaration)
Public Shared Function VerifySignature ( _
	xmlFile As String, _
	certFile As String _
) As Integer

Parameters

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

Return Value

Zero if signature is verified or nonzero error code if failed

Remarks

If no certFile is specified, the public key is obtained from the certificado node in the XML file.

Remarks

If a certFile is specified, the public key is obtained from the specified X.509 certficate file and ny existing certificado node in the XML will be ignored.

Examples

CopyC#
Console.WriteLine(Sat.VerifySignature("cfdv40-ejemplo-signed.xml"));
// 0
Console.WriteLine(Sat.VerifySignature("cfdv40-badsig.xml"));
// -15
Console.WriteLine(General.ErrorLookup(-15));
// Decryption error/De error de descifrado (DECRYPT_ERROR)

See Also