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
| Methods inherited from class codec.asn1.ASN1AbstractType |
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, writeExternal |
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.
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.