IAIK TSP
version 2.01

demo.tsp.connections.ssl
Class TspSSLClient

java.lang.Object
  extended bydemo.tsp.connections.ssl.TspSSLClient

public class TspSSLClient
extends Object

This class implements the TSP TCP/IP client connection over SSL. For details please refer to:
RFC 3161.


Field Summary
protected static int DEFAULT_PORT
          The default port
protected static 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 String MESSAGE
          Message to be time stamped
 
Constructor Summary
TspSSLClient(String url, int port)
          Initialize a client socket with the given URL and port number.
 
Method Summary
static void main(String[] args)
          Creates a time stamp request and sends it to the specified server.
2 Arguments present: 1 => server and 2 => port
1 Argument present: 1 => server and port 10318 will be used
0 Arguments present: tsp.iaik.at and port 10318 will be used
 TspTcpIpResponse 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 String DEFAULT_URL
The url of the default tsa server

See Also:
Constant Field Values

DEFAULT_PORT

protected static final int DEFAULT_PORT
The default port

See Also:
Constant Field Values

MESSAGE

protected static final String MESSAGE
Message to be time stamped

See Also:
Constant Field Values
Constructor Detail

TspSSLClient

public TspSSLClient(String url,
                    int port)
Initialize a client socket with the given URL and port number.

Parameters:
url - URL to connect.
port - Port to connect.
Method Detail

sendAndReceiveData

public TspTcpIpResponse sendAndReceiveData(TimeStampReq request)
                                    throws NullPointerException,
                                           IOException,
                                           TspTcpIpFormatException,
                                           iaik.asn1.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:
NullPointerException - Thrown if the given argument is null.
IOException - Thrown if a time out or any other IO exception occurs.
TspTcpIpFormatException - Thrown if the received data is a not supported response format.
iaik.asn1.CodingException - Thrown if the received data could not be parsed.

main

public static void main(String[] args)
Creates a time stamp request and sends it to the specified server.
2 Arguments present: 1 => server and 2 => port
1 Argument present: 1 => server and port 10318 will be used
0 Arguments present: tsp.iaik.at and port 10318 will be used

Parameters:
args - The first argument is the server and the second is the port

This Javadoc may contain text parts from IETF Internet Standard specifications (see copyright note) and RSA Data Security Public-Key Cryptography Standards (see copyright note).

IAIK TSP, © 2002-2004 IAIK, © 2004 Stiftung SIC