This is the socket implement of TSP protocol.
The original rfc can be find at http://www.imc.org/draft-ietf-pkix-time-stamp

This package include:
tsp_client.c : a command interface program, read command from input, can be
	       used to connect TSP server send request, message digest, 
	       verify token  
tsp_cmd.c    : what the  command do
tsp_net.c    : client network interface program 
tsp_server.c : TSP server program, listen on Request Port, read in request,
	       response TimeStamp Token.
tspdef.h     : TSP Head file

You can run both server an client at the same machine, or run 
server and client at different machine.

To run the program: 
1. start tsp_server yzou1.p12 at a shell window at one machine like sunserver1

sunserver1$tsp_server  yzou1.p12
Start TSP SERVER at : sunserver1 
  Certificate file:  yzou1.p12  
  Download from http://www.cs.umbc.edu/~yzou1/yzou1@cs.umbc.edu.p12  
------------------------------------
  Listenning port 8633... 

2. start tsp_client at another shell window at one machine like grad-sun-06

3. type help in client shell window
Commands are:
  HELP        - Print helpful information about a command
  DIGEST      - Compute a Message-Digest number for a file
  CONNECT     - Connect to TSP server
  CERTIFICATE - Get TSP server's certificate, save to file
  VERIFY      - Verify a Timestamp
  REQUEST     - Request a time stamp token from a TSP server
  QUIT        - Exit tsppki console
  INFO        - Show information
4. type connect sunserver1 at client shell window 
TSP_PKI> connect sunserver1
Connect to TSP Server :  sunserver1 
The x509 certificate is located at  
     http://www.cs.umbc.edu/~yzou1/yzou1@cs.umbc.edu.p12  

5. type certificate ServerCertificate ta.cer at client shell window 
   ( copy Server certificate location from output at last step ) 
TSP_PKI> certificate http://www.cs.umbc.edu/~yzou1/yzou1@cs.umbc.edu.p12 ta.cer
./wget http://www.cs.umbc.edu/~yzou1/yzou1@cs.umbc.edu.p12 -O ta.cer  
--11:23:27--  http://www.cs.umbc.edu:80/%7Eyzou1/yzou1%40cs.umbc.edu.p12
           => `ta.cer'
Connecting to www.cs.umbc.edu:80... connected!
HTTP request sent, awaiting response... 200 OK
Length: 3,099 [text/plain]

    0K -> ...                                                    [100%]

11:23:27 (1.48 MB/s) - `ta.cer' saved [3099/3099]

6. type digest email.txt at client shell window 
TSP_PKI> digest email.txt
./ssleay dgst email.txt  
MD5(email.txt)= 9062818909d0088b5d443d0ec20487b2

7. type request email.ts MD  ( MD is the number output at last step) 
TSP_PKI> request email.ts 9062818909d0088b5d443d0ec20487b2
Send TSP request to Server  sunserver1 
        hashAlgorithm = MD5 
        hashedMessage = 9062818909d0088b5d443d0ec20487b2 
Waiting for response from Server 
Got Response from TSA Server 
        statusString = Granted 
        contenttype = pkcs 
Decrypt the signed TimeStampToken 
        ./ssleay enc -in email.ts -out tmpfile.3 -d -a -k abc   
        Version = 1
        hashAlgorithm = MD5
        hashedMessage = 9062818909d0088b5d443d0ec20487b2
        gentime = Wed Dec 31 19:00:00 1969

        ordering = 1

        accurity = 1

8. type verify ta.cer email.ts at client shell window
TSP_PKI> verify ta.cer email.ts
./ssleay verify -CAfile  ta.cer email.ts  
load certificate file
OK

9. type quit at client shell window



Youyong Zou.
Dec.12/2000
