ASN1UTCTime.
This datatype is valid only from 1950-01-01 00:00:00 UTC until 2049-12-31 23:59:59 UTC.
X.690
11: Restrictions on BER employed by both CER and DER
11.8 UTCTime
11.8.1 The encoding shall terminate with "Z", as described in the ITU-T X.680 | ISO/IEC 8824-1 clause on UTCTime.11.8.2 The seconds element shall always be present.
11.8.3 Midnight (GMT) shall be represented in the form:
"YYMMDD000000Z"where "YYMMDD" represents the day following the midnight in question.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final byte[] | |
| pack-priv static final ASN1UniversalType |
| Access | Constructor and Description |
|---|---|
| public | ASN1UTCTime(String
the time string. time)The correct format for this is YYMMDDHHMMSSZ (it used to be that seconds were never encoded. |
| public | |
| public | ASN1UTCTime(Date
a date object representing the time of interest. time, Locale an appropriate Locale for producing an ASN.1 UTCTime 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. |
| pack-priv static ASN1UTCTime | |
| pack-priv void | encode(ASN1OutputStream out, boolean withTag)
Implements abstract org. |
| pack-priv final boolean | encodeConstructed()
Implements abstract org. |
| pack-priv int | encodedLength(boolean withTag)
Implements abstract org. |
| public Date | Returns: a date in the range of 1950 to 2049.Return the time as an adjusted date in the range of 1950 - 2049. |
| public String | |
| public Date | Returns: the resulting dateReturn the time as a date based on whatever a 2 digit year will return. |
| public static ASN1UTCTime | Returns: an ASN1UTCTime instance, or null.an ASN1UTCTime or an object that can be converted into one. obj)Return an UTC Time from the passed in object. |
| public static ASN1UTCTime | Returns: an ASN1UTCTime instance, or null.the tagged object holding the object we want taggedObject, boolean true if the object is meant to be explicitly tagged false
otherwise. explicit)Return an UTC Time from a tagged object. |
| public String | |
| public int | hashCode()
Implements abstract org. |
| private boolean | |
| public String |
| contents | back to summary |
|---|---|
| pack-priv final byte[] contents | |
| TYPE | back to summary |
|---|---|
| pack-priv static final ASN1UniversalType TYPE | |
| ASN1UTCTime | back to summary |
|---|---|
| public ASN1UTCTime(String time) The correct format for this is YYMMDDHHMMSSZ (it used to be that seconds were never encoded. When you're creating one of these objects from scratch, that's what you want to use, otherwise we'll try to deal with whatever gets read from the input stream... (this is why the input format is different from the getTime() method output).
| |
| ASN1UTCTime | back to summary |
|---|---|
| public ASN1UTCTime(Date time) Base constructor from a java.util.date object
| |
| ASN1UTCTime | back to summary |
|---|---|
| public ASN1UTCTime(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. | |
| ASN1UTCTime | back to summary |
|---|---|
| pack-priv ASN1UTCTime(byte[] contents) | |
| asn1Equals | back to summary |
|---|---|
| pack-priv boolean asn1Equals(ASN1Primitive o) Implements abstract org. Doc from org. Equality (similarity) comparison for two ASN1Primitive objects. | |
| createPrimitive | back to summary |
|---|---|
| pack-priv static ASN1UTCTime createPrimitive(byte[] contents) | |
| encode | back to summary |
|---|---|
| pack-priv void encode(ASN1OutputStream out, boolean withTag) throws IOException Implements abstract org. | |
| encodeConstructed | back to summary |
|---|---|
| pack-priv final boolean encodeConstructed() Implements abstract org. Doc from org. Return true if this objected is a CONSTRUCTED one, false otherwise.
| |
| encodedLength | back to summary |
|---|---|
| pack-priv int encodedLength(boolean withTag) Implements abstract org. | |
| getAdjustedDate | back to summary |
|---|---|
| public Date getAdjustedDate() throws ParseException Return the time as an adjusted date in the range of 1950 - 2049.
| |
| getAdjustedTime | back to summary |
|---|---|
| public String getAdjustedTime() Return a time string as an adjusted date with a 4 digit year. This goes in the range of 1950 - 2049. | |
| getDate | back to summary |
|---|---|
| public Date getDate() throws ParseException Return the time as a date based on whatever a 2 digit year will return. For standardised processing use getAdjustedDate().
| |
| getInstance | back to summary |
|---|---|
| public static ASN1UTCTime getInstance(Object obj) Return an UTC Time from the passed in object.
| |
| getInstance | back to summary |
|---|---|
| public static ASN1UTCTime getInstance(ASN1TaggedObject taggedObject, boolean explicit) Return an UTC Time from a tagged object.
| |
| getTime | back to summary |
|---|---|
| public String getTime() Return the time - always in the form of YYMMDDhhmmssGMT(+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("yyMMddHHmmssz");
To read in the time and get a date which is compatible with our local
time zone.Note In some cases, due to the local date processing, this may lead to unexpected results. If you want to stick the normal convention of 1950 to 2049 use the getAdjustedTime() method. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract org. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isDigit | back to summary |
|---|---|
| private boolean isDigit(int pos) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |