On Tue, Nov 14, 2006, [EMAIL PROTECTED] wrote:

> 
> Hi Team,
> 
> I found the following API to get the time ASN1_GENERALIZEDTIME format.
> ======================================================
> ASN1_TIME *ctm = NULL;
> ASN1_GENERALIZEDTIME *asn1_time = NULL;
> 
>  ctm = M_ASN1_TIME_dup (X509_CRL_get_nextUpdate(base_crl));
>  asn1_time = M_ASN1_GENERALIZEDTIME_dup(ctm);
> 
>  printf ("The CRL's NEXT UPDATE TIME in ASN1_GENERALIZEDTIME format:
> %s", asn1_time->data);
> =======================================================
> Result of this code is:
> The CRL's NEXT UPDATE TIME in ASN1_GENERALIZEDTIME format:
> [061117082334Z]
> ========================================================
> 
> The time I am seeing is: 061117082334Z.
> Can I interpret that time like : 2006 Nov 17 08:23:34 ?. But how do I
> convert like this?
> 
> How do i convert the 061117082334Z to 2006 Nov 17 08:23:34 ?.
> 
> Appreciate your thouights on the same. Thanks a lot.
> 

That is not GeneralizedTime format and those macros should not be used in
applications.

If you want to convert an ASN1_TIME to GeneralizedTime then the function
ASN1_TIME_to_generalizedtime() will do it.

If you want to print the result in human readable form then ASN1_TIME_print()
will do the trick.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to