Example usage for java.security.cert X509CRLEntry hasExtensions

List of usage examples for java.security.cert X509CRLEntry hasExtensions

Introduction

In this page you can find the example usage for java.security.cert X509CRLEntry hasExtensions.

Prototype

public abstract boolean hasExtensions();

Source Link

Document

Returns true if this CRL entry has extensions.

Usage

From source file:MainClass.java

public static void main(String[] args) throws Exception {
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    FileInputStream in = new FileInputStream(args[0]);
    X509CRL crl = (X509CRL) cf.generateCRL(in);
    Set s = crl.getRevokedCertificates();
    if (s != null && s.isEmpty() == false) {
        Iterator t = s.iterator();
        while (t.hasNext()) {
            X509CRLEntry entry = (X509CRLEntry) t.next();
            System.out.println("serial number = " + entry.getSerialNumber().toString(16));
            System.out.println("revocation date = " + entry.getRevocationDate());
            System.out.println("extensions = " + entry.hasExtensions());
        }/*from w  w  w  .j  a v a  2s .  c o m*/
    }
    in.close();
}