com.ibm.security.krb5.internal
Class KerberosTime
- java.lang.Object
com.ibm.security.krb5.internal.KerberosTime
All implemented interfaces:
java.lang.Cloneable
- public class KerberosTime
- extends java.lang.Object
- implements java.lang.Cloneable
This definition reflects the Network Working Group RFC 1510 specifications dated September 1993 and available at http://www.ietf.org/rfc/rfc1510.txt.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
NOW
|
|
UNADJUSTED_NOW
|
Constructor Summary
Constructor and Description |
---|
KerberosTime()
|
KerberosTime(boolean initToNow)
|
KerberosTime(java.util.Date time)
|
KerberosTime(com.ibm.security.util.DerValue encoding)
Constructs a KerberosTime object.
|
KerberosTime(long time)
|
KerberosTime(java.lang.String time)
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
asn1Encode()
Encodes this object to a byte array.
|
|
clone()
|
|
equals(KerberosTime time)
|
|
getMicroSeconds()
|
|
getSeconds()
|
|
getTime()
|
|
greaterThan(KerberosTime time)
|
|
greaterThanWRTClockSkew(KerberosTime time)
|
|
greaterThanWRTClockSkew(KerberosTime time,int clockSkew)
|
|
inClockSkew()
|
|
inClockSkew(int clockSkew)
|
|
isZero()
|
|
parse(com.ibm.security.util.DerInputStream data,byte explicitTag,boolean optional)
Parse (unmarshal) a kerberostime from a DER input stream.
|
|
setMicroSeconds(int usec)
|
|
setMicroSeconds(java.lang.Integer usec)
|
|
setNow()
|
|
setSeconds(int sec)
|
|
setTime(java.util.Date time)
|
|
setTime(long time)
|
|
toDate()
|
|
toGeneralizedTimeString()
Returns a string representation of KerberosTime object.
|
|
zeroPad(java.lang.String s,int length)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
NOW
- public static final boolean NOW
See Also:
UNADJUSTED_NOW
- public static final boolean UNADJUSTED_NOW
See Also:
Constructor Detail
KerberosTime
- public KerberosTime()
KerberosTime
- public KerberosTime(long time)
KerberosTime
- public KerberosTime(java.lang.String time)
- throws Asn1Exception
Throws:
KerberosTime
- public KerberosTime(com.ibm.security.util.DerValue encoding)
- throws Asn1Exception
- java.io.IOException
Constructs a KerberosTime object.
Parameters:
encoding
- a DER-encoded data. Throws:
Asn1Exception
- if an error occurs while decoding an ASN1 encoded data. java.io.IOException
- if an I/O error occurs while reading encoded data. KerberosTime
- public KerberosTime(java.util.Date time)
KerberosTime
- public KerberosTime(boolean initToNow)
Method Detail
clone
- public java.lang.Object clone()
Overrides:
clone
in class java.lang.Object
zeroPad
- public static java.lang.String zeroPad( java.lang.String s,
- int length)
toGeneralizedTimeString
- public java.lang.String toGeneralizedTimeString( )
Returns a string representation of KerberosTime object.
Returns:
a string representation of this object.
asn1Encode
- public byte[] asn1Encode()
- throws Asn1Exception
- java.io.IOException
Encodes this object to a byte array.
Returns:
a byte array of encoded data.
Throws:
Asn1Exception
- if an error occurs while decoding an ASN1 encoded data. java.io.IOException
- if an I/O error occurs while reading encoded data. getTime
- public long getTime()
setTime
- public void setTime(java.util.Date time)
setTime
- public void setTime(long time)
toDate
- public java.util.Date toDate()
setNow
- public void setNow()
getMicroSeconds
- public int getMicroSeconds()
setMicroSeconds
- public void setMicroSeconds(int usec)
setMicroSeconds
- public void setMicroSeconds(java.lang.Integer usec)
inClockSkew
- public boolean inClockSkew(int clockSkew)
inClockSkew
- public boolean inClockSkew()
greaterThanWRTClockSkew
- public boolean greaterThanWRTClockSkew( KerberosTime time,
- int clockSkew)
greaterThanWRTClockSkew
- public boolean greaterThanWRTClockSkew( KerberosTime time)
greaterThan
- public boolean greaterThan(KerberosTime time)
equals
- public boolean equals(KerberosTime time)
isZero
- public boolean isZero()
getSeconds
- public int getSeconds()
setSeconds
- public void setSeconds(int sec)
parse
- public static KerberosTime parse( com.ibm.security.util.DerInputStream data,
- byte explicitTag,
- boolean optional)
- throws Asn1Exception
- java.io.IOException
Parse (unmarshal) a kerberostime from a DER input stream. This form
parsing might be used when expanding a value which is part of
a constructed sequence and uses explicitly tagged type.
Parameters:
data
- the Der input stream value, which contains one or more marshaled value. explicitTag
- tag number. optional
- indicates if this data field is optional Returns:
an instance of KerberosTime.
Throws:
Asn1Exception
- on error. java.io.IOException