java安全性编程实例电子版书附源码,是网络安全编程者不可多得的好书
源代码在线查看: cstore.java
import java.util.*;
import java.io.*;
import java.security.*;
import java.security.cert.*;
import java.security.cert.Certificate;
public class CStore{
public static void main(String args[ ]) throws Exception{
CertificateFactory cf = CertificateFactory.getInstance("X.509");
List mylist = new ArrayList();
for(int i=0;i FileInputStream in=new FileInputStream(args[i]);
Certificate c=cf.generateCertificate(in);
mylist.add(c);
}
CertStoreParameters cparam=new CollectionCertStoreParameters(mylist);
CertStore cs=CertStore.getInstance("Collection",cparam);
System.out.println(cs.getCertStoreParameters() );
System.out.println(cs.getProvider());
System.out.println(cs.getType());
}
}