1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
import java.security.cert.*;
import java.io.*;
public class ReadCRL
{
public static void main(String[] args)
{
InputStream inStream = null;
try{
inStream = new FileInputStream("crl_web.crl");
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509CRL crl = (X509CRL)cf.generateCRL(inStream);
for (X509CRLEntry entry : crl.getRevokedCertificates())
System.out.println(entry);
} catch (Exception e) {
e.printStackTrace();
} finally {
try{
inStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
} |