UserAdminData returnval = null;
    public void checkIfCertificateBelongToAdmin(Admin admin, BigInteger certificatesnr, String issuerdn) throws AuthorizationDeniedException {        debug(">checkIfCertificateBelongToAdmin(" + certificatesnr + ")");        String username = certificatesession.findUsernameByCertSerno(admin, certificatesnr, issuerdn);        UserAdminData returnval = null;        UserDataLocal data = null;        if (username != null) {            UserDataPK pk = new UserDataPK(username);            try {                data = home.findByPrimaryKey(pk);            } catch (FinderException e) {                log.debug("Cannot find user with username='" + username + "'");            }        }        if (data != null) {            int type = data.getType();            if ((type & SecConst.USER_ADMINISTRATOR) == 0) {                logsession.log(admin, data.getCAId(), LogEntry.MODULE_RA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_ADMINISTRATORLOGGEDIN, "Certificate didn't belong to an administrator.");                throw new AuthorizationDeniedException("Your certificate does not belong to an administrator.");            }        } else {            logsession.log(admin, ILogSessionLocal.INTERNALCAID, LogEntry.MODULE_RA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_ADMINISTRATORLOGGEDIN, "Certificate didn't belong to any user.");            throw new AuthorizationDeniedException("Your certificate does not belong to any user.");        }        debug("<checkIfCertificateBelongToAdmin()");    } // checkIfCertificateBelongToAdmin