Fail to generate CertPath

Hi all,

I'm developing a little test program that required eCert, and the program like this:-

public class TestHadh {

private String str;

public static void main(String[] args) {

// TODO Auto-generated method stub

try {

// soultion 1

CertificateFactory cf = CertificateFactory.getInstance("X.509");

System.out.println("- 0 -");

FileInputStream in = new FileInputStream("C:\\cityU\\semester5\\EC6001\\fyp\\keystore\\fypCert.cer");

System.out.println("-1");

java.security.cert.Certificate c = cf.generateCertificate(in);

System.out.println(c.toString());

System.out.println("-2");

CertPath cPath = cf.generateCertPath(in);

System.out.println("--3 --");

Timestamp t = new Timestamp(new Date(),cPath);

String str = t.getTimestamp().toString();

System.out.println(str);

} catch (Exception e){

e.printStackTrace();

}

}

}

I used java keytool to generate the certificate 'fypCert.cer'. I have no problem to compile the program, but caught the following exception when I executed it. Can anybody tell what's wrong with my program?

Thx

Leo

[1204 byte] By [leo.ckpa] at [2007-10-2 14:46:58]
# 1
post in code tagswhats your code supposed to do?
_bensmytha at 2007-7-13 13:21:17 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2

The program is supposed to do electronic notarization such as intellectual property protection, verify the when is a Will declared etc.

In the program, I apply a self generated eCert to generate a timestamp for the aforesaid purpose, however, I caught an exception when generate a CertPath. So any idea?

leo.ckpa at 2007-7-13 13:21:17 > top of Java-index,Security,Other Security APIs, Tools, and Issues...