Verifies that an X.509 certificate is currently valid.
Public Declare Function X509_CertIsValidNow Lib "diCrPKI.dll"
(ByVal strCertFile As String, ByVal nOptions As Long) As Long
nRet = X509_CertIsValidNow(strCertFile, nOptions)
String with the filename of the certificate
(or base64 representation).Long option flags: not used in this release. Specify zero.
long _stdcall X509_CertIsValidNow(const char *szCertFile, long nOptions);
Long: If the certificate is valid at the current time, the return value is
PKI_X509_VALID_NOW (0);
if the certificate has expired or is not yet valid, the return value is
PKI_X509_EXPIRED (-1);
otherwise it returns a positive error code.
Note that the return value for "success" is zero, not "true". Uses the system clock. The certificate may be in binary DER format or base64 PEM format.
Dim nRet As Long Dim strCertName As String strCertName = "C:\Test\myca.cer" nRet = X509_CertIsValidNow(strCertName, 0) Debug.Print "X509_CertIsValidNow returns " & nRet & " for " & strCertName
X509_VerifyCert X509_ValidatePath X509_CertThumb