if (certprofiletype == 0 || certprofiletype == SecConst.CERTTYPE_SUBCA)
if (certprofiletype == 0 || certprofiletype == CertificateDataBean.CERTTYPE_SUBCA)
    public Collection getAuthorizedCertificateProfileIds(Admin admin, int certprofiletype) {        ArrayList returnval = new ArrayList();        Collection result = null;        HashSet authorizedcaids = new HashSet(getAuthorizationSession().getAuthorizedCAIds(admin));        // Add fixed certificate profiles.        if (certprofiletype == 0 || certprofiletype == SecConst.CERTTYPE_ENDENTITY || certprofiletype == SecConst.CERTTYPE_HARDTOKEN)            returnval.add(new Integer(SecConst.CERTPROFILE_FIXED_ENDUSER));        if (certprofiletype == 0 || certprofiletype == SecConst.CERTTYPE_SUBCA)            returnval.add(new Integer(SecConst.CERTPROFILE_FIXED_SUBCA));        if (certprofiletype == 0 || certprofiletype == SecConst.CERTTYPE_ROOTCA)            returnval.add(new Integer(SecConst.CERTPROFILE_FIXED_ROOTCA));        if (certprofiletype == 0 || certprofiletype == SecConst.CERTTYPE_HARDTOKEN) {            returnval.add(new Integer(SecConst.CERTPROFILE_FIXED_HARDTOKENAUTH));            returnval.add(new Integer(SecConst.CERTPROFILE_FIXED_HARDTOKENAUTHENC));            returnval.add(new Integer(SecConst.CERTPROFILE_FIXED_HARDTOKENENC));            returnval.add(new Integer(SecConst.CERTPROFILE_FIXED_HARDTOKENSIGN));        }        try {            result = certprofilehome.findAll();            Iterator i = result.iterator();            while (i.hasNext()) {                CertificateProfileDataLocal next = (CertificateProfileDataLocal) i.next();                CertificateProfile profile = next.getCertificateProfile();                // Check if all profiles available CAs exists in authorizedcaids.                if (certprofiletype == 0 || certprofiletype == profile.getType()                        || (profile.getType() == SecConst.CERTTYPE_ENDENTITY &&                        certprofiletype == SecConst.CERTTYPE_HARDTOKEN)) {                    Iterator availablecas = profile.getAvailableCAs().iterator();                    boolean allexists = true;                    while (availablecas.hasNext()) {                        Integer nextcaid = (Integer) availablecas.next();                        if (nextcaid.intValue() == CertificateProfile.ANYCA) {                            allexists = true;                            break;                        }                        if (!authorizedcaids.contains(nextcaid)) {                            allexists = false;                            break;                        }                    }                    if (allexists)                        returnval.add(next.getId());                }            }        } catch (FinderException e) {        }        return returnval;    } // getAuthorizedCertificateProfileNames