codec.asn1
Class ASN1UTCTime

java.lang.Object
  |
  +--codec.asn1.ASN1AbstractType
        |
        +--codec.asn1.ASN1AbstractString
              |
              +--codec.asn1.ASN1VisibleString
                    |
                    +--codec.asn1.ASN1Time
                          |
                          +--codec.asn1.ASN1UTCTime
All Implemented Interfaces:
ASN1String, ASN1Type, Cloneable, Externalizable, Serializable

public class ASN1UTCTime
extends ASN1Time

This is the root class of all ASN.1 time types. In principle, the known time types are all of type VisibleString. UTCTime is defined as [UNIVESAL 23] IMPLICIT VisibleString.

Version:
"$Id: ASN1UTCTime.java,v 1.6 2004/09/20 15:18:12 pebinger Exp $"
Author:
Volker Roth
See Also:
Serialized Form

Fields inherited from class codec.asn1.ASN1Time
date_, ZEROES
 
Constructor Summary
ASN1UTCTime()
          Creates an instance.
ASN1UTCTime(Calendar cal)
          Creates an instance with the given Calendar.
ASN1UTCTime(Date date)
          Creates an instance with the given date.
ASN1UTCTime(String date)
          Creates an instance with the given date string.
 
Method Summary
protected  int[] getFieldCorrections()
           
protected  int[] getFieldLengths()
           
protected  int[] getFields()
           
 int getTag()
          Method declaration.
static void main(String[] argv)
           
 void setDate(Calendar calendar)
          Sets the time from the given Calendar, miliseconds are ignored and set to 0.
 void setDate(Date date)
          Sets the time from the given Date instance, miliseconds are ignored and set to 0.
 
Methods inherited from class codec.asn1.ASN1Time
decode, encode, getDate, getTime, setDate, setDate, setString, toDate, toString
 
Methods inherited from class codec.asn1.ASN1AbstractString
convert, convert, convertedLength, equals, getString, getValue, hashCode, setString0, toString
 
Methods inherited from class codec.asn1.ASN1AbstractType
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface codec.asn1.ASN1Type
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional
 

Constructor Detail

ASN1UTCTime

public ASN1UTCTime()
Creates an instance. The value of this instance is set to the current date.

ASN1UTCTime

public ASN1UTCTime(String date)
Creates an instance with the given date string. The date string must be well-formed according to the DER encoding of UTCTime.
Parameters:
date - The string representation of the date.
Throws:
IllegalArgumentException - if the given string is not a valid date accoridng to X.680.
StringIndexOutOfBoundsException - if the string is not well-formed.

ASN1UTCTime

public ASN1UTCTime(Calendar cal)
Creates an instance with the given Calendar.
Parameters:
cal - The Calendar.

ASN1UTCTime

public ASN1UTCTime(Date date)
Creates an instance with the given date.
Parameters:
date - The date.
Method Detail

getTag

public int getTag()
Method declaration.
Overrides:
getTag in class ASN1VisibleString
Returns:
The tag value

getFields

protected int[] getFields()
Overrides:
getFields in class ASN1Time

getFieldLengths

protected int[] getFieldLengths()
Overrides:
getFieldLengths in class ASN1Time

getFieldCorrections

protected int[] getFieldCorrections()
Overrides:
getFieldCorrections in class ASN1Time

setDate

public void setDate(Calendar calendar)
Sets the time from the given Calendar, miliseconds are ignored and set to 0.
Overrides:
setDate in class ASN1Time
Parameters:
calendar - The Calendar with the date that shall be set.

setDate

public void setDate(Date date)
Sets the time from the given Date instance, miliseconds are ignored and set to 0.
Overrides:
setDate in class ASN1Time
Parameters:
date - The Date.

main

public static void main(String[] argv)


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.