public class TimeStampResp extends java.lang.Object implements ASN1Type
TimeStampResp ::= SEQUENCE {
status PKIStatusInfo,
timeStampToken TimeStampToken OPTIONAL
}
The status is based on the definition of status in section 3.2.3 of [RFC2510] as follows:
PKIStatusInfo ::= SEQUENCE {
status PKIStatus,
statusString PKIFreeText OPTIONAL,
failInfo PKIFailureInfo OPTIONAL
}
When the status contains the value zero or one, a TimeStampToken MUST be present. When status contains a value other than zero or one, a TimeStampToken MUST NOT be present. One of the following values MUST be contained in status:
PKIStatus ::= INTEGER { granted (0), -- when the PKIStatus contains the value zero a TimeStampToken, as -- requested, is present. grantedWithMods (1), -- when the PKIStatus contains the value one a TimeStampToken, -- with modifications, is present. rejection (2), waiting (3), revocationWarning (4), -- this message contains a warning that a revocation is -- imminent revocationNotification (5) -- notification that a revocation has occurred }
Compliant servers SHOULD NOT produce any other values. Compliant clients MUST generate an error if values it does not understand are present.
When the TimeStampToken is not present, the failInfo indicates the reason why the time-stamp request was rejected and may be one of the following values:
PKIFailureInfo ::= BIT STRING {
badAlg (0),
-- unrecognized or unsupported Algorithm Identifier
badRequest (2),
-- transaction not permitted or supported
badDataFormat (5),
-- the data submitted has the wrong format
timeNotAvailable (14),
-- the TSA's time source is not available
unacceptedPolicy (15),
-- the requested TSA policy is not supported by the TSA
unacceptedExtension (16),
-- the requested extension is not supported by the TSA
addInfoNotAvailable (17),
-- the additional information requested could not be understood
-- or is not available
systemFailure (25)
-- the request cannot be handled due to system failure
}
These are the only values of PKIFailureInfo that SHALL be supported.
Compliant servers SHOULD NOT produce any other values. Compliant clients MUST generate an error if values it does not understand are present.
The statusString field of PKIStatusInfo MAY be used to include reason text such as "messageImprint field is not correctly formatted".
| Constructor and Description |
|---|
TimeStampResp(ASN1Object obj)
Creates a new
TimeStampResp object from an
ASN1Object. |
TimeStampResp(PKIStatusInfo status)
Creates a new
TimeStampResp object with the specified
components. |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes a
TimeStampResp object from an ASN1Object. |
PKIStatusInfo |
getStatus()
Returns the status of the response.
|
TimeStampToken |
getTimeStampToken()
Returns the timestamp token.
|
void |
setTimeStampToken(TimeStampToken timeStampToken)
Sets the timestamp token.
|
ASN1Object |
toASN1Object()
Encodes this
TimeStampResp object as an
ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
TimeStampResp object. |
public TimeStampResp(PKIStatusInfo status)
TimeStampResp object with the specified
components.
status - the status of the responsepublic TimeStampResp(ASN1Object obj) throws CodingException
TimeStampResp object from an
ASN1Object.
The ASN1Object must be a TimeStampResp structure.
obj - the ASN.1 representation of a TimeStampResp structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic PKIStatusInfo getStatus()
public TimeStampToken getTimeStampToken()
null if the timeStampToken
component is not setpublic void setTimeStampToken(TimeStampToken timeStampToken)
timeStampToken - the timeStampToken componentpublic void decode(ASN1Object obj) throws CodingException
TimeStampResp object from an ASN1Object.
The ASN1Object must contain a TimeStampResp structure.
decode in interface ASN1Typeobj - an ASN.1 representation of a TimeStampResp structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object() throws CodingException
TimeStampResp object as an
ASN1Object.
toASN1Object in interface ASN1TypeCodingException - thrown if the timestamp token component has not been created
properlypublic java.lang.String toString()
TimeStampResp object.
toString in class java.lang.Object