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

