java查看证书有效期

public static void main(String[] args) throws  CertificateException, FileNotFoundException {
        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        FileInputStream in = new  FileInputStream("G://test.cer");
        X509Certificate cert = (X509Certificate) cf.generateCertificate(in);
        Date effDate = cert.getNotBefore();
        Date expDate = cert.getNotAfter();
        System.out.println(effDate);
        System.out.println(expDate);
    }

上一篇:电子标签拣货系统DPS


下一篇:pin limiting the speed