SatCheckKeyAndCert Method |
Verify that the public key in an X.509 certificate matches the private key.
Namespace: FirmaSATAssembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntaxpublic static int CheckKeyAndCert(
string keyFile,
string password,
string certFile
)
Public Shared Function CheckKeyAndCert (
keyFile As String,
password As String,
certFile As String
) As Integer
Parameters
- keyFile String
- Name of private key file
- password String
- Password for encrypted private key
- certFile String
- X.509 certificate file or XML document with embedded certificado node
Return Value
Int32Zero (0) if keys match or a negative
error code.
Exampleint n = Sat.CheckKeyAndCert("emisor.key", "12345678a", "emisor.cer");
Console.WriteLine("Sat.CheckKeyAndCert returns {0}", n);
n = Sat.CheckKeyAndCert("emisor.key", "12345678a", "pac.cer");
Console.WriteLine("Sat.CheckKeyAndCert returns {0}", n);
Console.WriteLine(General.ErrorLookup(n));
Console.WriteLine(General.LastError());
See Also