25 #ifndef __ASN1TTIME_H__ 26 #define __ASN1TTIME_H__ 34 #define MAX_TIMESTR_SIZE 64 42 #define LOG_TTMERR(stat) (mStatus = stat, stat) 140 January = 1, Jan = 1,
141 February = 2, Feb = 2,
148 September = 9, Sep = 9,
149 October = 10, Oct = 10,
150 November = 11, Nov = 11,
151 December = 12, Dec = 12
165 EXTRTMETHOD ASN1TTime (OSBOOL useDerRules);
173 EXTRTMETHOD ASN1TTime (
const ASN1TTime& original);
178 virtual EXTRTMETHOD ~ASN1TTime();
190 virtual EXTRTMETHOD
int getYear()
const;
205 virtual EXTRTMETHOD
int getMonth()
const;
218 virtual EXTRTMETHOD
int getDay()
const;
231 virtual EXTRTMETHOD
int getHour()
const;
243 virtual EXTRTMETHOD
int getMinute()
const;
255 virtual EXTRTMETHOD
int getSecond()
const;
266 virtual EXTRTMETHOD
int getFraction()
const;
279 virtual EXTRTMETHOD
double getFractionAsDouble()
const;
290 virtual EXTRTMETHOD
int getFractionStr(
char*
const pBuf,
size_t bufSize)
const;
300 virtual EXTRTMETHOD
int getFractionLen()
const;
316 virtual EXTRTMETHOD
int getDiffHour()
const;
332 virtual EXTRTMETHOD
int getDiffMinute()
const;
348 virtual EXTRTMETHOD
int getDiff()
const;
358 virtual EXTRTMETHOD OSBOOL getUTC()
const;
375 virtual EXTRTMETHOD time_t getTime()
const;
381 void setDER (OSBOOL bvalue) { mbDerRules = bvalue; }
394 virtual EXTRTMETHOD
int setUTC(OSBOOL utc);
407 virtual EXTRTMETHOD
int setYear(
short year_);
423 virtual EXTRTMETHOD
int setMonth(
short month_);
437 virtual EXTRTMETHOD
int setDay(
short day_);
451 virtual EXTRTMETHOD
int setHour(
short hour_);
464 virtual EXTRTMETHOD
int setMinute(
short minute_);
477 virtual EXTRTMETHOD
int setSecond(
short second_);
494 virtual EXTRTMETHOD
int setFraction(
int fraction,
int fracLen = -1);
507 virtual EXTRTMETHOD
int setFraction (
double frac,
int fracLen);
518 virtual EXTRTMETHOD
int setFraction (
char const* frac);
536 virtual int setTime(time_t time, OSBOOL diffTime) = 0;
555 virtual EXTRTMETHOD
int setDiffHour(
short dhour);
575 virtual EXTRTMETHOD
int setDiff(
short dhour,
short dminute);
593 virtual EXTRTMETHOD
int setDiff(
short inMinutes);
607 virtual int parseString (
const char*
string) = 0;
615 virtual EXTRTMETHOD
void clear();
627 virtual int compileString (
char* pbuf,
size_t bufsize)
const = 0;
633 virtual EXTRTMETHOD
int equals (
const ASN1TTime&)
const;
642 EXTRTMETHOD
const char* toString (
char* pbuf,
size_t bufsize)
const;
650 EXTRTMETHOD
const char* toString (
OSCTXT* pctxt)
const;
659 EXTRTMETHOD
const char* toString ()
const;
661 EXTRTMETHOD
const ASN1TTime& operator = (
const ASN1TTime& );
662 virtual EXTRTMETHOD OSBOOL
operator == (
const ASN1TTime&)
const;
663 virtual EXTRTMETHOD OSBOOL
operator != (
const ASN1TTime&)
const;
664 virtual EXTRTMETHOD OSBOOL
operator > (
const ASN1TTime&)
const;
665 virtual EXTRTMETHOD OSBOOL
operator < (
const ASN1TTime&)
const;
666 virtual EXTRTMETHOD OSBOOL
operator >= (
const ASN1TTime&)
const;
667 virtual EXTRTMETHOD OSBOOL
operator <= (
const ASN1TTime&)
const;
670 EXTRTMETHOD
static int checkDate (
int day,
int month,
int year);
671 EXTRTMETHOD
void privateInit ();
673 EXTRTMETHOD
static void addMilliseconds (
int deltaMs,
674 short& year,
short& month,
short& day,
675 short& hour,
short& minute,
676 short& second,
int& secFraction,
678 EXTRTMETHOD
static void addDays (
int deltaDays,
short& year,
short& month,
short& day);
680 EXTRTMETHOD
int getDaysNum ()
const;
681 EXTRTMETHOD
long getMillisNum ()
const;
683 EXTRTMETHOD
static short daysInMonth(
int i);
684 EXTRTMETHOD
static int daysAfterMonth(
int i);
685 int ncharsToInt (
const char* str, OSSIZE nchars,
int& value);
731 EXTRTMETHOD
int getCentury()
const;
742 EXTRTMETHOD
int setCentury(
short century);
758 EXTRTMETHOD
int setTime(time_t time, OSBOOL diffTime);
769 inline const ASN1TGeneralizedTime&
operator =
770 (
const ASN1TGeneralizedTime& tm)
772 return (
const ASN1TGeneralizedTime&) ASN1TTime::operator = (tm);
785 EXTRTMETHOD
int compileString (
char* pbuf,
size_t bufsize)
const;
806 EXTRTMETHOD ASN1TUTCTime(
const char* timeStr, OSBOOL useDerRules = FALSE);
813 EXTRTMETHOD ASN1TUTCTime(OSBOOL useDerRules);
835 EXTRTMETHOD
int setYear(
short year_);
848 EXTRTMETHOD
int setTime(time_t time, OSBOOL diffTime);
861 EXTRTMETHOD
int setUTC (OSBOOL utc);
866 EXTRTMETHOD
void clear();
878 EXTRTMETHOD
int compileString (
char* pbuf,
size_t bufsize)
const;
891 const ASN1TUTCTime& operator = (
const ASN1TUTCTime& tm) {
892 return (ASN1TUTCTime&) ASN1TTime::operator = (tm);
906 EXTRTMETHOD
int setFraction (
int fraction,
int fracLen = -1);
909 #endif //__ASN1TTIME_H__ ASN1TGeneralizedTime()
Definition: ASN1TTime.h:698
short mSecond
Definition: ASN1TTime.h:101
int operator>=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
Definition: ASN1TTime.h:71
short mDiffHour
Definition: ASN1TTime.h:106
short mMonth
Definition: ASN1TTime.h:81
int operator<=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
Definition: ASN1TTime.h:792
virtual int setTime(time_t time, OSBOOL diffTime)=0
int operator<(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
virtual EXTRTMETHOD int getFraction() const
ASN1TGeneralizedTime(OSBOOL useDerRules)
Definition: ASN1TTime.h:713
int operator==(const ASN1OBJID &lhs, const ASN1OBJID &rhs)
int mStatus
Definition: ASN1TTime.h:126
OSBOOL mbUtcFlag
Definition: ASN1TTime.h:131
Definition: ASN1TTime.h:692
short mYear
Definition: ASN1TTime.h:76
ASN1TUTCTime(const ASN1TUTCTime &original)
Definition: ASN1TTime.h:818
virtual EXTRTMETHOD void clear()
virtual EXTRTMETHOD int setFraction(int fraction, int fracLen=-1)
virtual EXTRTMETHOD int setYear(short year_)
OSBOOL mbDerRules
Definition: ASN1TTime.h:137
virtual EXTRTMETHOD int setUTC(OSBOOL utc)
short mMinute
Definition: ASN1TTime.h:96
int mSecFracLen
Definition: ASN1TTime.h:121
short mDiffMin
Definition: ASN1TTime.h:111
virtual int compileString(char *pbuf, size_t bufsize) const =0
short mDay
Definition: ASN1TTime.h:86
Definition: rtxContext.h:185
void setDER(OSBOOL bvalue)
Definition: ASN1TTime.h:381
virtual int parseString(const char *string)=0
int mSecFraction
Definition: ASN1TTime.h:116
short mHour
Definition: ASN1TTime.h:91
int operator!=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
int operator>(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
ASN1TGeneralizedTime(const ASN1TGeneralizedTime &original)
Definition: ASN1TTime.h:719