IAIK TSP
version 2.32

demo.tsp.connections.http
Class TspHttpClientDemo

java.lang.Object
  extended by demo.tsp.connections.http.TspHttpClientDemo

public class TspHttpClientDemo
extends java.lang.Object

This class implements a TSP HTTP client connection. For details please refer to:
RFC 3161.


Field Summary
protected static java.lang.String DEFAULT_URL
          The url of the default tsa server
protected static org.apache.commons.logging.Log log
          The logger for this class.
protected static java.lang.String MESSAGE
          Message to be time stamped
 
Constructor Summary
TspHttpClientDemo(java.lang.String url)
          Initializes the TSP http client with the given URL.
 
Method Summary
static void main(java.lang.String[] args)
          Creates a time stamp request and sends it to the specified server.
 TspHttpResponse sendAndReceiveData(TimeStampReq request)
          This method sends a TimeStampReq to the specified time stamping server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
The logger for this class.


DEFAULT_URL

protected static final java.lang.String DEFAULT_URL
The url of the default tsa server

See Also:
Constant Field Values

MESSAGE

protected static final java.lang.String MESSAGE
Message to be time stamped

See Also:
Constant Field Values
Constructor Detail

TspHttpClientDemo

public TspHttpClientDemo(java.lang.String url)
Initializes the TSP http client with the given URL.

Parameters:
url - URL to connect.
Method Detail

sendAndReceiveData

public TspHttpResponse sendAndReceiveData(TimeStampReq request)
                                   throws java.lang.NullPointerException,
                                          java.io.IOException,
                                          CodingException
This method sends a TimeStampReq to the specified time stamping server. The method waits until the server sends a TspHttpResponse back.

Parameters:
request - The TimeStampReq.
Returns:
The received TspHttpResponse
Throws:
java.lang.NullPointerException - Thrown if the given argument is null.
java.io.IOException - Thrown if a time out or any other IO exception occurs.
CodingException - Thrown if the received data could not be parsed.

main

public static void main(java.lang.String[] args)
Creates a time stamp request and sends it to the specified server.

Parameters:
args - The TSP server urk (default: http://tsp.iaik.tugraz.at/tsp/TspRequest)

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK TSP, © 2002 IAIK, © 2003 - 2014 Stiftung SIC