Returns string containing date and time certificate expires.
VB6/VBA
Debug.Print "Testing X509_CertExpiresOn ..." Dim nRet As Long Dim strCertName As String Dim strDateTime As String * 32 strCertName = "AliceRSASignByCarl.cer" ' Change your dir to suit nRet = X509_CertIssuedOn(strCertName, strDateTime, Len(strDateTime), 0) Debug.Print "X509_CertIssuedOn returns " & nRet & " for " & strCertName & ": " & strDateTime nRet = X509_CertExpiresOn(strCertName, strDateTime, Len(strDateTime), 0) Debug.Print "X509_CertExpiresOn returns " & nRet & " for " & strCertName & ": " & strDateTime
Output
Testing X509_CertExpiresOn ... X509_CertIssuedOn returns 20 for AliceRSASignByCarl.cer: 1999-09-19T01:08:47Z X509_CertExpiresOn returns 20 for AliceRSASignByCarl.cer: 2039-12-31T23:59:59Z
VB.NET
Console.WriteLine("Testing X509_CertExpiresOn ...")
Dim strCertName As String
Dim strDateTime As String
strCertName = "AliceRSASignByCarl.cer"
strDateTime = X509.CertIssuedOn(strCertName)
Console.WriteLine("X509_CertIssuedOn returns " & strDateTime.Length & " for " & strCertName & ": " & strDateTime)
strDateTime = X509.CertExpiresOn(strCertName)
Console.WriteLine("X509_CertExpiresOn returns " & strDateTime.Length & " for " & strCertName & ": " & strDateTime)
[Contents]