CryptoSys PKI Pro Manual

X509_CertIsValidNow

Verifies that an X.509 certificate is currently valid.

VBA/VB6 Syntax

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

nRet = X509_CertIsValidNow(strCertFile, nOptions)

C/C++ Syntax

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

Parameters

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

Returns (VBA/C)

Zero (0) if the certificate is valid at the current time. If the certificate has expired or is not yet valid, the return value is PKI_X509_EXPIRED (+16 = EXPIRED_ERROR); otherwise it returns a positive error code.

.NET Equivalent

X509.CertIsValidNow Method

C++ (STL) Equivalent

static bool dipki::X509::CertIsValidNow (const std::string &certFile)

Python Equivalent

static X509.cert_is_valid_now(certfile)

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.

[Changed in v12.0] If the certificate is otherwise of correct format but has expired or is not yet valid, this function returns EXPIRED_ERROR (16). Previous versions would return -1.

Example

Dim nRet As Long
Dim strCertName As String
 
strCertName = "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]

[PREV: X509_CertIssuerName...]   [Contents]   [Index]   
   [NEXT: X509_CertRequest...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.