CARead_Demo.java文件
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
public class CARead_Demo {
CARead_Demo()
{
JFrame frame = new JFrame("证书阅读器");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});
frame.getContentPane().add(new CARead("robin.crt"),BorderLayout.CENTER);
frame.setSize(700, 425);
frame.setVisible(true);
}
}
CARead.java文件
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.table.*;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.io.*;
public class CARead extends JPanel {
private String CA_Name;
private String CA_ItemData[][] = new String[9][2];
private String[] columnNames = { "证书字段标记", "内容" };