|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--iaik.asn1.ASN1Object
|
+--iaik.asn1.UTCTime
This class implements the native ASN.1 type "UTCTime".
UTCTime is a simple useful ASN.1 string type identified by the UNIVERSAL TAG number 23.
An ASN.1 UTCTime object may represent any coordinated universal time or Greenwich Mean Time (GMT) value. An UTCTime value specifies the calendar date (year, month, day: YYMMDD), the time value (hours, minutes and optionally seconds: hhmmss) and the time zone respectively time-shift: Z denotes that the local time corresponds to GMT, a time-shift is indicated by +/- <time value>.
For instance: local time is GMT and represents the twelfth November 1997 at 15:30:10p.m:
UTCTime utcTime = new UTCTime("971112153010Z");
Supposing a time-shift of two hours making the lokal time ahead from GMT, we may
write:
UTCTime utcTime = new UTCTime("971112173010+0200");
Conforming systems shall interpret the year field (YY) as follows:
For higher precision use GeneralizedTime.
When calling the getValue method for getting the inherent
value from an ASN.1 UTCTime instance, a Java object of type
String is returned:
String timeStr = (String)utcTime.getValue();DER en/decoding generally is done by means of the several methods of the
DerCoder class; decoding alternatively may be performed by
using the DerInputStream utility.
ASN1Object,
ASN,
GeneralizedTime| Fields inherited from class iaik.asn1.ASN1Object |
asnType,
encode_listener,
stream_mode |
| Constructor Summary | |
protected |
UTCTime()
Creates an empty object. |
|
UTCTime(java.lang.String value)
Creates a new ASN.1 UTCTime object for the given Java String value. |
| Method Summary | |
protected void |
decode(int length,
java.io.InputStream is)
Decodes a UTCTime value from the given InputStream. |
protected void |
encode(java.io.OutputStream os)
DER encodes this UTCTime ASN1Object and writes the result to the given output stream. |
java.lang.Object |
getValue()
Returns the value of this UTCTime as a String. |
void |
setValue(java.lang.Object object)
Sets the value of this UTCTime. |
java.lang.String |
toString()
Returns a string that represents the contents of this UTCTime ASN1Object. |
| Methods inherited from class iaik.asn1.ASN1Object |
addComponent,
addEncodeListener,
countComponents,
encodeObject,
getAsnType,
getComponentAt,
indefiniteLength,
isA,
isConstructed,
setIndefiniteLength,
setIndefiniteRecursive |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
protected UTCTime()
public UTCTime(java.lang.String value)
value - the String value this UTCTime object should be initialized with| Method Detail |
public java.lang.Object getValue()
public void setValue(java.lang.Object object)
String.value - the String value this UTCTime object shall represent
protected void encode(java.io.OutputStream os)
throws java.io.IOException
encode methods of the
DerCoder class for performing
the encoding, and the DerCoder internally will call this
encode method.os - the output stream to which to write the data
protected void decode(int length,
java.io.InputStream is)
throws java.io.IOException
length bytes to be read represent the value of an
ASN.1 object of type UTCTime.
This is a protected method and will not be used by
an application for decoding a DER encoded UTCTime.
An application will call one of the decode methods
of the DerCoder class for performing
the decoding. The DerCoder then determines the number of
bytes (length) occupied by the value of this UTCTime
object and internally calls this decode
method for actually reading the value.
length - the already decoded length, i.e. number of the bytes representing the
value of the GeneralizedTime to be decodedis - the input stream from which the DER encoded data is read inpublic java.lang.String toString()
ASN1Object.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||