|
IAIK TSP version 2.32 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.tsp.Accuracy
public class Accuracy
This class implements the TSP ASN.1 type Accuracy
as it is
specified in RFC 3161.
Accuracy ::= SEQUENCE { seconds INTEGER OPTIONAL, millis [0] INTEGER (1..999) OPTIONAL, micros [1] INTEGER (1..999) OPTIONAL }
This class handles the ASN.1 structure and the DER encoding and decoding of this structure.
Accuracy
represents the time deviation around the UTC time
contained in GeneralizedTime
. By adding the accuracy value to
the GeneralizedTime, an upper limit of the time at which the timestamp has
been created by the TSA can be obtained. In the same way, by subtracting the
accuracy from the GeneralizedTime, a lower limit of the time at which the
timestamp has been created by the TSA can be obtained.
Accuracy
can be decomposed in seconds, milliseconds (between
1-999) and microseconds (1-999), all expressed as integer.
If the Accuracy
optional field is not present, then the
accuracy may be available through other means, e.g. the
PolicyInformation.
Constructor Summary | |
---|---|
Accuracy()
To construct a new Accuracy object. |
|
Accuracy(ASN1Object component)
This constructor tries to reconstruct an Accuracy object from
a given ASN.1 structure. |
Method Summary | |
---|---|
protected void |
checkRangeOfMicros(int micros)
This method checks if the given parameter is in the range. |
protected void |
checkRangeOfMillis(int millis)
This method checks if the given parameter is in the range. |
protected void |
checkRangeOfSeconds(int seconds)
This method checks if the given parameter is in the range. |
byte[] |
getEncoded()
This method DER encodes the ASN.1 Accuracy object. |
int |
getMicros()
Returns the microseconds fraction of the accuracy. |
int |
getMillis()
Returns the milliseconds of the accuracy. |
int |
getSeconds()
Returns the seconds of the accuracy. |
void |
setMicros(int micros)
This method sets the accuracy in microseconds. |
void |
setMillis(int millis)
This method sets the accuracy in milliseconds. |
void |
setSeconds(int seconds)
This method sets the accuracy in seconds. |
ASN1Object |
toASN1Object()
Returns the ASN.1 structure of the Accuracy object. |
java.lang.String |
toString()
This method returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Accuracy()
Accuracy
object.
public Accuracy(ASN1Object component) throws CodingException
Accuracy
object from
a given ASN.1 structure.
component
- ASN.1 structure to reconstruct.
CodingException
- Thrown if the given ASN1Object
is not a
Accuracy
ASN.1 object.Method Detail |
---|
public byte[] getEncoded()
Accuracy
object.
Accuracy
object.public ASN1Object toASN1Object()
Accuracy
object.
ASN1Object
of the Accuracy
object.public void setSeconds(int seconds) throws java.lang.IllegalArgumentException
seconds
- Accuracy in seconds.
java.lang.IllegalArgumentException
- If the seconds are invalid.public void setMillis(int millis) throws java.lang.IllegalArgumentException
millis
- Accuracy in milliseconds.
java.lang.IllegalArgumentException
- If the milliseconds are invalid.public void setMicros(int micros) throws java.lang.IllegalArgumentException
micros
- Accuracy in microseconds.
java.lang.IllegalArgumentException
- If the microseconds are invalid.public int getSeconds()
public int getMillis()
public int getMicros()
public java.lang.String toString()
toString
in class java.lang.Object
protected void checkRangeOfSeconds(int seconds) throws java.lang.IllegalArgumentException
seconds
- Checks if the seconds are in range.
java.lang.IllegalArgumentException
- If the parameter is out of range.protected void checkRangeOfMillis(int millis) throws java.lang.IllegalArgumentException
millis
- Checks if the milliseconds are in range.
java.lang.IllegalArgumentException
- If the parameter is out of range.protected void checkRangeOfMicros(int micros) throws java.lang.IllegalArgumentException
micros
- Checks if the microseconds are in range.
java.lang.IllegalArgumentException
- If the parameter is out of range.
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |