The main difference between these and UTC time is a 4 digit year.
One second resolution date+time on UTC timezone (Z) with 4 digit year (valid from 0001 to 9999).
Timestamp format is: yyyymmddHHMMSS'Z'
11.7.1 The encoding shall terminate with a "Z", as described in the ITU-T Rec. X.680 | ISO/IEC 8824-1 clause on GeneralizedTime.
11.7.2 The seconds element shall always be present.
11.7.3 The fractional-seconds elements, if present, shall omit all trailing zeros; if the elements correspond to 0, they shall be wholly omitted, and the decimal point element also shall be omitted.
| Modifier and Type | Field and Description |
|---|---|
| protected byte[] |
| Access | Constructor and Description |
|---|---|
| public | ASN1GeneralizedTime(String
the time string. time)The correct format for this is YYYYMMDDHHMMSS[.f]Z, or without the Z for local time, or Z+-HHMM on the end, for difference between local time and UTC time. |
| public | ASN1GeneralizedTime(Date
a date object representing the time of interest. time)Base constructor from a java.util.date object |
| public | ASN1GeneralizedTime(Date
a date object representing the time of interest. time, Locale an appropriate Locale for producing an ASN.1 GeneralizedTime value. locale)Base constructor from a java.util.date and Locale - you may need to use this if the default locale doesn't use a Gregorian calender so that the GeneralizedTime produced is compatible with other ASN.1 implementations. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | asn1Equals(ASN1Primitive o)
Implements abstract org. |
| private String | |
| private String | |
| pack-priv void | |
| pack-priv int | encodedLength()
Implements abstract org. |
| public Date | |
| public static ASN1GeneralizedTime | Returns: an ASN1GeneralizedTime instance, or null.an ASN1GeneralizedTime or an object that can be converted into one. obj)return a generalized time from the passed in object |
| public static ASN1GeneralizedTime | Returns: an ASN1GeneralizedTime instance.the tagged object holding the object we want obj, boolean true if the object is meant to be explicitly
tagged false otherwise. explicit)return a Generalized Time object from a tagged object. |
| public String | Returns: a String representation of the time.return the time - always in the form of YYYYMMDDhhmmssGMT(+hh:mm|-hh:mm). |
| public String | |
| protected boolean | |
| public int | hashCode()
Implements abstract org. |
| protected boolean | |
| protected boolean | |
| pack-priv boolean | isConstructed()
Implements abstract org. |
| private boolean | |
| pack-priv ASN1Primitive | toDERObject()
Return the current object as one which encodes using Distinguished Encoding Rules.
|
| time | back to summary |
|---|---|
| protected byte[] time | |
| ASN1GeneralizedTime | back to summary |
|---|---|
| public ASN1GeneralizedTime(String time) The correct format for this is YYYYMMDDHHMMSS[.f]Z, or without the Z for local time, or Z+-HHMM on the end, for difference between local time and UTC time. The fractional second amount f must consist of at least one number with trailing zeroes removed.
| |
| ASN1GeneralizedTime | back to summary |
|---|---|
| public ASN1GeneralizedTime(Date time) Base constructor from a java.util.date object
| |
| ASN1GeneralizedTime | back to summary |
|---|---|
| public ASN1GeneralizedTime(Date time, Locale locale) Base constructor from a java.util.date and Locale - you may need to use this if the default locale doesn't use a Gregorian calender so that the GeneralizedTime produced is compatible with other ASN.1 implementations. | |
| ASN1GeneralizedTime | back to summary |
|---|---|
| pack-priv ASN1GeneralizedTime(byte[] bytes) | |
| asn1Equals | back to summary |
|---|---|
| pack-priv boolean asn1Equals(ASN1Primitive o) Implements abstract org. Doc from org. Equality (similarity) comparison for two ASN1Primitive objects. | |
| calculateGMTOffset | back to summary |
|---|---|
| private String calculateGMTOffset() | |
| convert | back to summary |
|---|---|
| private String convert(int time) | |
| encode | back to summary |
|---|---|
| pack-priv void encode(ASN1OutputStream out) throws IOException Implements abstract org. | |
| encodedLength | back to summary |
|---|---|
| pack-priv int encodedLength() Implements abstract org. Doc from org. Return the length of the encoding this object will produce.
| |
| getDate | back to summary |
|---|---|
| public Date getDate() throws ParseException | |
| getInstance | back to summary |
|---|---|
| public static ASN1GeneralizedTime getInstance(Object obj) return a generalized time from the passed in object
| |
| getInstance | back to summary |
|---|---|
| public static ASN1GeneralizedTime getInstance(ASN1TaggedObject obj, boolean explicit) return a Generalized Time object from a tagged object.
| |
| getTime | back to summary |
|---|---|
| public String getTime() return the time - always in the form of YYYYMMDDhhmmssGMT(+hh:mm|-hh:mm). Normally in a certificate we would expect "Z" rather than "GMT", however adding the "GMT" means we can just use:
dateF = new SimpleDateFormat("yyyyMMddHHmmssz");
To read in the time and get a date which is compatible with our local
time zone.
| |
| getTimeString | back to summary |
|---|---|
| public String getTimeString() Return the time.
| |
| hasFractionalSeconds | back to summary |
|---|---|
| protected boolean hasFractionalSeconds() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract org. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasMinutes | back to summary |
|---|---|
| protected boolean hasMinutes() | |
| hasSeconds | back to summary |
|---|---|
| protected boolean hasSeconds() | |
| isConstructed | back to summary |
|---|---|
| pack-priv boolean isConstructed() Implements abstract org. Doc from org. Return true if this objected is a CONSTRUCTED one, false otherwise.
| |
| isDigit | back to summary |
|---|---|
| private boolean isDigit(int pos) | |
| toDERObject | back to summary |
|---|---|
| pack-priv ASN1Primitive toDERObject() Overrides org. Doc from org. Return the current object as one which encodes using Distinguished Encoding Rules.
| |