Class TimeStampResponse
java.lang.Object
org.bouncycastle.tsp.TimeStampResponse
Base class for an RFC 3161 Time Stamp Response object.
-
Constructor Summary
ConstructorsConstructorDescriptionTimeStampResponse(byte[] resp) Create a TimeStampResponse from a byte array containing an ASN.1 encoding.Create a TimeStampResponse from an input stream containing an ASN.1 encoding.TimeStampResponse(org.bouncycastle.asn1.tsp.TimeStampResp resp) Create a TimeStampResponse from the passed in ASN.1 structure. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]return the ASN.1 encoded representation of this object.byte[]getEncoded(String encoding) return the ASN.1 encoded representation of this object for the specific encoding type.org.bouncycastle.asn1.cmp.PKIFailureInfointvoidvalidate(TimeStampRequest request) Check this response against to see if it a well formed response for the passed in request.
-
Constructor Details
-
TimeStampResponse
public TimeStampResponse(org.bouncycastle.asn1.tsp.TimeStampResp resp) throws TSPException, IOException Create a TimeStampResponse from the passed in ASN.1 structure.- Parameters:
resp- the ASN.1 TimeStampResp the response is based on.- Throws:
TSPException- if the embedded time-stamp token is malformed.IOException- if the embedded time-stamp token cannot be processed.
-
TimeStampResponse
Create a TimeStampResponse from a byte array containing an ASN.1 encoding.- Parameters:
resp- the byte array containing the encoded response.- Throws:
TSPException- if the response is malformed.IOException- if the byte array doesn't represent an ASN.1 encoding.
-
TimeStampResponse
Create a TimeStampResponse from an input stream containing an ASN.1 encoding.- Parameters:
in- the input stream containing the encoded response.- Throws:
TSPException- if the response is malformed.IOException- if the stream doesn't represent an ASN.1 encoding.
-
-
Method Details
-
getStatus
public int getStatus()- Returns:
- the PKIStatus value of the response (e.g. PKIStatus.GRANTED).
-
getStatusString
- Returns:
- the concatenated free-text status string, null if none was supplied.
-
getFailInfo
public org.bouncycastle.asn1.cmp.PKIFailureInfo getFailInfo()- Returns:
- the failure information for a non-granted response, null if none is present.
-
getTimeStampToken
- Returns:
- the time-stamp token carried by the response, null if the request was not granted.
-
validate
Check this response against to see if it a well formed response for the passed in request. Validation will include checking the time stamp token if the response status is GRANTED or GRANTED_WITH_MODS.- Parameters:
request- the request to be checked against- Throws:
TSPException- if the request can not match this response.
-
getEncoded
return the ASN.1 encoded representation of this object.- Throws:
IOException
-
getEncoded
return the ASN.1 encoded representation of this object for the specific encoding type.- Parameters:
encoding- encoding style ("DER", "DL", "BER")- Throws:
IOException
-