org.bouncycastle.tsp

Class TimeStampResponse


public class TimeStampResponse
extends java.lang.Object

Base class for an RFC 3161 Time Stamp Response object.

Constructor Summary

TimeStampResponse(InputStream in)
Create a TimeStampResponse from an input stream containing an ASN.1 encoding.
TimeStampResponse(TimeStampResp resp)
TimeStampResponse(byte[] resp)
Create a TimeStampResponse from a byte array containing an ASN.1 encoding.

Method Summary

byte[]
getEncoded()
return the ASN.1 encoded representation of this object.
PKIFailureInfo
getFailInfo()
int
getStatus()
String
getStatusString()
TimeStampToken
getTimeStampToken()
void
validate(TimeStampRequest request)
Check this response against to see if it a well formed response for the passed in request.

Constructor Details

TimeStampResponse

public TimeStampResponse(InputStream in)
            throws TSPException,
                   IOException
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.

TimeStampResponse

public TimeStampResponse(TimeStampResp resp)
            throws TSPException,
                   IOException

TimeStampResponse

public TimeStampResponse(byte[] resp)
            throws TSPException,
                   IOException
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.

Method Details

getEncoded

public byte[] getEncoded()
            throws IOException
return the ASN.1 encoded representation of this object.

getFailInfo

public PKIFailureInfo getFailInfo()

getStatus

public int getStatus()

getStatusString

public String getStatusString()

getTimeStampToken

public TimeStampToken getTimeStampToken()

validate

public void validate(TimeStampRequest request)
            throws TSPException
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.