Top Description Fields Constructors Methods
org.bouncycastle.tsp

public Class TimeStampResponse

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, org.bouncycastle.asn1.ASN1Encodable, .ASN1Encoding, .ASN1InputStream, .DLSequence, org.bouncycastle.asn1.cmp.PKIFailureInfo, .PKIFreeText, .PKIStatus, org.bouncycastle.asn1.cms.Attribute, .ContentInfo, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.tsp.TimeStampResp, org.bouncycastle.util.Arrays

Base class for an RFC 3161 Time Stamp Response object.

Field Summary

Modifier and TypeField and Description
pack-priv TimeStampResp
pack-priv TimeStampToken

Constructor Summary

AccessConstructor and Description
public
public
TimeStampResponse(byte[]
the byte array containing the encoded response.
resp
)

Create a TimeStampResponse from a byte array containing an ASN.1 encoding.

public
TimeStampResponse(InputStream
the input stream containing the encoded response.
in
)

Create a TimeStampResponse from an input stream containing an ASN.1 encoding.

pack-priv

Method Summary

Modifier and TypeMethod and Description
public byte[]
getEncoded()

return the ASN.1 encoded representation of this object.

public byte[]
getEncoded(String
encoding style ("DER", "DL", "BER")
encoding
)

return the ASN.1 encoded representation of this object for the specific encoding type.

public PKIFailureInfo
public int
public String
public TimeStampToken
private static TimeStampResp
public void
validate(TimeStampRequest
the request to be checked against
request
)

Check this response against to see if it a well formed response for the passed in request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

respback to summary
pack-priv TimeStampResp resp
timeStampTokenback to summary
pack-priv TimeStampToken timeStampToken

Constructor Detail

TimeStampResponseback to summary
public TimeStampResponse(TimeStampResp resp) throws TSPException, IOException
TimeStampResponseback to summary
public TimeStampResponse(byte[] resp) throws TSPException, IOException

Create a TimeStampResponse from a byte array containing an ASN.1 encoding.

Parameters
resp:byte[]

the byte array containing the encoded response.

Exceptions
TSPException:
if the response is malformed.
IOException:
if the byte array doesn't represent an ASN.1 encoding.
TimeStampResponseback to summary
public TimeStampResponse(InputStream in) throws TSPException, IOException

Create a TimeStampResponse from an input stream containing an ASN.1 encoding.

Parameters
in:InputStream

the input stream containing the encoded response.

Exceptions
TSPException:
if the response is malformed.
IOException:
if the stream doesn't represent an ASN.1 encoding.
TimeStampResponseback to summary
pack-priv TimeStampResponse(DLSequence dlSequence) throws TSPException, IOException

Method Detail

getEncodedback to summary
public byte[] getEncoded() throws IOException

return the ASN.1 encoded representation of this object.

getEncodedback to summary
public byte[] getEncoded(String encoding) throws IOException

return the ASN.1 encoded representation of this object for the specific encoding type.

Parameters
encoding:String

encoding style ("DER", "DL", "BER")

getFailInfoback to summary
public PKIFailureInfo getFailInfo()
getStatusback to summary
public int getStatus()
getStatusStringback to summary
public String getStatusString()
getTimeStampTokenback to summary
public TimeStampToken getTimeStampToken()
readTimeStampRespback to summary
private static TimeStampResp readTimeStampResp(InputStream in) throws IOException, TSPException
validateback to summary
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:TimeStampRequest

the request to be checked against

Exceptions
TSPException:
if the request can not match this response.