CryptoSys PKI Toolkit Manual

X509_CertIsValidNow

Verifies that an X.509 certificate is currently valid.

VB6/VBA Syntax

Public Declare Function X509_CertIsValidNow Lib "diCrPKI.dll" (ByVal strCertFile As String, ByVal nOptions As Long) As Long

nRet = X509_CertIsValidNow(strCertFile, nOptions)

Parameters

strCertFile
[in] String with the filename of the certificate (or base64 representation).
nOptions
[in] Long option flags: not used in this release. Specify zero.

C/C++ Syntax

long _stdcall X509_CertIsValidNow(const char *szCertFile, long nOptions);

Returns (VB6/C)

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.

.NET Equivalent

X509.CertIsValidNow Method

Remarks

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.

Example

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

See Also

X509_VerifyCert X509_ValidatePath X509_CertThumb

[Contents] [Index]

[HOME]   [NEXT: X509_CertRequest...]

Copyright © 2004-12 D.I. Management Services Pty Ltd. All rights reserved.