RevokedCertInfo revinfo = certificatesession.isRevoked(admin, CertTools.getIssuerDN(certificate),certificate.getSerialNumber());
RevokedCertInfo revinfo = certificatesession.isRevoked(new Admin(certificate), CertTools.getIssuerDN(certificate),certificate.getSerialNumber());
    public void authenticate(X509Certificate certificate) throws AuthenticationFailedException {      // Check Validity        try{          certificate.checkValidity();        }catch(Exception e){           throw new AuthenticationFailedException("Your certificates vality has expired.");        }        // TODO /*     // Vertify Signature        boolean verified = false;        for(int i=0; i < this.cacertificatechain.length; i++){           try{//            System.out.println("Authorizer: authenticate : Comparing : "  + CertTools.getIssuerDN(certificate) + " With " + CertTools.getSubjectDN((X509Certificate) cacertificatechain[i]));//            if(LDAPDN.equals(CertTools.getIssuerDN(certificate), CertTools.getSubjectDN((X509Certificate) cacertificatechain[i]))){               certificate.verify(cacertificatechain[i].getPublicKey());               verified = true;//            }           }catch(Exception e){}        }        if(!verified)           throw new AuthenticationFailedException("Your certificate cannot be verified by CA certificate chain.");*/      // Check if certificate is revoked.        RevokedCertInfo revinfo = certificatesession.isRevoked(admin, CertTools.getIssuerDN(certificate),certificate.getSerialNumber());        if (revinfo == null) {            // Certificate missing            throw new AuthenticationFailedException("Your certificate cannot be found in database.");        } else if (revinfo.getReason() != RevokedCertInfo.NOT_REVOKED) {            // Certificate revoked            throw new AuthenticationFailedException("Your certificate have been revoked.");        }    }