Verifies that an X.509 certificate has been signed by its issuer.
VB6/VBA
Debug.Print "Testing X509_VerifyCert ..." ' Returns 0 if OK, -1 if fails to validate, or +ve other error Dim nRet As Long nRet = X509_VerifyCert("myuser.cer", "myca.cer", 0) If nRet = 0 Then Debug.Print "Verification is OK" ElseIf nRet > 0 Then Debug.Print "Error: " & nRet & pkiGetLastError() Else Debug.Print "Cert not issued by this Issuer" End If
Output
Testing X509_VerifyCert ... Verification is OK
VB.NET
Console.WriteLine("Testing X509_VerifyCert ...")
' Returns 0 if OK, -1 if fails to validate, or +ve other error
Dim nRet As Integer
nRet = X509.VerifyCert("myuser.cer", "myca.cer")
If nRet = 0 Then
Console.WriteLine("Verification is OK")
ElseIf nRet > 0 Then
Console.WriteLine("Error: " & nRet & General.LastError())
Else
Console.WriteLine("Cert not issued by this Issuer")
End If
[Contents]