Exemple #1
0
  private Set loadCRLEntries() {
    Set entrySet = new HashSet();
    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name previousCertificateIssuer = c.getIssuer();
    while (certs.hasMoreElements()) {
      TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry) certs.nextElement();
      X509CRLEntryObject crlEntry =
          new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer);
      entrySet.add(crlEntry);
      if (isIndirect && entry.hasExtensions()) {
        Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

        if (currentCaName != null) {
          previousCertificateIssuer =
              X500Name.getInstance(
                  GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
        }
      }
    }

    return entrySet;
  }
Exemple #2
0
  public X509CRLEntry getRevokedCertificate(BigInteger serialNumber) {
    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name previousCertificateIssuer = c.getIssuer();
    while (certs.hasMoreElements()) {
      TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry) certs.nextElement();

      if (serialNumber.equals(entry.getUserCertificate().getValue())) {
        return new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer);
      }

      if (isIndirect && entry.hasExtensions()) {
        Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

        if (currentCaName != null) {
          previousCertificateIssuer =
              X500Name.getInstance(
                  GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
        }
      }
    }

    return null;
  }