List of usage examples for org.bouncycastle.cert X509CRLEntryHolder getSerialNumber
public BigInteger getSerialNumber()
From source file:se.tillvaxtverket.tsltrust.webservice.daemon.ca.CertificationAuthority.java
License:Open Source License
public void logRevocation(List<DbCert> revCertList) { List<Long> crlList = new LinkedList<Long>(); if (latestCrl != null) { X509CRLEntryHolder revokedCertificate = latestCrl.getRevokedCertificate(BigInteger.ZERO); latestCrl.getRevokedCertificates().iterator().forEachRemaining((crlEntryObj) -> { X509CRLEntryHolder crlEntry = (X509CRLEntryHolder) crlEntryObj; long revokedSerial = crlEntry.getSerialNumber().longValue(); crlList.add(revokedSerial);/*from w w w . j a va 2s .co m*/ }); } for (DbCert dbCert : revCertList) { if (!crlList.contains((long) dbCert.getSerial())) { //update log DbCALog caLog = new DbCALog(); caLog.setLogCode(REVOKE_EVENT); caLog.setEventString("Certificate revoked"); caLog.setLogParameter(dbCert.getSerial() * 256 + CRLReason.privilegeWithdrawn); caLog.setLogTime(dbCert.getRevDate()); CaSQLiteUtil.addCertLog(caLog, caDir); } } }