RSA BSAFE Cert-C

Certificate Components for C

Crypto-C 6.2.1 Developer's Guide
Search

GENERALIZED_TIME Reference

Stores a time value.

The time value is represented in the Generalized Time format, defined in the X.680 standard, ASN.1. The GENERALIZED_TIME structure is used in the INVALID_DATE, OCSP_EVIDENCE, PKI_MSG_FIELDS, and PRIVATE_KEY_USAGE_PERIOD structures, and with C_DEREncodeGeneralizedTime() and C_BERDecodeGeneralizedTime().

For example, the following statements input the UTC time of 6 minutes, 27.000003 seconds after 9:00 P.M. on November 6, 1985 (the X.680 UTC time is 19851106210627.000003Z).

GENERALIZED_TIME generalizedTime;

generalizedTime.year = 1985;
generalizedTime.month = 11;
generalizedTime.day = 6;
generalizedTime.hour = 21;
generalizedTime.minute = 6;
generalizedTime.second = 27;
generalizedTime.microSecond = 3;
generalizedTime.timeZone = 0;

Samples:

asn1.c, and timeutil.c.

#include <basetype.h>

typedef struct GENERALIZED_TIME {
  unsigned short year;
  unsigned short month;
  unsigned short day;
  unsigned short hour;
  unsigned short minute;
  unsigned short second;
  UINT4 microSecond;
  short int timeZone;
} GENERALIZED_TIME;

Data Fields

unsigned short year
 A four-digit number representing the year.

unsigned short month
 A two-digit number representing the month of the year. More...

unsigned short day
 A two-digit number representing the day of the month. More...

unsigned short hour
 A two-digit number representing the hour of the day. More...

unsigned short minute
 A two-digit number representing the minute of the hour. More...

unsigned short second
 A two-digit number representing the second of the minute. More...

UINT4 microSecond
 A UINT4 value that represents a fraction of a second in microsecond units.

short int timeZone
 A short int value that represents the difference in minutes, moving westward, between the UTC, defined in X.208, and local time. More...


Field Documentation

unsigned short day
 

A two-digit number representing the day of the month. Value is from 01 to 31.

unsigned short hour
 

A two-digit number representing the hour of the day. Value is from 00 to 23.

unsigned short minute
 

A two-digit number representing the minute of the hour. Value is from 00to 59.

unsigned short month
 

A two-digit number representing the month of the year. Value is from 01 to 12.

unsigned short second
 

A two-digit number representing the second of the minute. Value is from 00 to 59.

short int timeZone
 

A short int value that represents the difference in minutes, moving westward, between the UTC, defined in X.208, and local time. If this field is 0, then the time is the UTC time. Otherwise, the time is a local time.


Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 067-001001-2720-001-000 - 2.7.2