kz.gamma.hardware.tsp
Class TimeStampResponse

java.lang.Object
  extended by kz.gamma.hardware.tsp.TimeStampResponse

public class TimeStampResponse
extends java.lang.Object

Base class for an RFC 3161 Time Stamp Response object.


Field Summary
(package private)  TimeStampResp resp
           
(package private)  TimeStampToken timeStampToken
           
 
Constructor Summary
TimeStampResponse(byte[] resp)
          Create a TimeStampResponse from a byte array containing an ASN.1 encoding.
TimeStampResponse(java.io.InputStream in)
          Create a TimeStampResponse from an input stream containing an ASN.1 encoding.
TimeStampResponse(TimeStampResp resp)
           
 
Method Summary
 byte[] getEncoded()
          return the ASN.1 encoded representation of this object.
 PKIFailureInfo getFailInfo()
           
 int getStatus()
           
 java.lang.String getStatusString()
           
 TimeStampToken getTimeStampToken()
           
private static TimeStampResp readTimeStampResp(java.io.InputStream in)
           
 void validate(TimeStampRequest request)
          Check this response against to see if it a well formed response for the passed in request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resp

TimeStampResp resp

timeStampToken

TimeStampToken timeStampToken
Constructor Detail

TimeStampResponse

public TimeStampResponse(TimeStampResp resp)
                  throws TSPException,
                         java.io.IOException
Throws:
TSPException
java.io.IOException

TimeStampResponse

public TimeStampResponse(byte[] resp)
                  throws TSPException,
                         java.io.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.
java.io.IOException - if the byte array doesn't represent an ASN.1 encoding.

TimeStampResponse

public TimeStampResponse(java.io.InputStream in)
                  throws TSPException,
                         java.io.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.
java.io.IOException - if the stream doesn't represent an ASN.1 encoding.
Method Detail

readTimeStampResp

private static TimeStampResp readTimeStampResp(java.io.InputStream in)
                                        throws java.io.IOException,
                                               TSPException
Throws:
java.io.IOException
TSPException

getStatus

public int getStatus()

getStatusString

public java.lang.String getStatusString()

getFailInfo

public PKIFailureInfo getFailInfo()

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.

getEncoded

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

Throws:
java.io.IOException


Copyright © 2013 Gamma Technologies. All Rights Reserved.