if (!authorizationsession.isAuthorizedNoLog(administrator, AccessRulesConstants.CAPREFIX + issuerdn.hashCode())) {
Authorizer.throwAuthorizationException(administrator, AccessRulesConstants.CAPREFIX + issuerdn.hashCode(), "Not authorized to view certificate.");
}
Certificate cert = certificatesession.findCertificateByIssuerAndSerno(administrator, issuerdn, serno);
if (cert != null) {
RevokedInfoView revokedinfo = null;
String username = certificatesession.findUsernameByCertSerno(administrator, serno, CertTools.getIssuerDN(cert));
if (this.userAdminSession.findUser(administrator, username) != null) {
int endentityprofileid = this.userAdminSession.findUser(administrator, username).getEndEntityProfileId();
this.endEntityAuthorization(administrator, endentityprofileid, AccessRulesConstants.VIEW_RIGHTS, true);
}
CertificateStatus revinfo = certificatesession.getStatus(CertTools.getIssuerDN(cert), CertTools.getSerialNumber(cert));
if (revinfo != null) {
revokedinfo = new RevokedInfoView(revinfo, CertTools.getSerialNumber(cert));
}
certificates = new CertificateView[1];
certificates[0] = new CertificateView(cert, revokedinfo, username);
} else {
certificates = null;