issrg.ac
Class Generalized_Time

java.lang.Object
  extended by issrg.ac.Generalized_Time
All Implemented Interfaces:
java.lang.Cloneable

public class Generalized_Time
extends java.lang.Object
implements java.lang.Cloneable

This is the class that represents the GeneralizedTime ASN.1 construct. IAIK classes do have a class for GeneralizedTime, but its value is string. This class has a field that is a Calendar, which is deemed more useful when validating ACs.


Field Summary
protected  java.text.SimpleDateFormat formatter
           
 int GENERALIZEDTIME_TAG
           
protected  java.util.Calendar time
           
 
Constructor Summary
protected Generalized_Time()
          This constructor builds a Generalized_Time with the default TimeZone and set to current time (the system time at the time of creating this object).
  Generalized_Time(java.util.Calendar time)
          This constructor builds a Generalized_Time with the time given as a Calendar.
  Generalized_Time(Generalized_Time gt)
          This constructor copies the given Generalized_Time.
 
Method Summary
 java.lang.Object clone()
           
 void decode(ASN1Object ao)
          This method decodes ASN1Object.
 java.util.Calendar getTime()
          Returns the Calendar set to the Time.
 void setTime(java.util.Calendar time)
          Sets the time for this Generalized Time object using Calendar.
 ASN1Object toASN1Object()
          This method returns the ASN1Object of GeneralizedTime.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String ident)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GENERALIZEDTIME_TAG

public final int GENERALIZEDTIME_TAG
See Also:
Constant Field Values

formatter

protected final java.text.SimpleDateFormat formatter

time

protected java.util.Calendar time
Constructor Detail

Generalized_Time

protected Generalized_Time()
This constructor builds a Generalized_Time with the default TimeZone and set to current time (the system time at the time of creating this object).


Generalized_Time

public Generalized_Time(Generalized_Time gt)
This constructor copies the given Generalized_Time.


Generalized_Time

public Generalized_Time(java.util.Calendar time)
This constructor builds a Generalized_Time with the time given as a Calendar.

Method Detail

getTime

public java.util.Calendar getTime()
Returns the Calendar set to the Time.


setTime

public void setTime(java.util.Calendar time)
Sets the time for this Generalized Time object using Calendar.


toASN1Object

public ASN1Object toASN1Object()
This method returns the ASN1Object of GeneralizedTime.


decode

public void decode(ASN1Object ao)
            throws CodingException
This method decodes ASN1Object. It must be GeneralizedTime.

Parameters:
ao - - the ASN1Object of GeneralizedTime
Throws:
CodingException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String ident)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object